*/
if (strcmp(te->desc, "ACL") == 0 ||
strcmp(te->desc, "COMMENT") == 0 ||
- strcmp(te->desc, "STATISTICS DATA") == 0 ||
strcmp(te->desc, "SECURITY LABEL") == 0)
{
/* Database properties react to createDB, not selectivity options. */
if (ropt->selTypes)
{
- if (strcmp(te->desc, "TABLE") == 0 ||
- strcmp(te->desc, "TABLE DATA") == 0 ||
- strcmp(te->desc, "VIEW") == 0 ||
- strcmp(te->desc, "FOREIGN TABLE") == 0 ||
- strcmp(te->desc, "MATERIALIZED VIEW") == 0 ||
- strcmp(te->desc, "MATERIALIZED VIEW DATA") == 0 ||
- strcmp(te->desc, "SEQUENCE") == 0 ||
- strcmp(te->desc, "SEQUENCE SET") == 0)
+ if (strcmp(te->desc, "STATISTICS DATA") == 0)
+ {
+ bool dumpthis = false;
+
+ /*
+ * Statistics data can be assigned for tables or indexes, so
+ * check both.
+ */
+ if (ropt->selTable &&
+ (ropt->tableNames.head == NULL ||
+ simple_string_list_member(&ropt->tableNames, te->tag)))
+ dumpthis = true;
+ if (ropt->selIndex &&
+ (ropt->indexNames.head == NULL ||
+ simple_string_list_member(&ropt->indexNames, te->tag)))
+ dumpthis = true;
+ if (!dumpthis)
+ return 0;
+ }
+ else if (strcmp(te->desc, "TABLE") == 0 ||
+ strcmp(te->desc, "TABLE DATA") == 0 ||
+ strcmp(te->desc, "VIEW") == 0 ||
+ strcmp(te->desc, "FOREIGN TABLE") == 0 ||
+ strcmp(te->desc, "MATERIALIZED VIEW") == 0 ||
+ strcmp(te->desc, "MATERIALIZED VIEW DATA") == 0 ||
+ strcmp(te->desc, "SEQUENCE") == 0 ||
+ strcmp(te->desc, "SEQUENCE SET") == 0)
{
if (!ropt->selTable)
return 0;
'postgres',
],
},
+ statistics_only_with_schema => {
+ dump_cmd => [
+ 'pg_dump', '--no-sync',
+ '--format' => 'custom',
+ '--file' => "$tempdir/statistics_only_with_schema.dump",
+ '--statistics-only',
+ '--schema' => 'dump_test',
+ 'postgres',
+ ],
+ restore_cmd => [
+ 'pg_restore',
+ '--format' => 'custom',
+ '--file' => "$tempdir/statistics_only_with_schema.sql",
+ '--statistics-only',
+ '--schema' => 'dump_test',
+ "$tempdir/statistics_only_with_schema.dump",
+ ],
+ },
+ statistics_only_with_table => {
+ dump_cmd => [
+ 'pg_dump', '--no-sync',
+ '--format' => 'custom',
+ '--file' => "$tempdir/statistics_only_with_table.dump",
+ '--statistics',
+ 'postgres',
+ ],
+ restore_cmd => [
+ 'pg_restore',
+ '--format' => 'custom',
+ '--file' => "$tempdir/statistics_only_with_table.sql",
+ '--statistics-only',
+ '--table' => 'test_table',
+ '--schema' => 'dump_test',
+ "$tempdir/statistics_only_with_table.dump",
+ ],
+ },
+ statistics_only_with_index => {
+ dump_cmd => [
+ 'pg_dump', '--no-sync',
+ '--format' => 'custom',
+ '--file' => "$tempdir/statistics_only_with_index.dump",
+ '--statistics',
+ 'postgres',
+ ],
+ restore_cmd => [
+ 'pg_restore',
+ '--format' => 'custom',
+ '--file' => "$tempdir/statistics_only_with_index.sql",
+ '--statistics-only',
+ '--index' => '"dump_test"\'s post-data index',
+ '--schema' => 'dump_test',
+ "$tempdir/statistics_only_with_index.dump",
+ ],
+ },
no_schema => {
dump_cmd => [
'pg_dump', '--no-sync',
no_schema => 1,
section_post_data => 1,
statistics_only => 1,
+ statistics_only_with_schema => 1,
+ statistics_only_with_index => 1,
schema_only_with_statistics => 1,
},
unlike => {
no_schema => 1,
section_post_data => 1,
statistics_only => 1,
+ statistics_only_with_schema => 1,
schema_only_with_statistics => 1,
},
unlike => {
section_data => 1,
section_post_data => 1,
statistics_only => 1,
+ statistics_only_with_schema => 1,
+ statistics_only_with_index => 1,
+ statistics_only_with_table => 1,
schema_only_with_statistics => 1,
},
unlike => {