This is an automated email from the ASF dual-hosted git repository.

Smyatkin-Maxim pushed a commit to branch pg-dump-rebase-REL-2
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit 37a0ec9f959157be51a4f8a6a95447e3a56dc1d1
Author: Tom Lane <[email protected]>
AuthorDate: Tue Mar 14 16:09:03 2023 -0400

    Allow pg_dump to include/exclude child tables automatically.
    
    Backport of upstream commit: a563c24c9574b74f4883c004c89275bba03c3c26
    Resolved merge conflicts in:
    * 002_pg_dump.pl due to multiple tests present in upstream that are not yet 
present in gpdb codebase.
    * minor merge conflicts in pg_dump.sgml, unclear their source, likely 
formatting-derived
    
    backported by: Andrew Repp
    
    Original commit message:
    
    This patch adds new pg_dump switches
        --table-and-children=pattern
        --exclude-table-and-children=pattern
        --exclude-table-data-and-children=pattern
    which act the same as the existing --table, --exclude-table, and
    --exclude-table-data switches, except that any partitions or
    inheritance child tables of the table(s) matching the pattern
    are also included or excluded.
    
    Gilles Darold, reviewed by Stéphane Tachoires
    
    Discussion: 
https://postgr.es/m/[email protected]
---
 doc/src/sgml/ref/pg_dump.sgml    |  38 +++
 src/bin/pg_dump/pg_dump.c        |  84 ++++++-
 src/bin/pg_dump/t/002_pg_dump.pl | 508 +++++++++++++++++++++++++++++++++------
 3 files changed, 544 insertions(+), 86 deletions(-)

diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml
index c405fef866b..6a2ad26a17d 100644
--- a/doc/src/sgml/ref/pg_dump.sgml
+++ b/doc/src/sgml/ref/pg_dump.sgml
@@ -772,6 +772,19 @@ PostgreSQL documentation
       </listitem>
      </varlistentry>
 
+     <varlistentry>
+      <term><option>--exclude-table-and-children=<replaceable 
class="parameter">pattern</replaceable></option></term>
+      <listitem>
+       <para>
+        This is the same as
+        the <option>-T</option>/<option>--exclude-table</option> option,
+        except that it also excludes any partitions or inheritance child
+        tables of the table(s) matching the
+        <replaceable class="parameter">pattern</replaceable>.
+       </para>
+      </listitem>
+     </varlistentry>
+
      <varlistentry>
       <term><option>--exclude-table-data=<replaceable 
class="parameter">pattern</replaceable></option></term>
       <listitem>
@@ -790,6 +803,18 @@ PostgreSQL documentation
       </listitem>
      </varlistentry>
 
+     <varlistentry>
+      <term><option>--exclude-table-data-and-children=<replaceable 
class="parameter">pattern</replaceable></option></term>
+      <listitem>
+       <para>
+        This is the same as the <option>--exclude-table-data</option> option,
+        except that it also excludes data of any partitions or inheritance
+        child tables of the table(s) matching the
+        <replaceable class="parameter">pattern</replaceable>.
+       </para>
+      </listitem>
+     </varlistentry>
+
      <varlistentry>
       <term><option>--extra-float-digits=<replaceable 
class="parameter">ndigits</replaceable></option></term>
       <listitem>
@@ -1169,6 +1194,19 @@ PostgreSQL documentation
       </listitem>
      </varlistentry>
 
+     <varlistentry>
+      <term><option>--table-and-children=<replaceable 
class="parameter">pattern</replaceable></option></term>
+      <listitem>
+       <para>
+        This is the same as
+        the <option>-t</option>/<option>--table</option> option,
+        except that it also includes any partitions or inheritance child
+        tables of the table(s) matching the
+        <replaceable class="parameter">pattern</replaceable>.
+       </para>
+      </listitem>
+     </varlistentry>
+
      <varlistentry>
       <term><option>--use-set-session-authorization</option></term>
       <listitem>
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 3e9bfa834b5..1317dccfe91 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -125,10 +125,13 @@ static SimpleStringList schema_exclude_patterns = {NULL, 
NULL};
 static SimpleOidList schema_exclude_oids = {NULL, NULL};
 
 static SimpleStringList table_include_patterns = {NULL, NULL};
+static SimpleStringList table_include_patterns_and_children = {NULL, NULL};
 static SimpleOidList table_include_oids = {NULL, NULL};
 static SimpleStringList table_exclude_patterns = {NULL, NULL};
+static SimpleStringList table_exclude_patterns_and_children = {NULL, NULL};
 static SimpleOidList table_exclude_oids = {NULL, NULL};
 static SimpleStringList tabledata_exclude_patterns = {NULL, NULL};
+static SimpleStringList tabledata_exclude_patterns_and_children = {NULL, NULL};
 static SimpleOidList tabledata_exclude_oids = {NULL, NULL};
 
 static SimpleStringList relid_string_list = {NULL, NULL};
@@ -205,7 +208,8 @@ static void expand_foreign_server_name_patterns(Archive 
*fout,
 static void expand_table_name_patterns(Archive *fout,
                                                                           
SimpleStringList *patterns,
                                                                           
SimpleOidList *oids,
-                                                                          bool 
strict_names);
+                                                                          bool 
strict_names,
+                                                                          bool 
with_child_tables);
 static void prohibit_crossdb_refs(PGconn *conn, const char *dbname,
                                                                  const char 
*pattern);
 
@@ -498,6 +502,9 @@ main(int argc, char **argv)
                {"rows-per-insert", required_argument, NULL, 10},
                {"include-foreign-data", required_argument, NULL, 11},
                {"restrict-key", required_argument, NULL, 25},
+               {"table-and-children", required_argument, NULL, 12},
+               {"exclude-table-and-children", required_argument, NULL, 13},
+               {"exclude-table-data-and-children", required_argument, NULL, 
14},
 
                /* START MPP ADDITION */
 
@@ -758,6 +765,21 @@ main(int argc, char **argv)
                                
simple_string_list_append(&foreign_servers_include_patterns,
                                                                                
  optarg);
                                break;
+                       case 12:                        /* include table(s) and 
their children */
+                               
simple_string_list_append(&table_include_patterns_and_children,
+                                                                               
  optarg);
+                               dopt.include_everything = false;
+                               break;
+
+                       case 13:                        /* exclude table(s) and 
their children */
+                               
simple_string_list_append(&table_exclude_patterns_and_children,
+                                                                               
  optarg);
+                               break;
+
+                       case 14:                        /* exclude data of 
table(s) and children */
+                               
simple_string_list_append(&tabledata_exclude_patterns_and_children,
+                                                                               
  optarg);
+                               break;
 
                        case 25:
                                dopt.restrict_key = pg_strdup(optarg);
@@ -985,21 +1007,30 @@ main(int argc, char **argv)
        /* non-matching exclusion patterns aren't an error */
 
        /* Expand table selection patterns into OID lists */
-       if (table_include_patterns.head != NULL)
-       {
-               expand_table_name_patterns(fout, &table_include_patterns,
-                                                                  
&table_include_oids,
-                                                                  
strict_names);
-               if (table_include_oids.head == NULL)
-                       fatal("no matching tables were found");
-       }
+       expand_table_name_patterns(fout, &table_include_patterns,
+                                                          &table_include_oids,
+                                                          strict_names, false);
+       expand_table_name_patterns(fout, &table_include_patterns_and_children,
+                                                          &table_include_oids,
+                                                          strict_names, true);
+       if ((table_include_patterns.head != NULL ||
+                table_include_patterns_and_children.head != NULL) &&
+               table_include_oids.head == NULL)
+               fatal("no matching tables were found");
+
        expand_table_name_patterns(fout, &table_exclude_patterns,
                                                           &table_exclude_oids,
-                                                          false);
+                                                          false, false);
+       expand_table_name_patterns(fout, &table_exclude_patterns_and_children,
+                                                          &table_exclude_oids,
+                                                          false, true);
 
        expand_table_name_patterns(fout, &tabledata_exclude_patterns,
                                                           
&tabledata_exclude_oids,
-                                                          false);
+                                                          false, false);
+       expand_table_name_patterns(fout, 
&tabledata_exclude_patterns_and_children,
+                                                          
&tabledata_exclude_oids,
+                                                          false, true);
 
        expand_foreign_server_name_patterns(fout, 
&foreign_servers_include_patterns,
                                                                                
&foreign_servers_include_oids);
@@ -1244,7 +1275,7 @@ help(const char *progname)
                         "                               plain-text format\n"));
        printf(_("  -s, --schema-only            dump only the schema, no 
data\n"));
        printf(_("  -S, --superuser=NAME         superuser user name to use in 
plain-text format\n"));
-       printf(_("  -t, --table=PATTERN          dump the specified table(s) 
only\n"));
+       printf(_("  -t, --table=PATTERN          dump only the specified 
table(s)\n"));
        printf(_("  -T, --exclude-table=PATTERN  do NOT dump the specified 
table(s)\n"));
        printf(_("  -x, --no-privileges          do not dump privileges 
(grant/revoke)\n"));
        printf(_("  --binary-upgrade             for use by upgrade utilities 
only\n"));
@@ -1253,7 +1284,13 @@ help(const char *progname)
        printf(_("  --disable-triggers           disable triggers during 
data-only restore\n"));
        printf(_("  --enable-row-security        enable row security (dump only 
content user has\n"
                         "                               access to)\n"));
+       printf(_("  --exclude-table-and-children=PATTERN\n"
+                        "                               do NOT dump the 
specified table(s),\n"
+                        "                               including child and 
partition tables\n"));
        printf(_("  --exclude-table-data=PATTERN do NOT dump data for the 
specified table(s)\n"));
+       printf(_("  --exclude-table-data-and-children=PATTERN\n"
+                        "                               do NOT dump data for 
the specified table(s),\n"
+                        "                               including child and 
partition tables\n"));
        printf(_("  --extra-float-digits=NUM     override default setting for 
extra_float_digits\n"));
        printf(_("  --if-exists                  use IF EXISTS when dropping 
objects\n"));
        printf(_("  --include-foreign-data=PATTERN\n"
@@ -1278,6 +1315,8 @@ help(const char *progname)
        printf(_("  --snapshot=SNAPSHOT          use given snapshot for the 
dump\n"));
        printf(_("  --strict-names               require table and/or schema 
include patterns to\n"
                         "                               match at least one 
entity each\n"));
+       printf(_("  --table-and-children=PATTERN dump only the specified 
table(s),\n"
+                        "                               including child and 
partition tables\n"));
        printf(_("  --use-set-session-authorization\n"
                         "                               use SET SESSION 
AUTHORIZATION commands instead of\n"
                         "                               ALTER OWNER commands 
to set ownership\n"));
@@ -1729,7 +1768,7 @@ expand_foreign_server_name_patterns(Archive *fout,
 static void
 expand_table_name_patterns(Archive *fout,
                                                   SimpleStringList *patterns, 
SimpleOidList *oids,
-                                                  bool strict_names)
+                                                  bool strict_names, bool 
with_child_tables)
 {
        PQExpBuffer query;
        PGresult   *res;
@@ -1755,7 +1794,15 @@ expand_table_name_patterns(Archive *fout,
                 * Query must remain ABSOLUTELY devoid of unqualified names.  
This
                 * would be unnecessary given a pg_table_is_visible() variant 
taking a
                 * search_path argument.
+                *
+                * For with_child_tables, we start with the basic query's 
results and
+                * recursively search the inheritance tree to add child tables.
                 */
+               if (with_child_tables)
+               {
+                       appendPQExpBuffer(query, "WITH RECURSIVE partition_tree 
(relid) AS (\n");
+               }
+
                appendPQExpBuffer(query,
                                                  "SELECT c.oid"
                                                  "\nFROM pg_catalog.pg_class c"
@@ -1778,6 +1825,17 @@ expand_table_name_patterns(Archive *fout,
                        prohibit_crossdb_refs(GetConnection(fout), dbbuf.data, 
cell->val);
                termPQExpBuffer(&dbbuf);
 
+               if (with_child_tables)
+               {
+                       appendPQExpBuffer(query, "UNION"
+                                                         "\nSELECT i.inhrelid"
+                                                         "\nFROM 
partition_tree p"
+                                                         "\n     JOIN 
pg_catalog.pg_inherits i"
+                                                         "\n     ON p.relid 
OPERATOR(pg_catalog.=) i.inhparent"
+                                                         "\n)"
+                                                         "\nSELECT relid FROM 
partition_tree");
+               }
+
                ExecuteSqlStatement(fout, "RESET search_path");
                res = ExecuteSqlQuery(fout, query->data, PGRES_TUPLES_OK);
                PQclear(ExecuteSqlQueryForSingleRow(fout,
diff --git a/src/bin/pg_dump/t/002_pg_dump.pl b/src/bin/pg_dump/t/002_pg_dump.pl
index 1a6ab11a3ed..5ec7e3f2b20 100644
--- a/src/bin/pg_dump/t/002_pg_dump.pl
+++ b/src/bin/pg_dump/t/002_pg_dump.pl
@@ -198,6 +198,24 @@ my %pgdump_runs = (
                        '--exclude-table=dump_test.test_table', 'postgres',
                ],
        },
+       exclude_measurement => {
+               dump_cmd => [
+                       'pg_dump', '--no-sync',
+                       "--file=$tempdir/exclude_measurement.sql",
+                       '--exclude-table-and-children=dump_test.measurement',
+                       'postgres',
+               ],
+       },
+       exclude_measurement_data => {
+               dump_cmd => [
+                       'pg_dump',
+                       '--no-sync',
+                       "--file=$tempdir/exclude_measurement_data.sql",
+                       
'--exclude-table-data-and-children=dump_test.measurement',
+                       '--no-unlogged-table-data',
+                       'postgres',
+               ],
+       },
        exclude_test_table_data => {
                dump_cmd => [
                        'pg_dump',
@@ -285,6 +303,17 @@ my %pgdump_runs = (
                        'postgres',
                ],
        },
+       only_dump_measurement => {
+               dump_cmd => [
+                       'pg_dump',
+                       '--no-sync',
+                       "--file=$tempdir/only_dump_measurement.sql",
+                       '--table-and-children=dump_test.measurement',
+                       '--lock-wait-timeout='
+                         . (1000 * $TestLib::timeout_default),
+                       'postgres',
+               ],
+       },
        role => {
                dump_cmd => [
                        'pg_dump',
@@ -402,7 +431,8 @@ my %pgdump_runs = (
 # Tests which target the 'dump_test' schema, specifically.
 my %dump_test_schema_runs = (
        only_dump_test_schema  => 1,
-       test_schema_plus_blobs => 1,);
+       test_schema_plus_blobs => 1,
+       only_dump_measurement  => 1);
 
 # Tests which are considered 'full' dumps by pg_dump, but there
 # are flags used to exclude specific items (ACLs, blobs, etc).
@@ -417,6 +447,8 @@ my %full_runs = (
        exclude_test_table_data  => 1,
        no_toast_compression     => 1,
        no_blobs                 => 1,
+       exclude_measurement      => 1,
+       exclude_measurement_data => 1,
        no_owner                 => 1,
        no_privs                 => 1,
        pg_dumpall_dbprivs       => 1,
@@ -450,6 +482,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        no_privs                 => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -469,6 +502,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        no_privs                 => 1,
+                       only_dump_measurement    => 1,
                },
          },
 
@@ -547,6 +581,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        no_owner                 => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -560,6 +595,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        no_owner                 => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -592,7 +628,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'ALTER OPERATOR CLASS dump_test.op_class OWNER TO' => {
@@ -605,6 +644,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        no_owner                 => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -645,6 +685,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        no_owner                 => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -671,6 +712,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        exclude_test_table       => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -688,6 +730,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        exclude_test_table       => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -707,6 +750,7 @@ my %tests = (
                },
                unlike => {
                        exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -726,6 +770,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        exclude_test_table       => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -745,6 +790,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        exclude_test_table       => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -764,6 +810,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        exclude_test_table       => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -783,6 +830,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        exclude_test_table       => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -797,6 +845,10 @@ my %tests = (
                        role             => 1,
                        section_pre_data => 1,
                        binary_upgrade   => 1,
+                       only_dump_measurement => 1,
+               },
+               unlike => {
+                       exclude_measurement => 1,
                },
          },
 
@@ -816,6 +868,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        exclude_test_table       => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -837,7 +890,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'ALTER TABLE test_table OWNER TO' => {
@@ -851,6 +907,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        exclude_test_table       => 1,
+                       only_dump_measurement    => 1,
                        no_owner                 => 1,
                },
        },
@@ -870,6 +927,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        exclude_test_table       => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -881,16 +939,22 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        no_owner                 => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
        'ALTER TABLE measurement OWNER TO' => {
                regexp => qr/^\QALTER TABLE dump_test.measurement OWNER TO 
\E.+;/m,
-               like =>
-                 { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
+               like => {
+                       %full_runs,
+                       %dump_test_schema_runs,
+                       section_pre_data => 1,
+                       only_dump_measurement => 1,
+               },
                unlike => {
                        exclude_dump_test_schema => 1,
                        no_owner                 => 1,
+                       exclude_measurement      => 1,
                },
        },
 
@@ -901,8 +965,12 @@ my %tests = (
                        %full_runs,
                        role             => 1,
                        section_pre_data => 1,
+                       only_dump_measurement => 1,
+               },
+               unlike => {
+                       no_owner => 1,
+                       exclude_measurement => 1,
                },
-               unlike => { no_owner => 1, },
        },
 
        'ALTER FOREIGN TABLE foreign_table OWNER TO' => {
@@ -913,6 +981,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        no_owner                 => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -924,6 +993,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        no_owner                 => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -937,6 +1007,7 @@ my %tests = (
                        only_dump_test_table     => 1,
                        no_owner                 => 1,
                        role                     => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -1010,6 +1081,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        exclude_test_table       => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -1029,6 +1101,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        exclude_test_table       => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -1041,7 +1114,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'COMMENT ON COLUMN dump_test.test_second_table.col1' => {
@@ -1053,7 +1129,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'COMMENT ON COLUMN dump_test.test_second_table.col2' => {
@@ -1065,7 +1144,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'COMMENT ON CONVERSION dump_test.test_conversion' => {
@@ -1076,7 +1158,10 @@ my %tests = (
                  qr/^\QCOMMENT ON CONVERSION dump_test.test_conversion IS 
'comment on test conversion';\E/m,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'COMMENT ON COLLATION test0' => {
@@ -1143,7 +1228,10 @@ my %tests = (
                  qr/^\QCOMMENT ON TEXT SEARCH CONFIGURATION 
dump_test.alt_ts_conf1 IS 'comment on text search configuration';\E/m,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'COMMENT ON TEXT SEARCH DICTIONARY dump_test.alt_ts_dict1' => {
@@ -1155,7 +1243,10 @@ my %tests = (
                  qr/^\QCOMMENT ON TEXT SEARCH DICTIONARY 
dump_test.alt_ts_dict1 IS 'comment on text search dictionary';\E/m,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'COMMENT ON TEXT SEARCH PARSER dump_test.alt_ts_prs1' => {
@@ -1166,7 +1257,10 @@ my %tests = (
                  qr/^\QCOMMENT ON TEXT SEARCH PARSER dump_test.alt_ts_prs1 IS 
'comment on text search parser';\E/m,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'COMMENT ON TEXT SEARCH TEMPLATE dump_test.alt_ts_temp1' => {
@@ -1177,7 +1271,10 @@ my %tests = (
                  qr/^\QCOMMENT ON TEXT SEARCH TEMPLATE dump_test.alt_ts_temp1 
IS 'comment on text search template';\E/m,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'COMMENT ON TYPE dump_test.planets - ENUM' => {
@@ -1188,7 +1285,10 @@ my %tests = (
                  qr/^\QCOMMENT ON TYPE dump_test.planets IS 'comment on enum 
type';\E/m,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'COMMENT ON TYPE dump_test.textrange - RANGE' => {
@@ -1199,7 +1299,10 @@ my %tests = (
                  qr/^\QCOMMENT ON TYPE dump_test.textrange IS 'comment on 
range type';\E/m,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'COMMENT ON TYPE dump_test.int42 - Regular' => {
@@ -1210,7 +1313,10 @@ my %tests = (
                  qr/^\QCOMMENT ON TYPE dump_test.int42 IS 'comment on regular 
type';\E/m,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'COMMENT ON TYPE dump_test.undefined - Undefined' => {
@@ -1221,7 +1327,10 @@ my %tests = (
                  qr/^\QCOMMENT ON TYPE dump_test.undefined IS 'comment on 
undefined type';\E/m,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'COPY test_table' => {
@@ -1245,6 +1354,7 @@ my %tests = (
                        exclude_test_table       => 1,
                        exclude_test_table_data  => 1,
                        schema_only              => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -1268,6 +1378,7 @@ my %tests = (
                        binary_upgrade           => 1,
                        exclude_dump_test_schema => 1,
                        schema_only              => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -1303,6 +1414,7 @@ my %tests = (
                        binary_upgrade           => 1,
                        exclude_dump_test_schema => 1,
                        schema_only              => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -1324,6 +1436,7 @@ my %tests = (
                        binary_upgrade           => 1,
                        exclude_dump_test_schema => 1,
                        schema_only              => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -1346,6 +1459,7 @@ my %tests = (
                        binary_upgrade           => 1,
                        exclude_dump_test_schema => 1,
                        schema_only              => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -1367,6 +1481,7 @@ my %tests = (
                        binary_upgrade           => 1,
                        exclude_dump_test_schema => 1,
                        schema_only              => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -1388,6 +1503,7 @@ my %tests = (
                        binary_upgrade           => 1,
                        exclude_dump_test_schema => 1,
                        schema_only              => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -1567,7 +1683,10 @@ my %tests = (
                        exclude_test_table => 1,
                        section_pre_data   => 1,
                },
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE CONVERSION dump_test.test_conversion' => {
@@ -1578,7 +1697,10 @@ my %tests = (
                  qr/^\QCREATE DEFAULT CONVERSION dump_test.test_conversion FOR 
'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;\E/xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE DOMAIN dump_test.us_postal_code' => {
@@ -1597,7 +1719,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE FUNCTION dump_test.pltestlang_call_handler' => {
@@ -1614,7 +1739,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE FUNCTION dump_test.trigger_func' => {
@@ -1630,7 +1758,10 @@ my %tests = (
                        \$\$;/xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE FUNCTION dump_test.event_trigger_func' => {
@@ -1646,7 +1777,10 @@ my %tests = (
                        \$\$;/xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE OPERATOR FAMILY dump_test.op_family' => {
@@ -1658,7 +1792,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE OPERATOR CLASS dump_test.op_class' => {
@@ -1688,7 +1825,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        # verify that a custom operator/opclass/range type is dumped in right 
order
@@ -1718,7 +1858,10 @@ my %tests = (
                        /xms,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement => 1,
+               },
        },
 
        'CREATE OPERATOR CLASS dump_test.op_class_empty' => {
@@ -1733,7 +1876,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE EVENT TRIGGER test_event_trigger' => {
@@ -1769,6 +1915,7 @@ my %tests = (
                unlike => {
                        exclude_test_table       => 1,
                        exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -1787,6 +1934,7 @@ my %tests = (
                unlike => {
                        binary_upgrade           => 1,
                        exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -1815,7 +1963,10 @@ my %tests = (
                        \n\);/xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE TYPE dump_test.int42' => {
@@ -1824,7 +1975,10 @@ my %tests = (
                regexp       => qr/^\QCREATE TYPE dump_test.int42;\E/m,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE TEXT SEARCH CONFIGURATION dump_test.alt_ts_conf1' => {
@@ -1836,7 +1990,10 @@ my %tests = (
                        \s+\QPARSER = pg_catalog."default" );\E/xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'ALTER TEXT SEARCH CONFIGURATION dump_test.alt_ts_conf1 ...' => {
@@ -1901,7 +2058,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE TEXT SEARCH TEMPLATE dump_test.alt_ts_temp1' => {
@@ -1913,7 +2073,10 @@ my %tests = (
                        \s+\QLEXIZE = dsimple_lexize );\E/xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE TEXT SEARCH PARSER dump_test.alt_ts_prs1' => {
@@ -1929,7 +2092,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE TEXT SEARCH DICTIONARY dump_test.alt_ts_dict1' => {
@@ -1942,7 +2108,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE FUNCTION dump_test.int42_in' => {
@@ -1957,7 +2126,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE FUNCTION dump_test.int42_out' => {
@@ -1972,7 +2144,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE FUNCTION ... SUPPORT' => {
@@ -1986,7 +2161,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE PROCEDURE dump_test.ptest1' => {
@@ -2000,7 +2178,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE TYPE dump_test.int42 populated' => {
@@ -2024,7 +2205,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE TYPE dump_test.composite' => {
@@ -2041,7 +2225,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE TYPE dump_test.undefined' => {
@@ -2050,7 +2237,10 @@ my %tests = (
                regexp       => qr/^\QCREATE TYPE dump_test.undefined;\E/m,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'ALTER TYPE dump_test.int42 SET DEFAULT ENCODING' => {
@@ -2060,7 +2250,10 @@ my %tests = (
                regexp => qr/^\QALTER TYPE dump_test.int42 SET DEFAULT ENCODING 
(compresstype=rle_type, blocksize=8192, compresslevel=4);\E/m,
                like =>
                        { %full_runs, %dump_test_schema_runs, section_pre_data 
=> 1, },
-               unlike => { exclude_dump_test_schema => 1, },
+           unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+           },
        },
 
        'CREATE FOREIGN DATA WRAPPER dummy' => {
@@ -2093,7 +2286,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE USER MAPPING FOR regress_dump_test_role SERVER s1' => {
@@ -2138,7 +2334,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE MATERIALIZED VIEW matview_second' => {
@@ -2154,7 +2353,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE MATERIALIZED VIEW matview_third' => {
@@ -2170,7 +2372,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE MATERIALIZED VIEW matview_fourth' => {
@@ -2186,7 +2391,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE MATERIALIZED VIEW matview_compression' => {
@@ -2282,6 +2490,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        exclude_test_table       => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -2302,6 +2511,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        exclude_test_table       => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -2322,6 +2532,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        exclude_test_table       => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -2342,6 +2553,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        exclude_test_table       => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -2362,6 +2574,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        exclude_test_table       => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -2382,6 +2595,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        exclude_test_table       => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -2457,7 +2671,10 @@ my %tests = (
                regexp       => qr/^CREATE SCHEMA dump_test;/m,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE SCHEMA dump_test_second_schema' => {
@@ -2498,6 +2715,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        exclude_test_table       => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -2513,7 +2731,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE TABLE test_second_table' => {
@@ -2530,7 +2751,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE TABLE test_compression' => {
@@ -2574,11 +2798,16 @@ my %tests = (
                        \)\n
                        \QPARTITION BY RANGE (logdate);\E\n
                        /xm,
-               like =>
-                 { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
+               like => {
+                       %full_runs,
+                       %dump_test_schema_runs,
+                       section_pre_data => 1,
+                       only_dump_measurement => 1,
+               },
                unlike => {
                        binary_upgrade           => 1,
                        exclude_dump_test_schema => 1,
+                       exclude_measurement => 1,
                },
        },
 
@@ -2605,6 +2834,10 @@ my %tests = (
                        section_pre_data => 1,
                        role             => 1,
                        binary_upgrade   => 1,
+                       only_dump_measurement => 1,
+               },
+               unlike => {
+                       exclude_measurement => 1,
                },
        },
 
@@ -2620,9 +2853,40 @@ my %tests = (
                        /xm,
                like => {
                        %full_runs, %dump_test_schema_runs, section_post_data 
=> 1,
+                       only_dump_measurement => 1,
                },
                unlike => {
                        exclude_dump_test_schema => 1,
+                       exclude_measurement => 1,
+               },
+       },
+
+       'COPY measurement' => {
+               create_order => 93,
+               create_sql   => 'INSERT INTO dump_test.measurement (city_id, 
logdate, peaktemp, unitsales) '
+                 . "VALUES (1, '2006-02-12', 35, 1);",
+               regexp => qr/^
+                       \QCOPY dump_test_second_schema.measurement_y2006m2 
(city_id, logdate, peaktemp, unitsales) FROM stdin;\E
+                       \n(?:1\t2006-02-12\t35\t1\n)\\\.\n
+                       /xm,
+               like => {
+                       %full_runs,
+                       %dump_test_schema_runs,
+                       data_only            => 1,
+                       only_dump_measurement => 1,
+                       section_data         => 1,
+                       only_dump_test_schema => 1,
+                       role_parallel => 1,
+                       role => 1,
+               },
+               unlike => {
+                       binary_upgrade           => 1,
+                       schema_only              => 1,
+                       exclude_measurement      => 1,
+                       only_dump_test_schema    => 1,
+                       test_schema_plus_blobs   => 1,
+                       exclude_measurement      => 1,
+                       exclude_measurement_data => 1,
                },
        },
 
@@ -2650,6 +2914,10 @@ my %tests = (
                        section_post_data => 1,
                        role              => 1,
                        binary_upgrade    => 1,
+                       only_dump_measurement => 1,
+               },
+               unlike => {
+                       exclude_measurement => 1,
                },
        },
 
@@ -2662,6 +2930,10 @@ my %tests = (
                        section_post_data => 1,
                        role              => 1,
                        binary_upgrade    => 1,
+                       only_dump_measurement => 1,
+               },
+               unlike => {
+                       exclude_measurement => 1,
                },
        },
 
@@ -2674,6 +2946,10 @@ my %tests = (
                        section_post_data => 1,
                        role              => 1,
                        binary_upgrade    => 1,
+                       only_dump_measurement => 1,
+               },
+               unlike => {
+                       exclude_measurement => 1,
                },
        },
 
@@ -2709,7 +2985,11 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { binary_upgrade => 1, exclude_dump_test_schema => 1, 
},
+               unlike => {
+                       binary_upgrade => 1,
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement => 1,
+               },
        },
 
        'CREATE TABLE test_fourth_table_zero_col' => {
@@ -2722,7 +3002,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE TABLE test_fifth_table' => {
@@ -2745,7 +3028,10 @@ my %tests = (
                        /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE TABLE test_table_identity' => {
@@ -2771,7 +3057,10 @@ my %tests = (
                        /xms,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE TABLE test_table_generated' => {
@@ -2788,7 +3077,10 @@ my %tests = (
                        /xms,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE TABLE test_table_generated_child1 (without local columns)' => {
@@ -2805,6 +3097,7 @@ my %tests = (
                unlike => {
                        binary_upgrade           => 1,
                        exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -2834,6 +3127,7 @@ my %tests = (
                unlike => {
                        binary_upgrade           => 1,
                        exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -2856,7 +3150,10 @@ my %tests = (
                        /xms,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_post_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE TABLE test_inheritance_parent' => {
@@ -2874,7 +3171,10 @@ my %tests = (
                /xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE TABLE test_inheritance_child' => {
@@ -2896,6 +3196,7 @@ my %tests = (
                unlike => {
                        binary_upgrade           => 1,
                        exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -2908,7 +3209,10 @@ my %tests = (
                    /xms,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_post_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE STATISTICS extended_stats_options' => {
@@ -2920,7 +3224,10 @@ my %tests = (
                    /xms,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_post_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'ALTER STATISTICS extended_stats_options' => {
@@ -2963,7 +3270,10 @@ my %tests = (
                        only_dump_test_table => 1,
                        section_pre_data     => 1,
                },
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE INDEX ON ONLY measurement' => {
@@ -2991,6 +3301,8 @@ my %tests = (
                        schema_only             => 1,
                        section_post_data       => 1,
                        test_schema_plus_blobs  => 1,
+                       only_dump_measurement   => 1,
+                       exclude_measurement_data => 1,
                },
                unlike => {
                        exclude_dump_test_schema => 1,
@@ -2999,6 +3311,7 @@ my %tests = (
                        pg_dumpall_globals_clean => 1,
                        role                     => 1,
                        section_pre_data         => 1,
+                       exclude_measurement      => 1,
                },
        },
 
@@ -3011,9 +3324,16 @@ my %tests = (
                        \QALTER TABLE ONLY dump_test.measurement\E \n^\s+
                        \QADD CONSTRAINT measurement_pkey PRIMARY KEY (city_id, 
logdate);\E
                /xm,
-               like =>
-                 { %full_runs, %dump_test_schema_runs, section_post_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               like => {
+                       %full_runs,
+                       %dump_test_schema_runs,
+                       section_post_data => 1,
+                       only_dump_measurement => 1,
+               },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       exclude_measurement      => 1,
+               },
        },
 
        'CREATE INDEX ... ON measurement_y2006_m2' => {
@@ -3024,6 +3344,10 @@ my %tests = (
                        %full_runs,
                        role              => 1,
                        section_post_data => 1,
+                       only_dump_measurement => 1,
+               },
+               unlike => {
+                       exclude_measurement      => 1,
                },
        },
 
@@ -3035,6 +3359,11 @@ my %tests = (
                        %full_runs,
                        role              => 1,
                        section_post_data => 1,
+                       only_dump_measurement => 1,
+                       exclude_measurement_data => 1,
+               },
+               unlike => {
+                       exclude_measurement      => 1,
                },
        },
 
@@ -3061,6 +3390,8 @@ my %tests = (
                        role                     => 1,
                        schema_only              => 1,
                        section_post_data        => 1,
+                       only_dump_measurement    => 1,
+                       exclude_measurement_data => 1,
                },
                unlike => {
                        only_dump_test_schema    => 1,
@@ -3069,6 +3400,7 @@ my %tests = (
                        pg_dumpall_globals_clean => 1,
                        section_pre_data         => 1,
                        test_schema_plus_blobs   => 1,
+                       exclude_measurement      => 1,
                },
        },
 
@@ -3084,7 +3416,10 @@ my %tests = (
                        \n\s+\QWITH LOCAL CHECK OPTION;\E/xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'ALTER VIEW test_view SET DEFAULT' => {
@@ -3095,7 +3430,10 @@ my %tests = (
                        \QALTER TABLE dump_test.test_view ALTER COLUMN col1 SET 
DEFAULT 1;\E/xm,
                like =>
                  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
-               unlike => { exclude_dump_test_schema => 1, },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        # FIXME
@@ -3270,6 +3608,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        no_privs                 => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -3285,6 +3624,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        no_privs                 => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -3300,6 +3640,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        no_privs                 => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -3315,6 +3656,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        no_privs                 => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -3344,6 +3686,7 @@ my %tests = (
                        exclude_dump_test_schema => 1,
                        exclude_test_table       => 1,
                        no_privs                 => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -3354,11 +3697,16 @@ my %tests = (
                                                   TO regress_dump_test_role;',
                regexp =>
                  qr/^\QGRANT SELECT ON TABLE dump_test.measurement TO 
regress_dump_test_role;\E/m,
-               like =>
-                 { %full_runs, %dump_test_schema_runs, section_pre_data => 1, 
},
+               like => {
+                       %full_runs,
+                       %dump_test_schema_runs,
+                       section_pre_data => 1,
+                       only_dump_measurement => 1,
+               },
                unlike => {
                        exclude_dump_test_schema => 1,
                        no_privs                 => 1,
+                       exclude_measurement      => 1,
                },
        },
 
@@ -3376,8 +3724,12 @@ my %tests = (
                        %full_runs,
                        role             => 1,
                        section_pre_data => 1,
+                       only_dump_measurement => 1,
+               },
+               unlike => {
+                       no_privs => 1,
+                       exclude_measurement      => 1,
                },
-               unlike => { no_privs => 1, },
        },
 
 # Disabled, because GPDB doesn't support large objects
@@ -3421,6 +3773,7 @@ my %tests = (
                unlike => {
                        exclude_dump_test_schema => 1,
                        no_privs                 => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -3522,6 +3875,7 @@ my %tests = (
                        binary_upgrade           => 1,
                        exclude_dump_test_schema => 1,
                        schema_only              => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -3537,6 +3891,7 @@ my %tests = (
                        binary_upgrade           => 1,
                        exclude_dump_test_schema => 1,
                        schema_only              => 1,
+                       only_dump_measurement    => 1,
                },
        },
 
@@ -3608,6 +3963,7 @@ my %tests = (
                        only_dump_test_table => 1,
                        role                 => 1,
                        section_pre_data     => 1,
+                       only_dump_measurement => 1,
                },
                unlike => { no_privs => 1, },
        },
@@ -3646,7 +4002,10 @@ my %tests = (
                like => {
                        %full_runs, %dump_test_schema_runs, section_pre_data => 
1,
                },
-               unlike => { exclude_dump_test_schema => 1 },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        },
 
        'CREATE MATERIALIZED VIEW regress_pg_dump_matview_am' => {
@@ -3666,7 +4025,10 @@ my %tests = (
                like => {
                        %full_runs, %dump_test_schema_runs, section_pre_data => 
1,
                },
-               unlike => { exclude_dump_test_schema => 1 },
+               unlike => {
+                       exclude_dump_test_schema => 1,
+                       only_dump_measurement    => 1,
+               },
        });
 
 #########################################


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to