Re: Rearranging ALTER TABLE to avoid multi-operations bugs
Alvaro Herrera <alvherre@2ndquadrant.com>
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2019-10-30T01:10:39Z
Lists: pgsql-hackers
On 2019-Oct-29, Tom Lane wrote: > The thing I think you are actually worried about is the interaction > with event triggers, which is already a pretty horrid mess in this > code today. I don't really follow the comment here about > "ordering of queued commands". It looks like that comment dates to > Alvaro's commit b488c580a ... can either of you elucidate that? The point of that comment is that if you enqueue the commands as they are returned by pg_event_trigger_ddl_commands() (say by writing them to a table) they must be emitted in an order that allows them to be re-executed in a remote server that duplicates this one, and the final state should be "the same". > Now, if we move things around like that, it will have some effects > on what event triggers see --- certainly the order of operations > at least. But do we feel a need to retain the same sort of > "encapsulation" that is currently happening due to the aforesaid > logic in utility.c? I don't fully understand what that's for. Sadly, the DDL replay logic is not being used for anything at present, so I don't have a good test case to ensure that a proposed change is good in this regard. I've been approached by a couple people interested in finishing the DDL conversion thing, but no takers so far. I know there's people using code based on the src/test/modules/test_ddl_deparse module, but not for replicating a server's state to a different server, as far as I know. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Clarify behavior of adding and altering a column in same ALTER command.
- 9b9c5f279e82 13.0 landed
-
Restructure ALTER TABLE execution to fix assorted bugs.
- 1281a5c907b4 13.0 landed
-
doc: Add best practises section to partitioning docs
- e788e849addd 12.0 cited
-
Allow on-the-fly capture of DDL event details
- b488c580aef4 9.5.0 cited