1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-25 12:03:53 +03:00

Support enum data types. Along the way, use macros for the values of

pg_type.typtype whereever practical.  Tom Dunstan, with some kibitzing
from Tom Lane.
This commit is contained in:
Tom Lane
2007-04-02 03:49:42 +00:00
parent a482a3e58b
commit 57690c6803
74 changed files with 2398 additions and 332 deletions

View File

@@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.372 2007/03/27 23:21:09 tgl Exp $
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.373 2007/04/02 03:49:38 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2361,6 +2361,17 @@ _copyCompositeTypeStmt(CompositeTypeStmt *from)
return newnode;
}
static CreateEnumStmt *
_copyCreateEnumStmt(CreateEnumStmt *from)
{
CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
COPY_NODE_FIELD(typename);
COPY_NODE_FIELD(vals);
return newnode;
}
static ViewStmt *
_copyViewStmt(ViewStmt *from)
{
@@ -3312,6 +3323,9 @@ copyObject(void *from)
case T_CompositeTypeStmt:
retval = _copyCompositeTypeStmt(from);
break;
case T_CreateEnumStmt:
retval = _copyCreateEnumStmt(from);
break;
case T_ViewStmt:
retval = _copyViewStmt(from);
break;

View File

@@ -18,7 +18,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.303 2007/03/27 23:21:09 tgl Exp $
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.304 2007/04/02 03:49:38 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1186,6 +1186,15 @@ _equalCompositeTypeStmt(CompositeTypeStmt *a, CompositeTypeStmt *b)
return true;
}
static bool
_equalCreateEnumStmt(CreateEnumStmt *a, CreateEnumStmt *b)
{
COMPARE_NODE_FIELD(typename);
COMPARE_NODE_FIELD(vals);
return true;
}
static bool
_equalViewStmt(ViewStmt *a, ViewStmt *b)
{
@@ -2247,6 +2256,9 @@ equal(void *a, void *b)
case T_CompositeTypeStmt:
retval = _equalCompositeTypeStmt(a, b);
break;
case T_CreateEnumStmt:
retval = _equalCreateEnumStmt(a, b);
break;
case T_ViewStmt:
retval = _equalViewStmt(a, b);
break;