]> granicus.if.org Git - postgresql/commit
Remove undocumented restriction against duplicate partition key columns.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 19 Jul 2018 19:41:46 +0000 (15:41 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 19 Jul 2018 19:41:46 +0000 (15:41 -0400)
commit2131d4501f9472ed3714970e45485e5e892615e8
tree97ad0ca93ba4c4d33f08640b82a7c41dfdfb1d20
parent0d26812a4331a5bc50c1bb3115702d48d2601453
Remove undocumented restriction against duplicate partition key columns.

transformPartitionSpec rejected duplicate simple partition columns
(e.g., "PARTITION BY RANGE (x,x)") but paid no attention to expression
columns, resulting in inconsistent behavior.  Worse, cases like
"PARTITION BY RANGE (x,(x))") were accepted but would then result in
dump/reload failures, since the expression (x) would get simplified
to a plain column later.

There seems no better reason for this restriction than there was for
the one against duplicate included index columns (cf commit 701fd0bbc),
so let's just remove it.

Back-patch to v10 where this code was added.

Report and patch by Yugo Nagata.

Discussion: https://postgr.es/m/20180712165939.36b12aff.nagata@sraoss.co.jp
src/backend/commands/tablecmds.c
src/test/regress/expected/create_table.out
src/test/regress/sql/create_table.sql