-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix pg_dump error on powa_module_config
powa_modules are used for cluster-wide pg_stat datasources and do not support custom datasources. powa_modules and powa_module_functions got it right and don't have the usual "added_manually" column used to distinguish custom rows, but powa_module_functions had a wrong reference to this column. Also, powa_module_config was incorrectly created with an added_manually column, and dump was configure using it but the extension install script was incorrectly marking some of the init-time data to be custom. To fix, get rid of any mention of that column in either the table structure of the dump config. Thanks to github user guruguruguru for the report.
- Loading branch information
Showing
2 changed files
with
10 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
-- complain if script is sourced in psql, rather than via CREATE EXTENSION | ||
\echo Use "ALTER EXTENSION powa" to load this file. \quit | ||
|
||
ALTER TABLE @[email protected]_module_config DROP COLUMN added_manually; | ||
|
||
SELECT pg_catalog.pg_extension_config_dump('@[email protected]_module_config',''); | ||
SELECT pg_catalog.pg_extension_config_dump('@[email protected]_module_functions',''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -225,17 +225,16 @@ CREATE TABLE @[email protected]_module_config ( | |
srvid integer NOT NULL, | ||
module text NOT NULL, | ||
enabled bool NOT NULL default true, | ||
added_manually boolean NOT NULL default true, | ||
PRIMARY KEY (srvid, module), | ||
FOREIGN KEY (srvid) REFERENCES @[email protected]_servers(id) | ||
MATCH FULL ON UPDATE CASCADE ON DELETE CASCADE, | ||
FOREIGN KEY (module) REFERENCES @[email protected]_modules(module) | ||
MATCH FULL ON UPDATE CASCADE ON DELETE CASCADE | ||
); | ||
|
||
INSERT INTO @[email protected]_module_config (srvid, module, added_manually) VALUES | ||
(0, 'pg_database', false), | ||
(0, 'pg_role', false); | ||
INSERT INTO @[email protected]_module_config (srvid, module) VALUES | ||
(0, 'pg_database'), | ||
(0, 'pg_role'); | ||
|
||
CREATE TABLE @[email protected]_module_functions ( | ||
module text NOT NULL, | ||
|
@@ -3166,8 +3165,8 @@ SELECT pg_catalog.pg_extension_config_dump('@[email protected]_all_tables_history_ | |
SELECT pg_catalog.pg_extension_config_dump('@[email protected]_extensions','WHERE added_manually'); | ||
SELECT pg_catalog.pg_extension_config_dump('@[email protected]_extension_functions','WHERE added_manually'); | ||
SELECT pg_catalog.pg_extension_config_dump('@[email protected]_extension_config','WHERE added_manually'); | ||
SELECT pg_catalog.pg_extension_config_dump('@[email protected]_module_functions','WHERE added_manually'); | ||
SELECT pg_catalog.pg_extension_config_dump('@[email protected]_module_config','WHERE added_manually'); | ||
SELECT pg_catalog.pg_extension_config_dump('@[email protected]_module_functions',''); | ||
SELECT pg_catalog.pg_extension_config_dump('@[email protected]_module_config',''); | ||
SELECT pg_catalog.pg_extension_config_dump('@[email protected]_catalog_databases',''); | ||
SELECT pg_catalog.pg_extension_config_dump('@[email protected]_catalog_roles',''); | ||
SELECT pg_catalog.pg_extension_config_dump('@[email protected]_catalog_class',''); | ||
|