Specify column in owned sequence call

getOwnedSequences can now filter owned sequences by a specified column.
Passing InvalidAttrNumber preserves the original behavior of returning
all sequences owned by a specified relation.
pull/1439/head
Jason Petersen 2017-04-19 21:40:08 -06:00
parent b1cf59e32a
commit b2319011fe
No known key found for this signature in database
GPG Key ID: 9F1D3510D110ABA9
2 changed files with 8 additions and 0 deletions

View File

@ -498,7 +498,11 @@ GetTableCreationCommands(Oid relationId, bool includeSequenceDefaults)
{ {
List *tableDDLEventList = NIL; List *tableDDLEventList = NIL;
char tableType = 0; char tableType = 0;
#if (PG_VERSION_NUM >= 100000)
List *sequenceIdlist = getOwnedSequences(relationId, InvalidAttrNumber);
#else
List *sequenceIdlist = getOwnedSequences(relationId); List *sequenceIdlist = getOwnedSequences(relationId);
#endif
ListCell *sequenceIdCell; ListCell *sequenceIdCell;
char *tableSchemaDef = NULL; char *tableSchemaDef = NULL;
char *tableColumnOptionsDef = NULL; char *tableColumnOptionsDef = NULL;

View File

@ -841,7 +841,11 @@ List *
SequenceDDLCommandsForTable(Oid relationId) SequenceDDLCommandsForTable(Oid relationId)
{ {
List *sequenceDDLList = NIL; List *sequenceDDLList = NIL;
#if (PG_VERSION_NUM >= 100000)
List *ownedSequences = getOwnedSequences(relationId, InvalidAttrNumber);
#else
List *ownedSequences = getOwnedSequences(relationId); List *ownedSequences = getOwnedSequences(relationId);
#endif
ListCell *listCell; ListCell *listCell;
char *ownerName = TableOwner(relationId); char *ownerName = TableOwner(relationId);