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

Commit 38ee350

Browse files
committed
Use explicit schema names
Currently these work in promscale because of how the search path is configured, but they will need adjusting when we move this SQL to the extension.
1 parent 27a22fe commit 38ee350

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

pkg/migrations/migration_files_generated.go

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/migrations/sql/idempotent/maintenance.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ BEGIN
2020
WHERE EXISTS (
2121
SELECT 1 FROM
2222
SCHEMA_CATALOG.get_storage_hypertable_info(m.table_schema, m.table_name, m.is_view) hi
23-
INNER JOIN show_chunks(hi.hypertable_relation,
23+
INNER JOIN SCHEMA_TIMESCALE.show_chunks(hi.hypertable_relation,
2424
older_than=>NOW() - SCHEMA_CATALOG.get_metric_retention_period(m.table_schema, m.metric_name)) sc ON TRUE)
2525
--random order also to prevent starvation
2626
ORDER BY random();

pkg/migrations/sql/idempotent/telemetry.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ $$
136136
END IF;
137137

138138
-- First try to use promscale_extension to fill the metadata table.
139-
PERFORM update_tsprom_metadata(telemetry_name, telemetry_value, TRUE);
139+
PERFORM SCHEMA_EXT.update_tsprom_metadata(telemetry_name, telemetry_value, TRUE);
140140

141141
-- If promscale_extension is not installed, the above line will fail. Hence, catch the exception and try the manual way.
142142
EXCEPTION WHEN OTHERS THEN

pkg/migrations/sql/preinstall/006-install_uda.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ GRANT EXECUTE ON FUNCTION SCHEMA_CATALOG.is_timescaledb_oss() TO prom_reader;
4747
DO $$
4848
BEGIN
4949
IF NOT SCHEMA_CATALOG.is_timescaledb_oss() AND SCHEMA_CATALOG.get_timescale_major_version() >= 2 THEN
50-
PERFORM add_job('SCHEMA_CATALOG.execute_maintenance_job', '30 min');
51-
PERFORM add_job('SCHEMA_CATALOG.execute_maintenance_job', '30 min');
50+
PERFORM SCHEMA_TIMESCALE.add_job('SCHEMA_CATALOG.execute_maintenance_job', '30 min');
51+
PERFORM SCHEMA_TIMESCALE.add_job('SCHEMA_CATALOG.execute_maintenance_job', '30 min');
5252
END IF;
5353
END
5454
$$;

pkg/telemetry/telemetry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func (t *engineImpl) writeMetadata() error {
106106
}
107107

108108
const (
109-
metadataUpdateWithExtension = "SELECT update_tsprom_metadata($1, $2, $3)"
109+
metadataUpdateWithExtension = "SELECT " + schema.Ext + ".update_tsprom_metadata($1, $2, $3)"
110110
metadataUpdateNoExtension = "INSERT INTO _timescaledb_catalog.metadata(key, value, include_in_telemetry) VALUES ('promscale_' || $1, $2, $3) ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value, include_in_telemetry = EXCLUDED.include_in_telemetry"
111111
)
112112

0 commit comments

Comments
 (0)