mirror of https://github.com/citusdata/citus.git
Check extension owner once
parent
05b4711962
commit
ea3063e6d2
|
@ -1885,9 +1885,7 @@ List *
|
|||
InterTableRelationshipOfRelationCommandList(Oid relationId)
|
||||
{
|
||||
/* commands to create foreign key constraints */
|
||||
List *foreignConstraintCommands =
|
||||
GetReferencingForeignConstaintCommands(relationId);
|
||||
List *commandList = list_concat(commandList, foreignConstraintCommands);
|
||||
List *commandList = GetReferencingForeignConstaintCommands(relationId);
|
||||
|
||||
/* commands to create partitioning hierarchy */
|
||||
if (PartitionTable(relationId))
|
||||
|
|
|
@ -597,23 +597,21 @@ InterTableRelationshipCommandList()
|
|||
CitusTableCacheEntry *cacheEntry = NULL;
|
||||
foreach_ptr(cacheEntry, distributedTableList)
|
||||
{
|
||||
if (ShouldSyncTableMetadata(cacheEntry->relationId))
|
||||
/*
|
||||
* Skip foreign key and partition creation when we shouldn't need to sync
|
||||
* tablem metadata or the Citus table is owned by an extension.
|
||||
*/
|
||||
if (ShouldSyncTableMetadata(cacheEntry->relationId) &&
|
||||
!IsTableOwnedByExtension(cacheEntry->relationId))
|
||||
{
|
||||
propagatedTableList = lappend(propagatedTableList, cacheEntry);
|
||||
}
|
||||
}
|
||||
|
||||
/* construct the foreign key constraints after all tables are created */
|
||||
foreach_ptr(cacheEntry, propagatedTableList)
|
||||
{
|
||||
Oid relationId = cacheEntry->relationId;
|
||||
|
||||
if (IsTableOwnedByExtension(relationId))
|
||||
{
|
||||
/* skip foreign key creation when the Citus table is owned by an extension */
|
||||
continue;
|
||||
}
|
||||
|
||||
List *commandListForRelation =
|
||||
InterTableRelationshipOfRelationCommandList(relationId);
|
||||
|
||||
|
|
|
@ -56,6 +56,7 @@ extern char * PlacementUpsertCommand(uint64 shardId, uint64 placementId, int sha
|
|||
uint64 shardLength, int32 groupId);
|
||||
extern char * TruncateTriggerCreateCommand(Oid relationId);
|
||||
extern void CreateInterTableRelationshipOfRelationOnWorkers(Oid relationId);
|
||||
extern List * InterTableRelationshipOfRelationCommandList(Oid relationId);
|
||||
extern void CreateShellTableOnWorkers(Oid relationId);
|
||||
extern void CreateTableMetadataOnWorkers(Oid relationId);
|
||||
extern List * DetachPartitionCommandList(void);
|
||||
|
|
Loading…
Reference in New Issue