aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2017-05-03 15:52:00 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2017-05-03 15:52:00 -0300
commita93077ef467138235c3f05e3ba36dfcabe3d0898 (patch)
tree231c7c38869a1ff9cbf04d4710521598d57fbefc /src
parent698923d6588ee15a386d26c45e5f25ee1a68cc34 (diff)
downloadpostgresql-a93077ef467138235c3f05e3ba36dfcabe3d0898.tar.gz
postgresql-a93077ef467138235c3f05e3ba36dfcabe3d0898.zip
Add pg_dump tests for CREATE STATISTICS
CREATE STATISTICS pg_dump support code was not covered at all by previous tests. Discussion: https://postgr.es/m/20170503172746.rwftidszir67sgk7@alvherre.pgsql
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_dump/t/002_pg_dump.pl68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/bin/pg_dump/t/002_pg_dump.pl b/src/bin/pg_dump/t/002_pg_dump.pl
index 0d7a49826a1..0259db92b6a 100644
--- a/src/bin/pg_dump/t/002_pg_dump.pl
+++ b/src/bin/pg_dump/t/002_pg_dump.pl
@@ -4920,6 +4920,74 @@ qr/CREATE TRANSFORM FOR integer LANGUAGE sql \(FROM SQL WITH FUNCTION pg_catalog
role => 1,
section_post_data => 1, }, },
+ 'CREATE STATISTICS extended_stats_no_options' => {
+ all_runs => 1,
+ catch_all => 'CREATE ... commands',
+ create_order => 97,
+ create_sql => 'CREATE STATISTICS dump_test.test_ext_stats_no_options
+ ON (col1, col2) FROM dump_test.test_fifth_table',
+ regexp => qr/^
+ \QCREATE STATISTICS dump_test.test_ext_stats_no_options ON (col1, col2) FROM test_fifth_table;\E
+ /xms,
+ like => {
+ binary_upgrade => 1,
+ clean => 1,
+ clean_if_exists => 1,
+ createdb => 1,
+ defaults => 1,
+ exclude_test_table => 1,
+ exclude_test_table_data => 1,
+ no_blobs => 1,
+ no_privs => 1,
+ no_owner => 1,
+ only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
+ schema_only => 1,
+ section_post_data => 1,
+ test_schema_plus_blobs => 1,
+ with_oids => 1, },
+ unlike => {
+ exclude_dump_test_schema => 1,
+ only_dump_test_table => 1,
+ pg_dumpall_globals => 1,
+ pg_dumpall_globals_clean => 1,
+ role => 1,
+ section_pre_data => 1, }, },
+
+ 'CREATE STATISTICS extended_stats_options' => {
+ all_runs => 1,
+ catch_all => 'CREATE ... commands',
+ create_order => 97,
+ create_sql => 'CREATE STATISTICS dump_test.test_ext_stats_using
+ WITH (ndistinct) ON (col1, col2) FROM dump_test.test_fifth_table',
+ regexp => qr/^
+ \QCREATE STATISTICS dump_test.test_ext_stats_using WITH (ndistinct) ON (col1, col2) FROM test_fifth_table;\E
+ /xms,
+ like => {
+ binary_upgrade => 1,
+ clean => 1,
+ clean_if_exists => 1,
+ createdb => 1,
+ defaults => 1,
+ exclude_test_table => 1,
+ exclude_test_table_data => 1,
+ no_blobs => 1,
+ no_privs => 1,
+ no_owner => 1,
+ only_dump_test_schema => 1,
+ pg_dumpall_dbprivs => 1,
+ schema_only => 1,
+ section_post_data => 1,
+ test_schema_plus_blobs => 1,
+ with_oids => 1, },
+ unlike => {
+ exclude_dump_test_schema => 1,
+ only_dump_test_table => 1,
+ pg_dumpall_globals => 1,
+ pg_dumpall_globals_clean => 1,
+ role => 1,
+ section_pre_data => 1, }, },
+
'CREATE SEQUENCE test_table_col1_seq' => {
all_runs => 1,
catch_all => 'CREATE ... commands',