mirror of https://github.com/citusdata/citus.git
Rename ExtractColumnsOwningSequences
parent
912d829757
commit
93c3f30024
|
@ -893,8 +893,8 @@ DropAndMoveDefaultSequenceOwnerships(Oid sourceRelationId, Oid targetRelationId)
|
|||
{
|
||||
List *columnNameList = NIL;
|
||||
List *ownedSequenceIdList = NIL;
|
||||
ExtractColumnsOwningSequences(sourceRelationId, &columnNameList,
|
||||
&ownedSequenceIdList);
|
||||
ExtractDefaultColumnsAndOwnedSequences(sourceRelationId, &columnNameList,
|
||||
&ownedSequenceIdList);
|
||||
|
||||
ListCell *columnNameCell = NULL;
|
||||
ListCell *ownedSequenceIdCell = NULL;
|
||||
|
|
|
@ -151,13 +151,14 @@ OptionsSpecifyOwnedBy(List *optionList, Oid *ownedByTableId)
|
|||
|
||||
|
||||
/*
|
||||
* ExtractColumnsOwningSequences finds each column of relation with relationId
|
||||
* defaulting to an owned sequence. Then, appends the column name and id of the
|
||||
* owned sequence -that the column defaults- to the lists passed as NIL initially.
|
||||
* ExtractDefaultColumnsAndOwnedSequences finds each column of relation with
|
||||
* relationId that has a DEFAULT expression and each sequence owned by such
|
||||
* columns (if any). Then, appends the column name and id of the owned sequence
|
||||
* -that the column defaults- to the lists passed as NIL initially.
|
||||
*/
|
||||
void
|
||||
ExtractColumnsOwningSequences(Oid relationId, List **columnNameList,
|
||||
List **ownedSequenceIdList)
|
||||
ExtractDefaultColumnsAndOwnedSequences(Oid relationId, List **columnNameList,
|
||||
List **ownedSequenceIdList)
|
||||
{
|
||||
Assert(*columnNameList == NIL && *ownedSequenceIdList == NIL);
|
||||
|
||||
|
|
|
@ -1131,7 +1131,7 @@ SequenceDependencyCommandList(Oid relationId)
|
|||
List *columnNameList = NIL;
|
||||
List *sequenceIdList = NIL;
|
||||
|
||||
ExtractColumnsOwningSequences(relationId, &columnNameList, &sequenceIdList);
|
||||
ExtractDefaultColumnsAndOwnedSequences(relationId, &columnNameList, &sequenceIdList);
|
||||
|
||||
ListCell *columnNameCell = NULL;
|
||||
ListCell *sequenceIdCell = NULL;
|
||||
|
@ -1144,7 +1144,7 @@ SequenceDependencyCommandList(Oid relationId)
|
|||
if (!OidIsValid(sequenceId))
|
||||
{
|
||||
/*
|
||||
* ExtractColumnsOwningSequences returns entries for all columns,
|
||||
* ExtractDefaultColumnsAndOwnedSequences returns entries for all columns,
|
||||
* but with 0 sequence ID unless there is default nextval(..).
|
||||
*/
|
||||
continue;
|
||||
|
|
|
@ -13,8 +13,9 @@
|
|||
#include "nodes/pg_list.h"
|
||||
|
||||
|
||||
extern void ExtractColumnsOwningSequences(Oid relationId, List **columnNameList,
|
||||
List **ownedSequenceIdList);
|
||||
extern void ExtractDefaultColumnsAndOwnedSequences(Oid relationId,
|
||||
List **columnNameList,
|
||||
List **ownedSequenceIdList);
|
||||
|
||||
|
||||
#endif /* CITUS_SEQUENCE_H */
|
||||
|
|
Loading…
Reference in New Issue