mirror of
https://github.com/postgres/postgres.git
synced 2025-07-15 19:21:59 +03:00
Allow whole-row Vars to be used in partitioning expressions.
In the wake of commit 5b9312378
, there's no particular reason
for this restriction (previously, it was problematic because of
the implied rowtype reference). A simple constraint on a whole-row
Var probably isn't that useful, but conceivably somebody would want
to pass one to a function that extracts a partitioning key. Besides
which, we're expending much more code to enforce the restriction than
we save by having it, since the latter quantity is now zero.
So drop the restriction.
Amit Langote
Discussion: https://postgr.es/m/CA+HiwqFUzjfj9HEsJtYWcr1SgQ_=iCAvQ=O2Sx6aQxoDu4OiHw@mail.gmail.com
This commit is contained in:
@ -1247,7 +1247,7 @@ check_default_partition_contents(Relation parent, Relation default_rel,
|
||||
*/
|
||||
def_part_constraints =
|
||||
map_partition_varattnos(def_part_constraints, 1, default_rel,
|
||||
parent, NULL);
|
||||
parent);
|
||||
|
||||
/*
|
||||
* If the existing constraints on the default partition imply that it will
|
||||
@ -1297,7 +1297,7 @@ check_default_partition_contents(Relation parent, Relation default_rel,
|
||||
partition_constraint = make_ands_explicit(def_part_constraints);
|
||||
partition_constraint = (Expr *)
|
||||
map_partition_varattnos((List *) partition_constraint, 1,
|
||||
part_rel, default_rel, NULL);
|
||||
part_rel, default_rel);
|
||||
|
||||
/*
|
||||
* If the partition constraints on default partition child imply
|
||||
|
Reference in New Issue
Block a user