Allow whole-row Vars to be used in partitioning expressions.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 25 Dec 2019 20:44:15 +0000 (15:44 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 25 Dec 2019 20:44:15 +0000 (15:44 -0500)
commitbb4114a4e2c65f27931cc074214c051dba2876c3
treef197bcc85c7479e20905e9f821893d5c49eb67b3
parent42f74f49367bee1d3da28c4b383faec29364f320
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
src/backend/catalog/partition.c
src/backend/commands/tablecmds.c
src/backend/commands/trigger.c
src/backend/partitioning/partbounds.c
src/backend/utils/cache/partcache.c
src/include/catalog/partition.h
src/test/regress/expected/create_table.out
src/test/regress/sql/create_table.sql