Re: [HACKERS] generated columns
Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>,
Michael Paquier <michael.paquier@gmail.com>,
Jaime Casanova <jaime.casanova@2ndquadrant.com>
Date: 2018-11-22T15:20:20Z
Lists: pgsql-hackers
On 19/11/2018 19:54, Alvaro Herrera wrote: > It's unclear why you made generated columns on partitions unsupported. > I'd fix the limitation if possible, but if not, at least document it. This is explained here: + /* + * Generated columns in partition key expressions: + * + * - Stored generated columns cannot work: They are computed + * after BEFORE triggers, but partition routing is done + * before all triggers. + * + * - Virtual generated columns could work. But there is a + * problem when dropping such a table: Dropping a table + * calls relation_open(), which causes partition keys to be + * constructed for the partcache, but at that point the + * generation expression is already deleted (through + * dependencies), so this will fail. So if you remove the + * restriction below, things will appear to work, but you + * can't drop the table. :-( + */ > (I particularly notice that partition key is marked as unsupported in > the regression test. Consider partitioning on a SERIAL column, this is > clearly something that users will expect to work.) A serial column is not a generated column. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Generated columns
- fc22b6623b6b 12.0 landed
-
Add walreceiver API to get remote server version
- 69039fda837d 12.0 landed
-
Add pg_partition_tree to display information about partitions
- d5eec4eefde7 12.0 cited
-
pg_restore: Augment documentation for -N option
- 2fe42baf7c1a 12.0 cited
-
Change delimiter used for display of NextXID
- 59a884e9854c 9.6.0 cited