pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: pg_dump: provide a stable sort order for rules. 6+ messages / 2 participants [nested] [flat]
* pgsql: pg_dump: provide a stable sort order for rules. @ 2024-11-04 18:31 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2024-11-04 18:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org pg_dump: provide a stable sort order for rules. Previously, we sorted rules by schema name and then rule name; if that wasn't unique, we sorted by rule OID. This can be problematic for comparing dumps from databases with different histories, especially since certain rule names like "_RETURN" are very common. Let's make the sort key schema name, rule name, table name, which should be unique. (This is the same behavior we've long used for triggers and RLS policies.) Andreas Karlsson Discussion: https://postgr.es/m/b4e468d8-0cd6-42e6-ac8a-1d6afa6e0cf1@proxel.se Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/350e6b8ea86c22c0b95c2e32a4e8d109255b5596 Modified Files -------------- src/bin/pg_dump/pg_dump_sort.c | 11 +++++++++++ 1 file changed, 11 insertions(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: pg_dump: provide a stable sort order for rules. @ 2025-07-31 13:43 Noah Misch <noah@leadboat.com> 0 siblings, 0 replies; 6+ messages in thread From: Noah Misch @ 2025-07-31 13:43 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org pg_dump: provide a stable sort order for rules. Previously, we sorted rules by schema name and then rule name; if that wasn't unique, we sorted by rule OID. This can be problematic for comparing dumps from databases with different histories, especially since certain rule names like "_RETURN" are very common. Let's make the sort key schema name, rule name, table name, which should be unique. (This is the same behavior we've long used for triggers and RLS policies.) Andreas Karlsson This back-patches v18 commit 350e6b8ea86c22c0b95c2e32a4e8d109255b5596 to all supported branches. The next commit will assert that pg_dump provides a stable sort order for all object types. That assertion would fail without stabilizing DO_RULE order as this commit did. Discussion: https://postgr.es/m/b4e468d8-0cd6-42e6-ac8a-1d6afa6e0cf1@proxel.se Discussion: https://postgr.es/m/20250707192654.9e.nmisch@google.com Backpatch-through: 13-17 Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/5dd4957b28df92d25508e4d0c950099c52347a75 Author: Tom Lane <tgl@sss.pgh.pa.us> Modified Files -------------- src/bin/pg_dump/pg_dump_sort.c | 11 +++++++++++ 1 file changed, 11 insertions(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: pg_dump: provide a stable sort order for rules. @ 2025-07-31 13:43 Noah Misch <noah@leadboat.com> 0 siblings, 0 replies; 6+ messages in thread From: Noah Misch @ 2025-07-31 13:43 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org pg_dump: provide a stable sort order for rules. Previously, we sorted rules by schema name and then rule name; if that wasn't unique, we sorted by rule OID. This can be problematic for comparing dumps from databases with different histories, especially since certain rule names like "_RETURN" are very common. Let's make the sort key schema name, rule name, table name, which should be unique. (This is the same behavior we've long used for triggers and RLS policies.) Andreas Karlsson This back-patches v18 commit 350e6b8ea86c22c0b95c2e32a4e8d109255b5596 to all supported branches. The next commit will assert that pg_dump provides a stable sort order for all object types. That assertion would fail without stabilizing DO_RULE order as this commit did. Discussion: https://postgr.es/m/b4e468d8-0cd6-42e6-ac8a-1d6afa6e0cf1@proxel.se Discussion: https://postgr.es/m/20250707192654.9e.nmisch@google.com Backpatch-through: 13-17 Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/9affed26349acafb42471de34f37dc06b1a3879e Author: Tom Lane <tgl@sss.pgh.pa.us> Modified Files -------------- src/bin/pg_dump/pg_dump_sort.c | 11 +++++++++++ 1 file changed, 11 insertions(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: pg_dump: provide a stable sort order for rules. @ 2025-07-31 13:43 Noah Misch <noah@leadboat.com> 0 siblings, 0 replies; 6+ messages in thread From: Noah Misch @ 2025-07-31 13:43 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org pg_dump: provide a stable sort order for rules. Previously, we sorted rules by schema name and then rule name; if that wasn't unique, we sorted by rule OID. This can be problematic for comparing dumps from databases with different histories, especially since certain rule names like "_RETURN" are very common. Let's make the sort key schema name, rule name, table name, which should be unique. (This is the same behavior we've long used for triggers and RLS policies.) Andreas Karlsson This back-patches v18 commit 350e6b8ea86c22c0b95c2e32a4e8d109255b5596 to all supported branches. The next commit will assert that pg_dump provides a stable sort order for all object types. That assertion would fail without stabilizing DO_RULE order as this commit did. Discussion: https://postgr.es/m/b4e468d8-0cd6-42e6-ac8a-1d6afa6e0cf1@proxel.se Discussion: https://postgr.es/m/20250707192654.9e.nmisch@google.com Backpatch-through: 13-17 Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/e99010cbd8e27d4074646f508e9a273fd0e9322e Author: Tom Lane <tgl@sss.pgh.pa.us> Modified Files -------------- src/bin/pg_dump/pg_dump_sort.c | 11 +++++++++++ 1 file changed, 11 insertions(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: pg_dump: provide a stable sort order for rules. @ 2025-07-31 13:43 Noah Misch <noah@leadboat.com> 0 siblings, 0 replies; 6+ messages in thread From: Noah Misch @ 2025-07-31 13:43 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org pg_dump: provide a stable sort order for rules. Previously, we sorted rules by schema name and then rule name; if that wasn't unique, we sorted by rule OID. This can be problematic for comparing dumps from databases with different histories, especially since certain rule names like "_RETURN" are very common. Let's make the sort key schema name, rule name, table name, which should be unique. (This is the same behavior we've long used for triggers and RLS policies.) Andreas Karlsson This back-patches v18 commit 350e6b8ea86c22c0b95c2e32a4e8d109255b5596 to all supported branches. The next commit will assert that pg_dump provides a stable sort order for all object types. That assertion would fail without stabilizing DO_RULE order as this commit did. Discussion: https://postgr.es/m/b4e468d8-0cd6-42e6-ac8a-1d6afa6e0cf1@proxel.se Discussion: https://postgr.es/m/20250707192654.9e.nmisch@google.com Backpatch-through: 13-17 Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/25388fb2cb842bb62d9bf2a884924bd7cb35b5ba Author: Tom Lane <tgl@sss.pgh.pa.us> Modified Files -------------- src/bin/pg_dump/pg_dump_sort.c | 11 +++++++++++ 1 file changed, 11 insertions(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: pg_dump: provide a stable sort order for rules. @ 2025-07-31 13:43 Noah Misch <noah@leadboat.com> 0 siblings, 0 replies; 6+ messages in thread From: Noah Misch @ 2025-07-31 13:43 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org pg_dump: provide a stable sort order for rules. Previously, we sorted rules by schema name and then rule name; if that wasn't unique, we sorted by rule OID. This can be problematic for comparing dumps from databases with different histories, especially since certain rule names like "_RETURN" are very common. Let's make the sort key schema name, rule name, table name, which should be unique. (This is the same behavior we've long used for triggers and RLS policies.) Andreas Karlsson This back-patches v18 commit 350e6b8ea86c22c0b95c2e32a4e8d109255b5596 to all supported branches. The next commit will assert that pg_dump provides a stable sort order for all object types. That assertion would fail without stabilizing DO_RULE order as this commit did. Discussion: https://postgr.es/m/b4e468d8-0cd6-42e6-ac8a-1d6afa6e0cf1@proxel.se Discussion: https://postgr.es/m/20250707192654.9e.nmisch@google.com Backpatch-through: 13-17 Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/cc9a62c51a1894a9c838becf558abb056c904fb1 Author: Tom Lane <tgl@sss.pgh.pa.us> Modified Files -------------- src/bin/pg_dump/pg_dump_sort.c | 11 +++++++++++ 1 file changed, 11 insertions(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2025-07-31 13:43 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2024-11-04 18:31 pgsql: pg_dump: provide a stable sort order for rules. Tom Lane <tgl@sss.pgh.pa.us> 2025-07-31 13:43 pgsql: pg_dump: provide a stable sort order for rules. Noah Misch <noah@leadboat.com> 2025-07-31 13:43 pgsql: pg_dump: provide a stable sort order for rules. Noah Misch <noah@leadboat.com> 2025-07-31 13:43 pgsql: pg_dump: provide a stable sort order for rules. Noah Misch <noah@leadboat.com> 2025-07-31 13:43 pgsql: pg_dump: provide a stable sort order for rules. Noah Misch <noah@leadboat.com> 2025-07-31 13:43 pgsql: pg_dump: provide a stable sort order for rules. Noah Misch <noah@leadboat.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox