- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitc7f3c41
committed
Fix possible crash in pg_dump with identity sequences.
If an owned sequence is considered interesting, force its owningtable to be marked interesting too. This ensures, in particular,that we'll fetch the owning table's column names so we have thedata needed for ALTER TABLE ... ADD GENERATED. Previously there wereedge cases where pg_dump could get SIGSEGV due to not having filled inthe column names. (The known case is where the owning table has beenmade part of an extension while its identity sequence is not a member;but there may be others.)Also, if it's an identity sequence, force its dumped-components maskto exactly match the owning table: dump definition only if we'redumping the table's definition, dump data only if we're dumping thetable's data, etc. This generalizes the code introduced in commitb965f26 that set the sequence's dump mask to NONE if the owningtable's mask is NONE. That's insufficient to prevent failures,because for example the table's mask might only request dumping ACLs,which would lead us to still emit ALTER TABLE ADD GENERATED eventhough we didn't create the table. It seems better to treat anidentity sequence as though it were an inseparable aspect of thetable, matching the treatment used in the backend's dependency logic.Perhaps this policy needs additional refinement, but let's wait tosee some field use-cases before changing it further.While here, add a comment in pg_dump.h warning against writing testslike "if (dobj->dump == DUMP_COMPONENT_NONE)", which was a bug in thiscase. There is one other example in getPublicationNamespaces, whichif it's not a bug is at least remarkably unclear and under-documented.Changing that requires a separate discussion, however.Per report from Artur Zakirov. Back-patch to all supported branches.Discussion:https://postgr.es/m/CAKNkYnwXFBf136=u9UqUxFUVagevLQJ=zGd5BsLhCsatDvQsKQ@mail.gmail.com1 parent4abf615 commitc7f3c41
1 file changed
+17
-15
lines changedLines changed: 17 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7227 | 7227 |
| |
7228 | 7228 |
| |
7229 | 7229 |
| |
7230 |
| - | |
7231 |
| - | |
7232 |
| - | |
7233 |
| - | |
7234 |
| - | |
7235 |
| - | |
7236 |
| - | |
7237 |
| - | |
7238 |
| - | |
7239 |
| - | |
7240 |
| - | |
7241 |
| - | |
7242 |
| - | |
7243 |
| - | |
| 7230 | + | |
| 7231 | + | |
| 7232 | + | |
| 7233 | + | |
| 7234 | + | |
| 7235 | + | |
| 7236 | + | |
| 7237 | + | |
| 7238 | + | |
7244 | 7239 |
| |
7245 | 7240 |
| |
7246 | 7241 |
| |
| |||
7253 | 7248 |
| |
7254 | 7249 |
| |
7255 | 7250 |
| |
7256 |
| - | |
| 7251 | + | |
| 7252 | + | |
| 7253 | + | |
| 7254 | + | |
7257 | 7255 |
| |
| 7256 | + | |
7258 | 7257 |
| |
| 7258 | + | |
7259 | 7259 |
| |
| 7260 | + | |
| 7261 | + | |
7260 | 7262 |
| |
7261 | 7263 |
| |
7262 | 7264 |
| |
|
0 commit comments
Comments
(0)