[ 'vacuumdb', '--analyze-only', 'postgres' ],
qr/statement: ANALYZE public.parent_table/s,
'--analyze-only updates statistics for partitioned tables');
+$node->issues_sql_like(
+ [ 'vacuumdb', '--analyze-in-stages', 'postgres' ],
+ qr/statement: ANALYZE public.parent_table/s,
+ '--analyze-in-stages updates statistics for partitioned tables');
$node->issues_sql_unlike(
[ 'vacuumdb', '--analyze-only', 'postgres' ],
qr/statement:\ VACUUM/sx,
{
/*
* vacuumdb should generally follow the behavior of the underlying
- * VACUUM and ANALYZE commands. In MODE_ANALYZE mode, process regular
- * tables, materialized views, and partitioned tables, just like
- * ANALYZE (with no specific target tables) does. Otherwise, process
- * only regular tables and materialized views, since VACUUM skips
- * partitioned tables when no target tables are specified.
+ * VACUUM and ANALYZE commands. In MODE_ANALYZE or
+ * MODE_ANALYZE_IN_STAGES modes, process regular tables, materialized
+ * views, and partitioned tables, just like ANALYZE (with no specific
+ * target tables) does. Otherwise, process only regular tables and
+ * materialized views, since VACUUM skips partitioned tables when no
+ * target tables are specified.
*/
- if (vacopts->mode == MODE_ANALYZE)
+ if (vacopts->mode == MODE_ANALYZE ||
+ vacopts->mode == MODE_ANALYZE_IN_STAGES)
appendPQExpBufferStr(&catalog_query,
" AND c.relkind OPERATOR(pg_catalog.=) ANY (array["
CppAsString2(RELKIND_RELATION) ", "