pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix list partition constraints for partition keys of array type. 2+ messages / 1 participants [nested] [flat]
* pgsql: Fix list partition constraints for partition keys of array type. @ 2018-01-31 21:08 Robert Haas <rhaas@postgresql.org> 0 siblings, 0 replies; 2+ messages in thread From: Robert Haas @ 2018-01-31 21:08 UTC (permalink / raw) To: pgsql-committers Fix list partition constraints for partition keys of array type. The old code generated always generated a constraint of the form col = ANY(ARRAY[val1, val2, ...]), but that's invalid when col is an array type. Instead, generate col = val when there's only one value, col = val1 OR col = val2 OR ... when there are multiple values and col is of array type, and the old form when there are multiple values and col is not of an array type. As a side benefit, this makes constraint exclusion able to prune a list partition declared to accept a single Boolean value, which didn't work before. Amit Langote, reviewed by Etsuro Fujita Discussion: http://postgr.es/m/97267195-e235-89d1-a41a-c110198dfce9@lab.ntt.co.jp Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/3ccdc6f9a5876d0953912fd589989387764ed9a3 Modified Files -------------- src/backend/catalog/partition.c | 98 ++++++++++++++++++--------- src/test/regress/expected/create_table.out | 18 ++++- src/test/regress/expected/foreign_data.out | 6 +- src/test/regress/expected/partition_prune.out | 8 +-- src/test/regress/sql/create_table.sql | 6 ++ 5 files changed, 93 insertions(+), 43 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Fix list partition constraints for partition keys of array type. @ 2018-01-31 21:08 Robert Haas <rhaas@postgresql.org> 0 siblings, 0 replies; 2+ messages in thread From: Robert Haas @ 2018-01-31 21:08 UTC (permalink / raw) To: pgsql-committers Fix list partition constraints for partition keys of array type. The old code generated always generated a constraint of the form col = ANY(ARRAY[val1, val2, ...]), but that's invalid when col is an array type. Instead, generate col = val when there's only one value, col = val1 OR col = val2 OR ... when there are multiple values and col is of array type, and the old form when there are multiple values and col is not of an array type. As a side benefit, this makes constraint exclusion able to prune a list partition declared to accept a single Boolean value, which didn't work before. Amit Langote, reviewed by Etsuro Fujita Discussion: http://postgr.es/m/97267195-e235-89d1-a41a-c110198dfce9@lab.ntt.co.jp Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/86fba28657858307bb27d4d7e3a9ef053ac0c2b4 Modified Files -------------- src/backend/catalog/partition.c | 96 ++++++++++++++++++++---------- src/test/regress/expected/create_table.out | 18 +++++- src/test/regress/expected/foreign_data.out | 6 +- src/test/regress/sql/create_table.sql | 6 ++ 4 files changed, 90 insertions(+), 36 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2018-01-31 21:08 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2018-01-31 21:08 pgsql: Fix list partition constraints for partition keys of array type. Robert Haas <rhaas@postgresql.org> 2018-01-31 21:08 pgsql: Fix list partition constraints for partition keys of array type. Robert Haas <rhaas@postgresql.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox