pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix unexpected error messages for various flavors of ALTER TABLE 4+ messages / 1 participants [nested] [flat]
* pgsql: Fix unexpected error messages for various flavors of ALTER TABLE @ 2021-07-14 08:16 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 4+ messages in thread From: Michael Paquier @ 2021-07-14 08:16 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix unexpected error messages for various flavors of ALTER TABLE Some commands of ALTER TABLE could fail with the following error: ERROR: "tab" is of the wrong type This error is unexpected, as all the code paths leading to ATWrongRelkindError() should use a supported set of relkinds to generate correct error messages. This commit closes the gap with such mistakes, by adding all the missing relkind combinations. Tests are added to check all the problems found. Note that some combinations are not used, but these are left around as it could have an impact on applications relying on this code. 2ed532e has done a much larger refactoring on HEAD to make such error messages easier to manage in the long-term, so nothing is needed there. Author: Kyotaro Horiguchi Reviewed-by: Peter Eisentraut, Ahsan Hadi, Michael Paquier Discussion: https://postgr.es/m/20210216.181415.368926598204753659.horikyota.ntt@gmail.com Backpatch-through: 11 Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/0c83eb2e0edb42f54a37fdeac85fb80eb5de2cca Modified Files -------------- src/backend/commands/tablecmds.c | 9 +++++++++ src/test/regress/expected/alter_table.out | 10 ++++++++++ src/test/regress/expected/foreign_data.out | 2 ++ src/test/regress/sql/alter_table.sql | 9 +++++++++ src/test/regress/sql/foreign_data.sql | 1 + 5 files changed, 31 insertions(+) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Fix unexpected error messages for various flavors of ALTER TABLE @ 2021-07-14 08:16 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 4+ messages in thread From: Michael Paquier @ 2021-07-14 08:16 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix unexpected error messages for various flavors of ALTER TABLE Some commands of ALTER TABLE could fail with the following error: ERROR: "tab" is of the wrong type This error is unexpected, as all the code paths leading to ATWrongRelkindError() should use a supported set of relkinds to generate correct error messages. This commit closes the gap with such mistakes, by adding all the missing relkind combinations. Tests are added to check all the problems found. Note that some combinations are not used, but these are left around as it could have an impact on applications relying on this code. 2ed532e has done a much larger refactoring on HEAD to make such error messages easier to manage in the long-term, so nothing is needed there. Author: Kyotaro Horiguchi Reviewed-by: Peter Eisentraut, Ahsan Hadi, Michael Paquier Discussion: https://postgr.es/m/20210216.181415.368926598204753659.horikyota.ntt@gmail.com Backpatch-through: 11 Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/5226243459f11e0029c803674aabfb3bc25192f7 Modified Files -------------- src/backend/commands/tablecmds.c | 9 +++++++++ src/test/regress/expected/alter_table.out | 10 ++++++++++ src/test/regress/expected/foreign_data.out | 2 ++ src/test/regress/sql/alter_table.sql | 9 +++++++++ src/test/regress/sql/foreign_data.sql | 1 + 5 files changed, 31 insertions(+) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Fix unexpected error messages for various flavors of ALTER TABLE @ 2021-07-14 08:16 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 4+ messages in thread From: Michael Paquier @ 2021-07-14 08:16 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix unexpected error messages for various flavors of ALTER TABLE Some commands of ALTER TABLE could fail with the following error: ERROR: "tab" is of the wrong type This error is unexpected, as all the code paths leading to ATWrongRelkindError() should use a supported set of relkinds to generate correct error messages. This commit closes the gap with such mistakes, by adding all the missing relkind combinations. Tests are added to check all the problems found. Note that some combinations are not used, but these are left around as it could have an impact on applications relying on this code. 2ed532e has done a much larger refactoring on HEAD to make such error messages easier to manage in the long-term, so nothing is needed there. Author: Kyotaro Horiguchi Reviewed-by: Peter Eisentraut, Ahsan Hadi, Michael Paquier Discussion: https://postgr.es/m/20210216.181415.368926598204753659.horikyota.ntt@gmail.com Backpatch-through: 11 Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b242e1d239df238d612ad7037a1218cc47c641a4 Modified Files -------------- src/backend/commands/tablecmds.c | 6 ++++++ src/test/regress/expected/alter_table.out | 5 +++++ src/test/regress/expected/foreign_data.out | 2 ++ src/test/regress/sql/alter_table.sql | 5 +++++ src/test/regress/sql/foreign_data.sql | 1 + 5 files changed, 19 insertions(+) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Fix unexpected error messages for various flavors of ALTER TABLE @ 2021-07-14 08:16 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 4+ messages in thread From: Michael Paquier @ 2021-07-14 08:16 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix unexpected error messages for various flavors of ALTER TABLE Some commands of ALTER TABLE could fail with the following error: ERROR: "tab" is of the wrong type This error is unexpected, as all the code paths leading to ATWrongRelkindError() should use a supported set of relkinds to generate correct error messages. This commit closes the gap with such mistakes, by adding all the missing relkind combinations. Tests are added to check all the problems found. Note that some combinations are not used, but these are left around as it could have an impact on applications relying on this code. 2ed532e has done a much larger refactoring on HEAD to make such error messages easier to manage in the long-term, so nothing is needed there. Author: Kyotaro Horiguchi Reviewed-by: Peter Eisentraut, Ahsan Hadi, Michael Paquier Discussion: https://postgr.es/m/20210216.181415.368926598204753659.horikyota.ntt@gmail.com Backpatch-through: 11 Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/85a8c3a4b60f430ba30d58427558f1686251b8b5 Modified Files -------------- src/backend/commands/tablecmds.c | 6 ++++++ src/test/regress/expected/alter_table.out | 5 +++++ src/test/regress/expected/foreign_data.out | 2 ++ src/test/regress/sql/alter_table.sql | 5 +++++ src/test/regress/sql/foreign_data.sql | 1 + 5 files changed, 19 insertions(+) ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2021-07-14 08:16 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2021-07-14 08:16 pgsql: Fix unexpected error messages for various flavors of ALTER TABLE Michael Paquier <michael@paquier.xyz> 2021-07-14 08:16 pgsql: Fix unexpected error messages for various flavors of ALTER TABLE Michael Paquier <michael@paquier.xyz> 2021-07-14 08:16 pgsql: Fix unexpected error messages for various flavors of ALTER TABLE Michael Paquier <michael@paquier.xyz> 2021-07-14 08:16 pgsql: Fix unexpected error messages for various flavors of ALTER TABLE 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