Skip to content

Commit

Permalink
Adding a comment in the debug_json.sql to make the failure cause easi…
Browse files Browse the repository at this point in the history
…er to understand.
  • Loading branch information
Hamid Akhtar committed Mar 28, 2024
1 parent 1883444 commit 5900aa7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions expected/debug_json.out
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ HAVING COUNT(*) = (
matches
(1 row)

-- Databases count will fail if you have any preexisting databases other than the standard template1 and postgres
SELECT 'matches' AS databases_count_calc
FROM pg_database
WHERE datallowconn = true
Expand All @@ -82,5 +83,6 @@ HAVING COUNT(*) = (
matches
(1 row)

-- Databases count will fail if you have any preexisting databases other than the standard template1 and postgres
DROP EXTENSION percona_telemetry;
DROP FUNCTION read_json_file;
4 changes: 3 additions & 1 deletion sql/debug_json.sql
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ HAVING COUNT(*) = (
)
+ CAST(NOT EXISTS (SELECT * FROM pg_settings where name like '%pg_telemetry_folder') AS INTEGER)
);
-- Databases count will fail if you have any preexisting databases other than the standard template1 and postgres

SELECT 'matches' AS databases_count_calc
FROM pg_database
Expand All @@ -60,6 +61,7 @@ HAVING COUNT(*) = (
SELECT json_array_length(read_json_file()::JSON->'databases')
+ CAST(NOT EXISTS (SELECT * FROM pg_settings where name like '%pg_telemetry_folder') AS INTEGER)
);
-- Databases count will fail if you have any preexisting databases other than the standard template1 and postgres

DROP EXTENSION percona_telemetry;
DROP FUNCTION read_json_file;
DROP FUNCTION read_json_file;

0 comments on commit 5900aa7

Please sign in to comment.