Re: Command order bug in pg_dump
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kirill Reshke <reshkekirill@gmail.com>
Cc: pgsql-bugs@postgresql.org, Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2025-04-21T17:08:05Z
Lists: pgsql-bugs
I wrote: > I don't think this is pg_dump's fault: there is no such constraint > when the ALTER TABLE starts. Something inside the ALTER TABLE > recursion seems to be messing up if there is already another > similar FK constraint. Oh, I see what's happening. We create both the specified constraint and an inherited child constraint on the named partitioned table. If tt_a_fkey is added first, the name chosen for its child is "tt_i_fkey", breaking the later attempt by the user to use that name. Apparently there is some hack in psql to not show that child constraint entry, because you don't see it in \d output, which is what confused me before (and would confuse most people hitting this). We could fool around with the generation rule for the child constraint's name, but fundamentally we're infringing on user namespace here, so I think that's likely to just move the problem cases around. Why do we need this child pg_constraint entry at all? If we can't avoid having it, probably choosing a name like "tt_a_fkey1" would be marginally less likely to cause trouble ... but only marginally. In any case, it's pretty awful that we make these entries but \d does not show them. regards, tom lane
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Change the names generated for child foreign key constraints.
- 3db61db48ef5 18.0 landed
-
doc: Fix memory context level in pg_log_backend_memory_contexts() example.
- 706cbed35103 18.0 cited