1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-30 21:42:05 +03:00

Rearrange order of operations in heap_create_with_catalog so that if

two transactions create the same table name concurrently, the one that
fails will complain about unique index pg_class_relname_index, rather than
about pg_type_typname_index which'll confuse most people.  Free side
benefit: pg_class.reltype is correctly linked to the pg_type entry now.
It's been zero in all but the preloaded pg_class entries since who knows
when.
This commit is contained in:
Tom Lane
2001-02-12 20:07:21 +00:00
parent d8c4cb740c
commit aa88e59ade
4 changed files with 106 additions and 90 deletions

View File

@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.51 2001/01/24 19:42:52 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.52 2001/02/12 20:07:21 tgl Exp $
*
* DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the
@ -640,6 +640,7 @@ DefineType(char *typeName, List *parameters)
* ----------------
*/
TypeCreate(typeName, /* type name */
InvalidOid, /* preassigned type oid (not done here) */
InvalidOid, /* relation oid (n/a here) */
internalLength, /* internal size */
externalLength, /* external size */
@ -652,7 +653,7 @@ DefineType(char *typeName, List *parameters)
elemName, /* element type name */
defaultValue, /* default type value */
byValue, /* passed by value */
alignment,
alignment, /* required alignment */
storage); /* TOAST strategy */
/* ----------------
@ -663,6 +664,7 @@ DefineType(char *typeName, List *parameters)
shadow_type = makeArrayTypeName(typeName);
TypeCreate(shadow_type, /* type name */
InvalidOid, /* preassigned type oid (not done here) */
InvalidOid, /* relation oid (n/a here) */
-1, /* internal size */
-1, /* external size */