mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Add pg_dump support for ALTER obj DEPENDS ON EXTENSION
pg_dump is oblivious to this kind of dependency, so they're lost on
dump/restores (and pg_upgrade). Have pg_dump emit ALTER lines so that
they're preserved. Add some pg_dump tests for the whole thing, also.
Reviewed-by: Tom Lane (offlist)
Reviewed-by: Ibrar Ahmed
Reviewed-by: Ahsan Hadi (who also reviewed commit 899a04f5ed
)
Discussion: https://postgr.es/m/20200217225333.GA30974@alvherre.pgsql
This commit is contained in:
@ -523,6 +523,38 @@ my %tests = (
|
||||
like => { binary_upgrade => 1, },
|
||||
},
|
||||
|
||||
'ALTER INDEX pkey DEPENDS ON extension' => {
|
||||
create_order => 11,
|
||||
create_sql =>
|
||||
'CREATE TABLE regress_pg_dump_schema.extdependtab (col1 integer primary key, col2 int);
|
||||
CREATE INDEX ON regress_pg_dump_schema.extdependtab (col2);
|
||||
ALTER INDEX regress_pg_dump_schema.extdependtab_col2_idx DEPENDS ON EXTENSION test_pg_dump;
|
||||
ALTER INDEX regress_pg_dump_schema.extdependtab_pkey DEPENDS ON EXTENSION test_pg_dump;',
|
||||
regexp => qr/^
|
||||
\QALTER INDEX regress_pg_dump_schema.extdependtab_pkey DEPENDS ON EXTENSION test_pg_dump;\E\n
|
||||
/xms,
|
||||
like => {%pgdump_runs},
|
||||
unlike => {
|
||||
data_only => 1,
|
||||
pg_dumpall_globals => 1,
|
||||
section_data => 1,
|
||||
section_pre_data => 1,
|
||||
},
|
||||
},
|
||||
|
||||
'ALTER INDEX idx DEPENDS ON extension' => {
|
||||
regexp => qr/^
|
||||
\QALTER INDEX regress_pg_dump_schema.extdependtab_col2_idx DEPENDS ON EXTENSION test_pg_dump;\E\n
|
||||
/xms,
|
||||
like => {%pgdump_runs},
|
||||
unlike => {
|
||||
data_only => 1,
|
||||
pg_dumpall_globals => 1,
|
||||
section_data => 1,
|
||||
section_pre_data => 1,
|
||||
},
|
||||
},
|
||||
|
||||
# Objects not included in extension, part of schema created by extension
|
||||
'CREATE TABLE regress_pg_dump_schema.external_tab' => {
|
||||
create_order => 4,
|
||||
|
Reference in New Issue
Block a user