pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Check collation when creating partitioned index 6+ messages / 1 participants [nested] [flat]
* pgsql: Check collation when creating partitioned index @ 2023-12-01 15:31 Peter Eisentraut <peter@eisentraut.org> 0 siblings, 0 replies; 6+ messages in thread From: Peter Eisentraut @ 2023-12-01 15:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Check collation when creating partitioned index When creating a partitioned index, the partition key must be a subset of the index's columns. But this currently doesn't check that the collations between the partition key and the index definition match. So you can construct a unique index that fails to enforce uniqueness. (This would most likely involve a nondeterministic collation, so it would have to be crafted explicitly and is not something that would just happen by accident.) This patch adds the required collation check. As a result, any previously allowed unique index that has a collation mismatch would no longer be allowed to be created. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/flat/3327cb54-f7f1-413b-8fdb-7a9dceebb938%40eisentraut.org Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/a11c9c42ea3193ff7a977764788bda43ebb07b35 Modified Files -------------- src/backend/commands/indexcmds.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Check collation when creating partitioned index @ 2023-12-01 15:31 Peter Eisentraut <peter@eisentraut.org> 0 siblings, 0 replies; 6+ messages in thread From: Peter Eisentraut @ 2023-12-01 15:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Check collation when creating partitioned index When creating a partitioned index, the partition key must be a subset of the index's columns. But this currently doesn't check that the collations between the partition key and the index definition match. So you can construct a unique index that fails to enforce uniqueness. (This would most likely involve a nondeterministic collation, so it would have to be crafted explicitly and is not something that would just happen by accident.) This patch adds the required collation check. As a result, any previously allowed unique index that has a collation mismatch would no longer be allowed to be created. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/flat/3327cb54-f7f1-413b-8fdb-7a9dceebb938%40eisentraut.org Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/267f33f684173296897a5157e760c5fb7009964d Modified Files -------------- src/backend/commands/indexcmds.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Check collation when creating partitioned index @ 2023-12-01 15:31 Peter Eisentraut <peter@eisentraut.org> 0 siblings, 0 replies; 6+ messages in thread From: Peter Eisentraut @ 2023-12-01 15:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Check collation when creating partitioned index When creating a partitioned index, the partition key must be a subset of the index's columns. But this currently doesn't check that the collations between the partition key and the index definition match. So you can construct a unique index that fails to enforce uniqueness. (This would most likely involve a nondeterministic collation, so it would have to be crafted explicitly and is not something that would just happen by accident.) This patch adds the required collation check. As a result, any previously allowed unique index that has a collation mismatch would no longer be allowed to be created. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/flat/3327cb54-f7f1-413b-8fdb-7a9dceebb938%40eisentraut.org Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/15d485921b1c2125d551e87a1f04be9d5c124b15 Modified Files -------------- src/backend/commands/indexcmds.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Check collation when creating partitioned index @ 2023-12-01 15:31 Peter Eisentraut <peter@eisentraut.org> 0 siblings, 0 replies; 6+ messages in thread From: Peter Eisentraut @ 2023-12-01 15:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Check collation when creating partitioned index When creating a partitioned index, the partition key must be a subset of the index's columns. But this currently doesn't check that the collations between the partition key and the index definition match. So you can construct a unique index that fails to enforce uniqueness. (This would most likely involve a nondeterministic collation, so it would have to be crafted explicitly and is not something that would just happen by accident.) This patch adds the required collation check. As a result, any previously allowed unique index that has a collation mismatch would no longer be allowed to be created. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/flat/3327cb54-f7f1-413b-8fdb-7a9dceebb938%40eisentraut.org Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/e846fc491923a499a6d8b388292798fc808cd7a3 Modified Files -------------- src/backend/commands/indexcmds.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Check collation when creating partitioned index @ 2023-12-01 15:31 Peter Eisentraut <peter@eisentraut.org> 0 siblings, 0 replies; 6+ messages in thread From: Peter Eisentraut @ 2023-12-01 15:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Check collation when creating partitioned index When creating a partitioned index, the partition key must be a subset of the index's columns. But this currently doesn't check that the collations between the partition key and the index definition match. So you can construct a unique index that fails to enforce uniqueness. (This would most likely involve a nondeterministic collation, so it would have to be crafted explicitly and is not something that would just happen by accident.) This patch adds the required collation check. As a result, any previously allowed unique index that has a collation mismatch would no longer be allowed to be created. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/flat/3327cb54-f7f1-413b-8fdb-7a9dceebb938%40eisentraut.org Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/3c49fa2aff2c2e4ec612c97e2c44b928c8809fae Modified Files -------------- src/backend/commands/indexcmds.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Check collation when creating partitioned index @ 2023-12-01 15:31 Peter Eisentraut <peter@eisentraut.org> 0 siblings, 0 replies; 6+ messages in thread From: Peter Eisentraut @ 2023-12-01 15:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Check collation when creating partitioned index When creating a partitioned index, the partition key must be a subset of the index's columns. But this currently doesn't check that the collations between the partition key and the index definition match. So you can construct a unique index that fails to enforce uniqueness. (This would most likely involve a nondeterministic collation, so it would have to be crafted explicitly and is not something that would just happen by accident.) This patch adds the required collation check. As a result, any previously allowed unique index that has a collation mismatch would no longer be allowed to be created. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/flat/3327cb54-f7f1-413b-8fdb-7a9dceebb938%40eisentraut.org Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/5d40b3c4f6cae974160cde49932eb1e0c2d04213 Modified Files -------------- src/backend/commands/indexcmds.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2023-12-01 15:31 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-12-01 15:31 pgsql: Check collation when creating partitioned index Peter Eisentraut <peter@eisentraut.org> 2023-12-01 15:31 pgsql: Check collation when creating partitioned index Peter Eisentraut <peter@eisentraut.org> 2023-12-01 15:31 pgsql: Check collation when creating partitioned index Peter Eisentraut <peter@eisentraut.org> 2023-12-01 15:31 pgsql: Check collation when creating partitioned index Peter Eisentraut <peter@eisentraut.org> 2023-12-01 15:31 pgsql: Check collation when creating partitioned index Peter Eisentraut <peter@eisentraut.org> 2023-12-01 15:31 pgsql: Check collation when creating partitioned index Peter Eisentraut <peter@eisentraut.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