Fix the problem that creating a user-defined type named _foo, followed by one
Tom Lane <tgl@sss.pgh.pa.us>
Fix the problem that creating a user-defined type named _foo, followed by one named foo, would work but the other ordering would not. If a user-specified type or table name collides with an existing auto-generated array name, just rename the array type out of the way by prepending more underscores. This should not create any backward-compatibility issues, since the cases in which this will happen would have failed outright in prior releases. Also fix an oversight in the arrays-of-composites patch: ALTER TABLE RENAME renamed the table's rowtype but not its array type.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/ref/create_type.sgml | modified | +22 −13 |
| src/backend/catalog/heap.c | modified | +26 −3 |
| src/backend/catalog/pg_type.c | modified | +96 −16 |
| src/backend/commands/tablecmds.c | modified | +7 −5 |
| src/backend/commands/typecmds.c | modified | +51 −3 |
| src/include/catalog/pg_type.h | modified | +6 −3 |
| src/test/regress/expected/arrays.out | modified | +23 −0 |
| src/test/regress/sql/arrays.sql | modified | +20 −0 |