Refactor identity sequence retrieval in insert select planner for compatibility

m3hm3t/issue_7887
Mehmet Yilmaz 2025-03-05 07:35:08 +00:00
parent 784c5eb0f0
commit ee1992d4c5
1 changed files with 3 additions and 1 deletions

View File

@ -10,8 +10,10 @@
#include "postgres.h" #include "postgres.h"
#include "catalog/dependency.h"
#include "catalog/pg_class.h" #include "catalog/pg_class.h"
#include "catalog/pg_type.h" #include "catalog/pg_type.h"
#include "commands/sequence.h"
#include "nodes/makefuncs.h" #include "nodes/makefuncs.h"
#include "nodes/nodeFuncs.h" #include "nodes/nodeFuncs.h"
#include "nodes/parsenodes.h" #include "nodes/parsenodes.h"
@ -1128,7 +1130,7 @@ ReorderInsertSelectTargetLists(Query *originalQuery, RangeTblEntry *insertRte,
oldInsertTargetEntry->resname); oldInsertTargetEntry->resname);
bool missingOk = false; bool missingOk = false;
Oid seqOid = getIdentitySequence(targetRel, attrNum, missingOk); Oid seqOid = getIdentitySequence(identitySequenceRelation_compat(targetRel), attrNum, missingOk);
if (!OidIsValid(seqOid)) if (!OidIsValid(seqOid))
{ {
table_close(targetRel, AccessShareLock); table_close(targetRel, AccessShareLock);