Move autogenerated array types out of the way during ALTER ... RENAME.
Tom Lane <tgl@sss.pgh.pa.us>
Move autogenerated array types out of the way during ALTER ... RENAME. Commit 9aa3c782c added code to allow CREATE TABLE/CREATE TYPE to not fail when the desired type name conflicts with an autogenerated array type, by dint of renaming the array type out of the way. But I (tgl) overlooked that the same case arises in ALTER TABLE/TYPE RENAME. Fix that too. Back-patch to all supported branches. Report and patch by Vik Fearing, modified a bit by me Discussion: https://postgr.es/m/0f4ade49-4f0b-a9a3-c120-7589f01d1eb8@2ndquadrant.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/catalog/pg_type.c | modified | +29 −9 |
| src/test/regress/expected/alter_table.out | modified | +49 −0 |
| src/test/regress/sql/alter_table.sql | modified | +20 −0 |
Discussion
- Renaming a table to an array's autogenerated name 5 messages · 2017-05-25 → 2017-05-26