Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove GUC #395

Merged
merged 2 commits into from
Apr 25, 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
5 changes: 0 additions & 5 deletions docs/timeseries.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ INSERT INTO test
INSERT 0 4032
```

While still expermental, we'll need to set this before creating our view:
```SQL , non-transactional,ignore-output
SET timescaledb_toolkit_acknowledge_auto_drop TO 'true';
```

Now lets capture this data into a time series which we'll store in a view.

```SQL ,non-transactional,ignore-output
Expand Down
1 change: 0 additions & 1 deletion docs/timeseries_pipeline_elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ INSERT INTO test_data

Now suppose we want to know how much the temperature fluctuates on a daily basis for each device. Using timevector and pipelines can simplify the process of finding the answer:
```SQL ,non-transactional,ignore-output
SET timescaledb_toolkit_acknowledge_auto_drop TO 'true';
CREATE VIEW daily_delta AS
SELECT device,
toolkit_experimental.timevector(time, temperature)
Expand Down
15 changes: 0 additions & 15 deletions extension/src/frequency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -736,11 +736,6 @@ mod tests {
.get_one::<String>()
.unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select(
"SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'",
None,
None,
);

client.select("SET TIMEZONE to UTC", None, None);
client.select(
Expand Down Expand Up @@ -775,11 +770,6 @@ mod tests {
.get_one::<String>()
.unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select(
"SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'",
None,
None,
);

client.select("SET TIMEZONE to UTC", None, None);
client.select(
Expand Down Expand Up @@ -1016,11 +1006,6 @@ mod tests {
.get_one::<String>()
.unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select(
"SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'",
None,
None,
);

client.select("SET TIMEZONE to UTC", None, None);
client.select(
Expand Down
12 changes: 1 addition & 11 deletions extension/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,9 @@ use pgx::*;

pgx::pg_module_magic!();

static EXPERIMENTAL_ENABLED: GucSetting<bool> = GucSetting::new(false);

#[pg_guard]
pub extern "C" fn _PG_init() {
GucRegistry::define_bool_guc(
"timescaledb_toolkit_acknowledge_auto_drop",
"enable creation of auto-dropping objects using experimental timescaledb_toolkit_features",
"experimental features are very unstable, and objects \
depending on them will be automatically deleted on extension update",
&EXPERIMENTAL_ENABLED,
//TODO should this be superuser?
GucContext::Userset,
);
// Nothing to do here
}

extension_sql!(r#"GRANT USAGE ON SCHEMA toolkit_experimental TO PUBLIC;"#,
Expand Down
2 changes: 0 additions & 2 deletions extension/src/time_series/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

client.select(
"CREATE TABLE lttb_pipe (series timevector)",
Expand Down Expand Up @@ -544,7 +543,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

let output = client.select(
"EXPLAIN (verbose) SELECT timevector('2021-01-01'::timestamptz, 0.1) -> round() -> abs() -> round();",
Expand Down
12 changes: 0 additions & 12 deletions extension/src/time_series/pipeline/aggregation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

// we use a subselect to guarantee order
let create_series = "SELECT timevector(time, value) as series FROM \
Expand Down Expand Up @@ -751,7 +750,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

let output = client.select(
"EXPLAIN (verbose) SELECT \
Expand Down Expand Up @@ -785,7 +783,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

// we use a subselect to guarantee order
let create_series = "SELECT timevector(time, value) as series FROM \
Expand Down Expand Up @@ -814,7 +811,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

let output = client.select(
"EXPLAIN (verbose) SELECT \
Expand Down Expand Up @@ -847,7 +843,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

// we use a subselect to guarantee order
let create_series = "SELECT timevector(time, value) as series FROM \
Expand Down Expand Up @@ -876,7 +871,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

let output = client.select(
"EXPLAIN (verbose) SELECT \
Expand Down Expand Up @@ -909,7 +903,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

// we use a subselect to guarantee order
let create_series = "SELECT timevector(time, value) as series FROM \
Expand Down Expand Up @@ -938,7 +931,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

let output = client.select(
"EXPLAIN (verbose) SELECT \
Expand Down Expand Up @@ -971,7 +963,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

// we use a subselect to guarantee order
let create_series = "SELECT timevector(time, value) as series FROM \
Expand Down Expand Up @@ -1031,7 +1022,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

// we use a subselect to guarantee order
let create_series = "SELECT timevector(time, value) as series FROM \
Expand Down Expand Up @@ -1095,7 +1085,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

// we use a subselect to guarantee order
let create_series = "SELECT timevector(time, value) as series FROM \
Expand Down Expand Up @@ -1141,7 +1130,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

let output = client.select(
"EXPLAIN (verbose) SELECT \
Expand Down
2 changes: 0 additions & 2 deletions extension/src/time_series/pipeline/arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

// we use a subselect to guarantee order
let create_series = "SELECT timevector(time, value) as series FROM \
Expand Down Expand Up @@ -406,7 +405,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

// we use a subselect to guarantee order
let create_series = "SELECT timevector(time, value) as series FROM \
Expand Down
1 change: 0 additions & 1 deletion extension/src/time_series/pipeline/delta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

client.select(
"CREATE TABLE series(time timestamptz, value double precision)",
Expand Down
3 changes: 0 additions & 3 deletions extension/src/time_series/pipeline/expansion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

// we use a subselect to guarantee order
let create_series = "SELECT timevector(time, value) as series FROM \
Expand Down Expand Up @@ -215,7 +214,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

// we use a subselect to guarantee order
let create_series = "SELECT timevector(time, value) as series FROM \
Expand Down Expand Up @@ -244,7 +242,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

// `-> materialize()` should force materialization, but otherwise the
// pipeline-folding optimization should proceed
Expand Down
1 change: 0 additions & 1 deletion extension/src/time_series/pipeline/fill_holes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

client.select(
"CREATE TABLE gappy_series(time timestamptz, value double precision)",
Expand Down
1 change: 0 additions & 1 deletion extension/src/time_series/pipeline/fill_to.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

client.select(
"CREATE TABLE series(time timestamptz, value double precision)",
Expand Down
1 change: 0 additions & 1 deletion extension/src/time_series/pipeline/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

client.select(
"CREATE TABLE series(time timestamptz, value double precision)",
Expand Down
6 changes: 0 additions & 6 deletions extension/src/time_series/pipeline/lambda.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);
client.select("SELECT $$ let $1 = 1.0; 2.0, $1 $$::toolkit_experimental.lambda", None, None);
// client.select("SELECT $$ '1 day'i $$::toolkit_experimental.lambda", None, None);
// client.select("SELECT $$ '2020-01-01't $$::toolkit_experimental.lambda", None, None);
Expand Down Expand Up @@ -625,7 +624,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

bool_lambda_eq!(client, "2.0 < 3.0", "true");
bool_lambda_eq!(client, "2.0 <= 3.0", "true");
Expand Down Expand Up @@ -666,7 +664,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

f64_lambda_eq!(client, "pi()", std::f64::consts::PI);

Expand Down Expand Up @@ -707,7 +704,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

f64_lambda_eq!(client, "-(2.0)", -2.0f64);
f64_lambda_eq!(client, "-(-2.0)", 2.0f64);
Expand All @@ -729,7 +725,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

interval_lambda_eq!(client, "'1 day'i + '1 day'i", "2 days");
interval_lambda_eq!(client, "'1 day'i + '1 week'i", "8 days");
Expand All @@ -749,7 +744,6 @@ mod tests {
// difficult to spot otherwise.
let sp = client.select("SELECT format(' %s, toolkit_experimental',current_setting('search_path'))", None, None).first().get_one::<String>().unwrap();
client.select(&format!("SET LOCAL search_path TO {}", sp), None, None);
client.select("SET timescaledb_toolkit_acknowledge_auto_drop TO 'true'", None, None);

f64_lambda_eq!(client, "let $foo = 2.0; $foo", 2.0);
f64_lambda_eq!(client, "let $foo = -2.0; $foo", -2.0);
Expand Down
Loading