pgsql: Move autogenerated array types out of the way during ALTER ... R

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Move autogenerated array types out of the way during ALTER ... R
Date: 2017-05-26 19:18:45
Message-ID: E1dEKl3-0008Sc-Fs@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/94aced8cd0e229670877fe5c406a98d9a4f1b92a

Modified Files
--------------
src/backend/catalog/pg_type.c | 38 ++++++++++++++++++------
src/test/regress/expected/alter_table.out | 49 +++++++++++++++++++++++++++++++
src/test/regress/sql/alter_table.sql | 20 +++++++++++++
3 files changed, 98 insertions(+), 9 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2017-05-26 19:37:17 pgsql: Fix typo in pg_dump's support for dumping collations from pre-v1
Previous Message Tom Lane 2017-05-26 16:51:24 pgsql: Fix pg_dump to not emit invalid SQL for an empty operator class.