{*,}create_distributed_table doesn't emit OID (#1710)

pull/1700/head
Brian Cloutier 2017-10-16 17:08:51 -07:00 committed by Jason Petersen
parent ebcb2b65e9
commit 91ff8cd2d5
3 changed files with 16 additions and 4 deletions

View File

@ -133,7 +133,13 @@ master_create_distributed_table(PG_FUNCTION_ARGS)
* sense of this table until we've committed, and we don't want multiple * sense of this table until we've committed, and we don't want multiple
* backends manipulating this relation. * backends manipulating this relation.
*/ */
relation = relation_open(relationId, ExclusiveLock); relation = try_relation_open(relationId, ExclusiveLock);
if (relation == NULL)
{
ereport(ERROR, (errmsg("could not create distributed table: "
"relation does not exist")));
}
/* /*
* We should do this check here since the codes in the following lines rely * We should do this check here since the codes in the following lines rely
@ -191,7 +197,13 @@ create_distributed_table(PG_FUNCTION_ARGS)
* sense of this table until we've committed, and we don't want multiple * sense of this table until we've committed, and we don't want multiple
* backends manipulating this relation. * backends manipulating this relation.
*/ */
relation = relation_open(relationId, ExclusiveLock); relation = try_relation_open(relationId, ExclusiveLock);
if (relation == NULL)
{
ereport(ERROR, (errmsg("could not create distributed table: "
"relation does not exist")));
}
/* /*
* We should do this check here since the codes in the following lines rely * We should do this check here since the codes in the following lines rely

View File

@ -213,7 +213,7 @@ step s1-drop: DROP TABLE drop_hash;
step s2-distribute-table: SELECT create_distributed_table('drop_hash', 'id'); <waiting ...> step s2-distribute-table: SELECT create_distributed_table('drop_hash', 'id'); <waiting ...>
step s1-commit: COMMIT; step s1-commit: COMMIT;
step s2-distribute-table: <... completed> step s2-distribute-table: <... completed>
error in steps s1-commit s2-distribute-table: ERROR: could not open relation with OID 23249 error in steps s1-commit s2-distribute-table: ERROR: could not create distributed table: relation does not exist
step s2-commit: COMMIT; step s2-commit: COMMIT;
step s1-select-count: SELECT COUNT(*) FROM drop_hash; step s1-select-count: SELECT COUNT(*) FROM drop_hash;
ERROR: relation "drop_hash" does not exist ERROR: relation "drop_hash" does not exist

View File

@ -213,7 +213,7 @@ step s1-drop: DROP TABLE drop_hash;
step s2-distribute-table: SELECT create_distributed_table('drop_hash', 'id'); <waiting ...> step s2-distribute-table: SELECT create_distributed_table('drop_hash', 'id'); <waiting ...>
step s1-commit: COMMIT; step s1-commit: COMMIT;
step s2-distribute-table: <... completed> step s2-distribute-table: <... completed>
error in steps s1-commit s2-distribute-table: ERROR: could not open relation with OID 22205 error in steps s1-commit s2-distribute-table: ERROR: could not create distributed table: relation does not exist
step s2-commit: COMMIT; step s2-commit: COMMIT;
step s1-select-count: SELECT COUNT(*) FROM drop_hash; step s1-select-count: SELECT COUNT(*) FROM drop_hash;
ERROR: relation "drop_hash" does not exist ERROR: relation "drop_hash" does not exist