pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix crash when using COLLATE in partition bound expressions
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix crash when using COLLATE in partition bound expressions
@ 2020-04-08 06:05 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2020-04-08 06:05 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix crash when using COLLATE in partition bound expressions

Attempting to use a COLLATE clause with a type that it not collatable in
a partition bound expression could crash the server.  This commit fixes
the code by adding more checks similar to what is done when computing
index or partition attributes by making sure that there is a collation
iff the type is collatable.

Backpatch down to 12, as 7c079d7 introduced this problem.

Reported-by: Alexander Lakhin
Author: Dmitry Dolgov
Discussion: https://postgr.es/m/16325-809194cf742313ab@postgresql.org
Backpatch-through: 12

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c0187869a0f6eb05135d388462522a593ced1b88

Modified Files
--------------
src/backend/parser/parse_utilcmd.c         | 24 ++++++++++++++++++++++++
src/test/regress/expected/create_table.out |  6 ++++++
src/test/regress/sql/create_table.sql      |  2 ++
3 files changed, 32 insertions(+)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Fix crash when using COLLATE in partition bound expressions
@ 2020-04-08 06:05 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2020-04-08 06:05 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix crash when using COLLATE in partition bound expressions

Attempting to use a COLLATE clause with a type that it not collatable in
a partition bound expression could crash the server.  This commit fixes
the code by adding more checks similar to what is done when computing
index or partition attributes by making sure that there is a collation
iff the type is collatable.

Backpatch down to 12, as 7c079d7 introduced this problem.

Reported-by: Alexander Lakhin
Author: Dmitry Dolgov
Discussion: https://postgr.es/m/16325-809194cf742313ab@postgresql.org
Backpatch-through: 12

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0a9ae1800f67339a8acb45029369e60b98e72fd6

Modified Files
--------------
src/backend/parser/parse_utilcmd.c         | 24 ++++++++++++++++++++++++
src/test/regress/expected/create_table.out |  6 ++++++
src/test/regress/sql/create_table.sql      |  2 ++
3 files changed, 32 insertions(+)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2020-04-08 06:05 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-04-08 06:05 pgsql: Fix crash when using COLLATE in partition bound expressions Michael Paquier <michael@paquier.xyz>
2020-04-08 06:05 pgsql: Fix crash when using COLLATE in partition bound expressions Michael Paquier <michael@paquier.xyz>

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