aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/pg_dump/pg_dump.c4
-rw-r--r--src/test/modules/test_pg_dump/t/001_base.pl24
-rw-r--r--src/test/modules/test_pg_dump/test_pg_dump--1.0.sql5
3 files changed, 31 insertions, 2 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index d3ca54e4dc6..784bceaec39 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -2095,6 +2095,8 @@ dumpTableData_insert(Archive *fout, void *dcontext)
if (nfields == 0)
continue;
+ Assert(tbinfo->attgenerated);
+
/* Emit a row heading */
if (rows_per_statement == 1)
archputs(" (", fout);
@@ -17913,6 +17915,8 @@ processExtensionTables(Archive *fout, ExtensionInfo extinfo[],
configtbl->dataObj->filtercond = pg_strdup(extconditionarray[j]);
}
}
+
+ configtbl->interesting = dumpobj;
}
}
if (extconfigarray)
diff --git a/src/test/modules/test_pg_dump/t/001_base.pl b/src/test/modules/test_pg_dump/t/001_base.pl
index ae120a5ee36..78aa07ce511 100644
--- a/src/test/modules/test_pg_dump/t/001_base.pl
+++ b/src/test/modules/test_pg_dump/t/001_base.pl
@@ -135,6 +135,12 @@ my %pgdump_runs = (
"$tempdir/defaults_tar_format.tar",
],
},
+ extension_schema => {
+ dump_cmd => [
+ 'pg_dump', '--schema=public', '--inserts',
+ "--file=$tempdir/extension_schema.sql", 'postgres',
+ ],
+ },
pg_dumpall_globals => {
dump_cmd => [
'pg_dumpall', '--no-sync',
@@ -301,8 +307,9 @@ my %tests = (
\n/xm,
like => {
%full_runs,
- data_only => 1,
- section_data => 1,
+ data_only => 1,
+ section_data => 1,
+ extension_schema => 1,
},
},
@@ -536,6 +543,7 @@ my %tests = (
like => {%pgdump_runs},
unlike => {
data_only => 1,
+ extension_schema => 1,
pg_dumpall_globals => 1,
section_data => 1,
section_pre_data => 1,
@@ -549,6 +557,7 @@ my %tests = (
like => {%pgdump_runs},
unlike => {
data_only => 1,
+ extension_schema => 1,
pg_dumpall_globals => 1,
section_data => 1,
section_pre_data => 1,
@@ -569,6 +578,17 @@ my %tests = (
schema_only => 1,
section_pre_data => 1,
},
+ },
+
+ # Dumpable object inside specific schema
+ 'INSERT INTO public.regress_table_dumpable VALUES (1);' => {
+ create_sql => 'INSERT INTO public.regress_table_dumpable VALUES (1);',
+ regexp => qr/^
+ \QINSERT INTO public.regress_table_dumpable VALUES (1);\E
+ \n/xm,
+ like => {
+ extension_schema => 1,
+ },
},);
#########################################
diff --git a/src/test/modules/test_pg_dump/test_pg_dump--1.0.sql b/src/test/modules/test_pg_dump/test_pg_dump--1.0.sql
index 3ed007a7b1b..90e461ed357 100644
--- a/src/test/modules/test_pg_dump/test_pg_dump--1.0.sql
+++ b/src/test/modules/test_pg_dump/test_pg_dump--1.0.sql
@@ -13,6 +13,11 @@ CREATE SEQUENCE regress_pg_dump_seq;
CREATE SEQUENCE regress_seq_dumpable;
SELECT pg_catalog.pg_extension_config_dump('regress_seq_dumpable', '');
+CREATE TABLE regress_table_dumpable (
+ col1 int
+);
+SELECT pg_catalog.pg_extension_config_dump('regress_table_dumpable', '');
+
CREATE SCHEMA regress_pg_dump_schema;
GRANT USAGE ON regress_pg_dump_seq TO regress_dump_test_role;