pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Reject attempts to alter composite types used in indexes.
6+ messages / 1 participants
[nested] [flat]

* pgsql: Reject attempts to alter composite types used in indexes.
@ 2023-03-27 19:04  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2023-03-27 19:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Reject attempts to alter composite types used in indexes.

find_composite_type_dependencies() ignored indexes, which is a poor
decision because an expression index could have a stored column of
a composite (or other container) type even when the underlying table
does not.  Teach it to detect such cases and error out.  We have to
work a bit harder than for other relations because the pg_depend entry
won't identify the specific index column of concern, but it's not much
new code.

This does not address bug #17872's original complaint that dropping
a column in such a type might lead to violations of the uniqueness
property that a unique index is supposed to ensure.  That seems of
much less concern to me because it won't lead to crashes.

Per bug #17872 from Alexander Lakhin.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/17872-d0fbb799dc3fd85d@postgresql.org

Branch
------
master

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

Modified Files
--------------
src/backend/commands/tablecmds.c          | 56 ++++++++++++++++++++++++++-----
src/test/regress/expected/alter_table.out | 10 +++++-
src/test/regress/sql/alter_table.sql      | 11 +++++-
3 files changed, 67 insertions(+), 10 deletions(-)



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

* pgsql: Reject attempts to alter composite types used in indexes.
@ 2023-03-27 19:04  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2023-03-27 19:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Reject attempts to alter composite types used in indexes.

find_composite_type_dependencies() ignored indexes, which is a poor
decision because an expression index could have a stored column of
a composite (or other container) type even when the underlying table
does not.  Teach it to detect such cases and error out.  We have to
work a bit harder than for other relations because the pg_depend entry
won't identify the specific index column of concern, but it's not much
new code.

This does not address bug #17872's original complaint that dropping
a column in such a type might lead to violations of the uniqueness
property that a unique index is supposed to ensure.  That seems of
much less concern to me because it won't lead to crashes.

Per bug #17872 from Alexander Lakhin.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/17872-d0fbb799dc3fd85d@postgresql.org

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/78838bc3d43d3557f1027b95b1961b943d8c0980

Modified Files
--------------
src/backend/commands/tablecmds.c          | 57 +++++++++++++++++++++++++++----
src/test/regress/expected/alter_table.out | 10 +++++-
src/test/regress/sql/alter_table.sql      | 11 +++++-
3 files changed, 70 insertions(+), 8 deletions(-)



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

* pgsql: Reject attempts to alter composite types used in indexes.
@ 2023-03-27 19:04  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2023-03-27 19:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Reject attempts to alter composite types used in indexes.

find_composite_type_dependencies() ignored indexes, which is a poor
decision because an expression index could have a stored column of
a composite (or other container) type even when the underlying table
does not.  Teach it to detect such cases and error out.  We have to
work a bit harder than for other relations because the pg_depend entry
won't identify the specific index column of concern, but it's not much
new code.

This does not address bug #17872's original complaint that dropping
a column in such a type might lead to violations of the uniqueness
property that a unique index is supposed to ensure.  That seems of
much less concern to me because it won't lead to crashes.

Per bug #17872 from Alexander Lakhin.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/17872-d0fbb799dc3fd85d@postgresql.org

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/334cc4c966b27a5e7cad0a4892ad9fba9a0854ed

Modified Files
--------------
src/backend/commands/tablecmds.c          | 57 ++++++++++++++++++++++++++-----
src/test/regress/expected/alter_table.out | 10 +++++-
src/test/regress/sql/alter_table.sql      | 11 +++++-
3 files changed, 68 insertions(+), 10 deletions(-)



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

* pgsql: Reject attempts to alter composite types used in indexes.
@ 2023-03-27 19:04  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2023-03-27 19:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Reject attempts to alter composite types used in indexes.

find_composite_type_dependencies() ignored indexes, which is a poor
decision because an expression index could have a stored column of
a composite (or other container) type even when the underlying table
does not.  Teach it to detect such cases and error out.  We have to
work a bit harder than for other relations because the pg_depend entry
won't identify the specific index column of concern, but it's not much
new code.

This does not address bug #17872's original complaint that dropping
a column in such a type might lead to violations of the uniqueness
property that a unique index is supposed to ensure.  That seems of
much less concern to me because it won't lead to crashes.

Per bug #17872 from Alexander Lakhin.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/17872-d0fbb799dc3fd85d@postgresql.org

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/29a20ff0617ab60acbb8d71b6b59f9035c86a4f8

Modified Files
--------------
src/backend/commands/tablecmds.c          | 57 ++++++++++++++++++++++++++-----
src/test/regress/expected/alter_table.out | 10 +++++-
src/test/regress/sql/alter_table.sql      | 11 +++++-
3 files changed, 68 insertions(+), 10 deletions(-)



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

* pgsql: Reject attempts to alter composite types used in indexes.
@ 2023-03-27 19:04  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2023-03-27 19:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Reject attempts to alter composite types used in indexes.

find_composite_type_dependencies() ignored indexes, which is a poor
decision because an expression index could have a stored column of
a composite (or other container) type even when the underlying table
does not.  Teach it to detect such cases and error out.  We have to
work a bit harder than for other relations because the pg_depend entry
won't identify the specific index column of concern, but it's not much
new code.

This does not address bug #17872's original complaint that dropping
a column in such a type might lead to violations of the uniqueness
property that a unique index is supposed to ensure.  That seems of
much less concern to me because it won't lead to crashes.

Per bug #17872 from Alexander Lakhin.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/17872-d0fbb799dc3fd85d@postgresql.org

Branch
------
REL_15_STABLE

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

Modified Files
--------------
src/backend/commands/tablecmds.c          | 56 ++++++++++++++++++++++++++-----
src/test/regress/expected/alter_table.out | 10 +++++-
src/test/regress/sql/alter_table.sql      | 11 +++++-
3 files changed, 67 insertions(+), 10 deletions(-)



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

* pgsql: Reject attempts to alter composite types used in indexes.
@ 2023-03-27 19:04  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2023-03-27 19:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Reject attempts to alter composite types used in indexes.

find_composite_type_dependencies() ignored indexes, which is a poor
decision because an expression index could have a stored column of
a composite (or other container) type even when the underlying table
does not.  Teach it to detect such cases and error out.  We have to
work a bit harder than for other relations because the pg_depend entry
won't identify the specific index column of concern, but it's not much
new code.

This does not address bug #17872's original complaint that dropping
a column in such a type might lead to violations of the uniqueness
property that a unique index is supposed to ensure.  That seems of
much less concern to me because it won't lead to crashes.

Per bug #17872 from Alexander Lakhin.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/17872-d0fbb799dc3fd85d@postgresql.org

Branch
------
REL_12_STABLE

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

Modified Files
--------------
src/backend/commands/tablecmds.c          | 57 ++++++++++++++++++++++++++-----
src/test/regress/expected/alter_table.out | 10 +++++-
src/test/regress/sql/alter_table.sql      | 11 +++++-
3 files changed, 68 insertions(+), 10 deletions(-)



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


end of thread, other threads:[~2023-03-27 19:04 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-03-27 19:04 pgsql: Reject attempts to alter composite types used in indexes. Tom Lane <tgl@sss.pgh.pa.us>
2023-03-27 19:04 pgsql: Reject attempts to alter composite types used in indexes. Tom Lane <tgl@sss.pgh.pa.us>
2023-03-27 19:04 pgsql: Reject attempts to alter composite types used in indexes. Tom Lane <tgl@sss.pgh.pa.us>
2023-03-27 19:04 pgsql: Reject attempts to alter composite types used in indexes. Tom Lane <tgl@sss.pgh.pa.us>
2023-03-27 19:04 pgsql: Reject attempts to alter composite types used in indexes. Tom Lane <tgl@sss.pgh.pa.us>
2023-03-27 19:04 pgsql: Reject attempts to alter composite types used in indexes. 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