Skip to content
This repository was archived by the owner on Apr 2, 2024. It is now read-only.

Prune non-idempotent objects from pgx-generated SQL #69

Merged
merged 1 commit into from
Feb 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/aggregates/gapfill_delta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ unsafe extern "C" fn gapfill_delta_final(fcinfo: pg_sys::FunctionCallInfo) -> pg
}

#[derive(Serialize, Deserialize, PostgresType, Debug)]
#[pgx(sql = false)]
pub struct GapfillDeltaTransition {
window: VecDeque<(pg_sys::TimestampTz, f64)>,
// a Datum for each index in the array, 0 by convention if the value is NULL
Expand Down
2 changes: 1 addition & 1 deletion src/aggregates/prom_delta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ unsafe extern "C" fn prom_delta_final_wrapper(fcinfo: pg_sys::FunctionCallInfo)
// for proper behavior the input must be ORDER BY sample_time
extension_sql!(
r#"
CREATE AGGREGATE @[email protected]_delta(
CREATE OR REPLACE AGGREGATE @[email protected]_delta(
lowest_time TIMESTAMPTZ,
greatest_time TIMESTAMPTZ,
step_size BIGINT,
Expand Down
2 changes: 1 addition & 1 deletion src/aggregates/prom_increase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ unsafe extern "C" fn gapfill_increase_transition(
// for proper behavior the input must be ORDER BY sample_time
extension_sql!(
r#"
CREATE AGGREGATE @[email protected]_increase(
CREATE OR REPLACE AGGREGATE @[email protected]_increase(
lowest_time TIMESTAMPTZ,
greatest_time TIMESTAMPTZ,
step_size BIGINT,
Expand Down
2 changes: 1 addition & 1 deletion src/aggregates/prom_rate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ unsafe extern "C" fn gapfill_rate_transition(fcinfo: pg_sys::FunctionCallInfo) -
// for proper behavior the input must be ORDER BY sample_time
extension_sql!(
r#"
CREATE AGGREGATE @[email protected]_rate(
CREATE OR REPLACE AGGREGATE @[email protected]_rate(
lowest_time TIMESTAMPTZ,
greatest_time TIMESTAMPTZ,
step_size BIGINT,
Expand Down
2 changes: 1 addition & 1 deletion src/aggregates/vector_selector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ fn vector_selector_combine_inner(

extension_sql!(
r#"
CREATE AGGREGATE @[email protected]_selector(
CREATE OR REPLACE AGGREGATE @[email protected]_selector(
start_time TIMESTAMPTZ,
end_time TIMESTAMPTZ,
bucket_width BIGINT,
Expand Down
1 change: 0 additions & 1 deletion src/bin/sql-generator.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/* Auto-generated by pgx. You may edit this, or delete it to have a new one created. */
pgx::pg_binary_magic!(promscale);