Skip to content

Commit

Permalink
More whitespace
Browse files Browse the repository at this point in the history
More indentation problems.
  • Loading branch information
jasonmp85 committed Jan 27, 2015
1 parent 38f8403 commit 56c7817
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions pg_shard.c
Original file line number Diff line number Diff line change
Expand Up @@ -996,35 +996,35 @@ TargetEntryList(List *expressionList)
static CreateStmt *
CreateTemporaryTableLikeStmt(Oid sourceRelationId)
{
static unsigned long temporaryTableId = 0;
CreateStmt *createStmt = NULL;
StringInfo clonedTableName = NULL;
RangeVar *clonedRelation = NULL;

char *sourceTableName = get_rel_name(sourceRelationId);
Oid sourceSchemaId = get_rel_namespace(sourceRelationId);
char *sourceSchemaName = get_namespace_name(sourceSchemaId);
RangeVar *sourceRelation = makeRangeVar(sourceSchemaName, sourceTableName, -1);

TableLikeClause *tableLikeClause = makeNode(TableLikeClause);
tableLikeClause->relation = sourceRelation;
tableLikeClause->options = 0; /* don't copy over indexes/constraints etc */

/* create a unique name for the cloned table */
clonedTableName = makeStringInfo();
appendStringInfo(clonedTableName, "%s_%d_%lu",
TEMPORARY_TABLE_PREFIX, MyProcPid, temporaryTableId);
temporaryTableId++;

clonedRelation = makeRangeVar(NULL, clonedTableName->data, -1);
clonedRelation->relpersistence = RELPERSISTENCE_TEMP;

createStmt = makeNode(CreateStmt);
createStmt->relation = clonedRelation;
createStmt->tableElts = list_make1(tableLikeClause);
createStmt->oncommit = ONCOMMIT_DROP;

return createStmt;
static unsigned long temporaryTableId = 0;
CreateStmt *createStmt = NULL;
StringInfo clonedTableName = NULL;
RangeVar *clonedRelation = NULL;

char *sourceTableName = get_rel_name(sourceRelationId);
Oid sourceSchemaId = get_rel_namespace(sourceRelationId);
char *sourceSchemaName = get_namespace_name(sourceSchemaId);
RangeVar *sourceRelation = makeRangeVar(sourceSchemaName, sourceTableName, -1);

TableLikeClause *tableLikeClause = makeNode(TableLikeClause);
tableLikeClause->relation = sourceRelation;
tableLikeClause->options = 0; /* don't copy over indexes/constraints etc */

/* create a unique name for the cloned table */
clonedTableName = makeStringInfo();
appendStringInfo(clonedTableName, "%s_%d_%lu", TEMPORARY_TABLE_PREFIX, MyProcPid,
temporaryTableId);
temporaryTableId++;

clonedRelation = makeRangeVar(NULL, clonedTableName->data, -1);
clonedRelation->relpersistence = RELPERSISTENCE_TEMP;

createStmt = makeNode(CreateStmt);
createStmt->relation = clonedRelation;
createStmt->tableElts = list_make1(tableLikeClause);
createStmt->oncommit = ONCOMMIT_DROP;

return createStmt;
}


Expand Down

0 comments on commit 56c7817

Please sign in to comment.