Re: [BUG] pg_dump does not properly deal with BEGIN ATOMIC function
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: "Imseih (AWS), Sami" <simseih@amazon.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-06-04T17:36:08Z
Lists: pgsql-hackers
"Imseih (AWS), Sami" <simseih@amazon.com> writes: > Some minor comments I have: > 1/ > + agginfo[i].aggfn.postponed_def = false; /* might get set during sort */ > This is probably not needed as it seems that we can only > get into this situation when function dependencies are tracked. That's just to keep from leaving an undefined field in the DumpableObject struct. You are very likely right that nothing would examine that field today, but that seems like a poor excuse for not initializing it. > 2/ > The following description makes more sense. > + * section. This is sufficient to handle cases where a function depends on > + * some constraints, as can happen if a BEGIN ATOMIC function > + * references a constraint directly. I did not think this was an improvement. For one thing, I doubt that BEGIN ATOMIC is essential to cause the problem. I didn't prove the point by making a test case, but a "RETURN expression" function could probably trip over it too by putting a sub-SELECT with GROUP BY into the expression. Also, your wording promises more about what cases we can handle than I think is justified. > 3/ > The docs in https://www.postgresql.org/docs/current/ddl-depend.html > should be updated. Right. In general, I thought that the new-style-SQL-functions patch was very slipshod about updating the docs, and omitted touching many places where it would be appropriate to mention the new style, or even flat-out replace examples with new syntax. I did something about this particular point, but perhaps someone would like to look around and work on that topic? regards, tom lane
Commits
-
Doc: explain about dependency tracking for new-style SQL functions.
- 1b322c1faee9 14.9 landed
- 0aa5e4af1bda 15.4 landed
- 0211544969b5 16.0 landed
-
Fix pg_dump's failure to honor dependencies of SQL functions.
- d6f549d7a627 14.9 landed
- ca9e79274938 15.4 landed
- 01610747867f 16.0 landed
-
Fix misuse of pg_log_info() for details/hints.
- b3f32a6c312c 16.0 landed
- 751ba1a7c168 15.4 landed