pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Disallow partition key expressions that return pseudo-types. 4+ messages / 1 participants [nested] [flat]
* pgsql: Disallow partition key expressions that return pseudo-types. @ 2019-12-23 17:53 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2019-12-23 17:53 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Disallow partition key expressions that return pseudo-types. This wasn't checked originally, but it should have been, because in general pseudo-types can't be stored to and retrieved from disk. Notably, partition bound values of type "record" would not be interpretable by another session. In v12 and HEAD, add another flag to CheckAttributeType's repertoire so that it can produce a specific error message for this case. That's infeasible in older branches without an ABI break, so fall back to a slightly-less-nicely-worded error message in v10 and v11. Problem noted by Amit Langote, though this patch is not his initial solution. Back-patch to v10 where partitioning was introduced. Discussion: https://postgr.es/m/CA+HiwqFUzjfj9HEsJtYWcr1SgQ_=iCAvQ=O2Sx6aQxoDu4OiHw@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/39ebb943de9dd64e305d17329b8989e3061d03a5 Modified Files -------------- src/backend/catalog/heap.c | 43 +++++++++++++++++++++++------- src/backend/commands/tablecmds.c | 16 +++++++++-- src/include/catalog/heap.h | 1 + src/test/regress/expected/create_table.out | 13 ++++++++- src/test/regress/sql/create_table.sql | 12 ++++++++- 5 files changed, 71 insertions(+), 14 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Disallow partition key expressions that return pseudo-types. @ 2019-12-23 17:53 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2019-12-23 17:53 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Disallow partition key expressions that return pseudo-types. This wasn't checked originally, but it should have been, because in general pseudo-types can't be stored to and retrieved from disk. Notably, partition bound values of type "record" would not be interpretable by another session. In v12 and HEAD, add another flag to CheckAttributeType's repertoire so that it can produce a specific error message for this case. That's infeasible in older branches without an ABI break, so fall back to a slightly-less-nicely-worded error message in v10 and v11. Problem noted by Amit Langote, though this patch is not his initial solution. Back-patch to v10 where partitioning was introduced. Discussion: https://postgr.es/m/CA+HiwqFUzjfj9HEsJtYWcr1SgQ_=iCAvQ=O2Sx6aQxoDu4OiHw@mail.gmail.com Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/7fbb39a967ea7fa32915407ea87eee1d5f38d9e7 Modified Files -------------- src/backend/catalog/heap.c | 43 +++++++++++++++++++++++------- src/backend/commands/tablecmds.c | 16 +++++++++-- src/include/catalog/heap.h | 1 + src/test/regress/expected/create_table.out | 13 ++++++++- src/test/regress/sql/create_table.sql | 12 ++++++++- 5 files changed, 71 insertions(+), 14 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Disallow partition key expressions that return pseudo-types. @ 2019-12-23 17:53 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2019-12-23 17:53 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Disallow partition key expressions that return pseudo-types. This wasn't checked originally, but it should have been, because in general pseudo-types can't be stored to and retrieved from disk. Notably, partition bound values of type "record" would not be interpretable by another session. In v12 and HEAD, add another flag to CheckAttributeType's repertoire so that it can produce a specific error message for this case. That's infeasible in older branches without an ABI break, so fall back to a slightly-less-nicely-worded error message in v10 and v11. Problem noted by Amit Langote, though this patch is not his initial solution. Back-patch to v10 where partitioning was introduced. Discussion: https://postgr.es/m/CA+HiwqFUzjfj9HEsJtYWcr1SgQ_=iCAvQ=O2Sx6aQxoDu4OiHw@mail.gmail.com Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/281dd22ac0150603ab82c052a9b5995cc2c5fb8f Modified Files -------------- src/backend/commands/tablecmds.c | 10 ++++++++++ src/test/regress/expected/create_table.out | 13 ++++++++++++- src/test/regress/sql/create_table.sql | 12 +++++++++++- 3 files changed, 33 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Disallow partition key expressions that return pseudo-types. @ 2019-12-23 17:53 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2019-12-23 17:53 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Disallow partition key expressions that return pseudo-types. This wasn't checked originally, but it should have been, because in general pseudo-types can't be stored to and retrieved from disk. Notably, partition bound values of type "record" would not be interpretable by another session. In v12 and HEAD, add another flag to CheckAttributeType's repertoire so that it can produce a specific error message for this case. That's infeasible in older branches without an ABI break, so fall back to a slightly-less-nicely-worded error message in v10 and v11. Problem noted by Amit Langote, though this patch is not his initial solution. Back-patch to v10 where partitioning was introduced. Discussion: https://postgr.es/m/CA+HiwqFUzjfj9HEsJtYWcr1SgQ_=iCAvQ=O2Sx6aQxoDu4OiHw@mail.gmail.com Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/ea1205a02a030562e41353bc39fcf621e11b45c0 Modified Files -------------- src/backend/commands/tablecmds.c | 10 ++++++++++ src/test/regress/expected/create_table.out | 13 ++++++++++++- src/test/regress/sql/create_table.sql | 12 +++++++++++- 3 files changed, 33 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2019-12-23 17:53 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2019-12-23 17:53 pgsql: Disallow partition key expressions that return pseudo-types. Tom Lane <tgl@sss.pgh.pa.us> 2019-12-23 17:53 pgsql: Disallow partition key expressions that return pseudo-types. Tom Lane <tgl@sss.pgh.pa.us> 2019-12-23 17:53 pgsql: Disallow partition key expressions that return pseudo-types. Tom Lane <tgl@sss.pgh.pa.us> 2019-12-23 17:53 pgsql: Disallow partition key expressions that return pseudo-types. Tom Lane <tgl@sss.pgh.pa.us>
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