Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite22e29c

Browse files
committed
Fix handling of CREATE TABLE LIKE with inheritance.
If a CREATE TABLE command uses both LIKE and traditional inheritance,Vars in CHECK constraints and expression indexes that are absorbedfrom a LIKE parent table tended to get mis-numbered, resulting inwrong answers and/or bizarre error messages (though probably not anyactual crashes, thanks to validation occurring in the executor).In v12 and up, the same could happen to Vars in GENERATED expressions,even in cases with no LIKE clause but multiple traditional-inheritanceparents.The cause of the problem for LIKE is that parse_utilcmd.c supposedit could renumber such Vars correctly during transformCreateStmt(),which it cannot since we have not yet accounted for columns added viainheritance. Fix that by postponing processing of LIKE INCLUDINGCONSTRAINTS, DEFAULTS, GENERATED, INDEXES till after we've performedDefineRelation().The error with GENERATED and multiple inheritance is a simple oversightin MergeAttributes(); it knows it has to renumber Vars in inheritedCHECK constraints, but forgot to apply the same processing to inheritedGENERATED expressions (a/k/a defaults).Per bug #16272 from Tom Gottfried. The non-GENERATED variants of theissue are ancient, presumably dating right back to the addition ofCREATE TABLE LIKE; hence back-patch to all supported branches.Discussion:https://postgr.es/m/16272-6e32da020e9a9381@postgresql.org
1 parent3a45ac0 commite22e29c

File tree

5 files changed

+241
-83
lines changed

5 files changed

+241
-83
lines changed

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp