Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions bin/pg_repack.c
Original file line number Diff line number Diff line change
Expand Up @@ -874,8 +874,13 @@ repack_one_database(const char *orderby, char *errbuf, size_t errsize)
appendStringInfoString(&sql, ")");
}

/* Ensure the regression tests get a consistent ordering of tables */
appendStringInfoString(&sql, " ORDER BY t.relname, t.schemaname");
/* Ensure the regression tests get a consistent ordering of tables
* Otherwise repack small objects first to free space on disk
*/
if (getenv("MAKELEVEL"))
appendStringInfoString(&sql, " ORDER BY t.relname, t.schemaname");
else
appendStringInfoString(&sql, " ORDER BY pg_relation_size(t.relid)");

/* double check the parameters array is sane */
if (iparam != num_params)
Expand Down