mirror of
https://github.com/postgres/postgres.git
synced 2025-07-15 19:21:59 +03:00
Code review for c94e6942ce
.
validateCheckConstraint() shouldn't try to access the storage for a partitioned table, because it no longer has any. Creating a _RETURN table on a partitioned table shouldn't be allowed, both because there's no value in it and because trying to do so would involve a validation scan against its nonexistent storage. Amit Langote, reviewed by Tom Lane. Regression test outputs updated to pass by me. Discussion: http://postgr.es/m/e5c3cbd3-1551-d6f8-c9e2-51777d632fd2@lab.ntt.co.jp
This commit is contained in:
@ -422,6 +422,12 @@ DefineQueryRewrite(char *rulename,
|
||||
HeapScanDesc scanDesc;
|
||||
Snapshot snapshot;
|
||||
|
||||
if (event_relation->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
|
||||
errmsg("could not convert partitioned table \"%s\" to a view",
|
||||
RelationGetRelationName(event_relation))));
|
||||
|
||||
snapshot = RegisterSnapshot(GetLatestSnapshot());
|
||||
scanDesc = heap_beginscan(event_relation, snapshot, 0, NULL);
|
||||
if (heap_getnext(scanDesc, ForwardScanDirection) != NULL)
|
||||
|
Reference in New Issue
Block a user