File tree Expand file tree Collapse file tree 3 files changed +11
-12
lines changed Expand file tree Collapse file tree 3 files changed +11
-12
lines changed Original file line number Diff line number Diff line change 11<!--
2- $PostgreSQL: pgsql/doc/src/sgml/ref/create_type.sgml,v 1.79 2008/11/30 19:01:29 tgl Exp $
2+ $PostgreSQL: pgsql/doc/src/sgml/ref/create_type.sgml,v 1.80 2009/12/26 16:55:21 momjian Exp $
33PostgreSQL documentation
44-->
55
@@ -25,7 +25,7 @@ CREATE TYPE <replaceable class="parameter">name</replaceable> AS
2525 ( <replaceable class="PARAMETER">attribute_name</replaceable> <replaceable class="PARAMETER">data_type</replaceable> [, ... ] )
2626
2727CREATE TYPE <replaceable class="parameter">name</replaceable> AS ENUM
28- ( '<replaceable class="parameter">label</replaceable>' [, ... ] )
28+ ( [ '<replaceable class="parameter">label</replaceable>' [, ... ] ] )
2929
3030CREATE TYPE <replaceable class="parameter">name</replaceable> (
3131 INPUT = <replaceable class="parameter">input_function</replaceable>,
Original file line number Diff line number Diff line change 1111 *
1212 *
1313 * IDENTIFICATION
14- * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.699 2009/12/23 17:41:43 tgl Exp $
14+ * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.700 2009/12/26 16:55:21 momjian Exp $
1515 *
1616 * HISTORY
1717 * AUTHOR DATE MAJOR EVENT
@@ -297,7 +297,7 @@ static TypeName *TableFuncTypeName(List *columns);
297297 TableFuncElementList opt_type_modifiers
298298 prep_type_clause
299299 execute_param_clause using_clause returning_clause
300- enum_val_list table_func_column_list
300+ opt_enum_val_list enum_val_list table_func_column_list
301301 create_generic_options alter_generic_options
302302 relation_expr_list dostmt_opt_list
303303
@@ -3623,7 +3623,7 @@ DefineStmt:
36233623 n->coldeflist = $6 ;
36243624 $$ = (Node *)n;
36253625 }
3626- | CREATE TYPE_P any_name AS ENUM_P ' (' enum_val_list ' )'
3626+ | CREATE TYPE_P any_name AS ENUM_P ' (' opt_enum_val_list ' )'
36273627 {
36283628 CreateEnumStmt *n = makeNode(CreateEnumStmt);
36293629 n->typeName = $3 ;
@@ -3715,6 +3715,11 @@ old_aggr_elem: IDENT '=' def_arg
37153715 }
37163716 ;
37173717
3718+ opt_enum_val_list:
3719+ enum_val_list { $$ = $1 ; }
3720+ | /* EMPTY*/ { $$ = NIL; }
3721+ ;
3722+
37183723enum_val_list: Sconst
37193724 { $$ = list_make1(makeString($1 )); }
37203725 | enum_val_list ' ,' Sconst
Original file line number Diff line number Diff line change 1212 * by PostgreSQL
1313 *
1414 * IDENTIFICATION
15- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.561 2009/12/24 22:09:23 momjian Exp $
15+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.562 2009/12/26 16:55:21 momjian Exp $
1616 *
1717 *-------------------------------------------------------------------------
1818 */
@@ -6542,12 +6542,6 @@ dumpEnumType(Archive *fout, TypeInfo *tyinfo)
65426542 check_sql_result (res , g_conn , query -> data , PGRES_TUPLES_OK );
65436543
65446544 num = PQntuples (res );
6545- /* should be at least 1 value */
6546- if (num == 0 )
6547- {
6548- write_msg (NULL , "no label definitions found for enum ID %u\n" , tyinfo -> dobj .catId .oid );
6549- exit_nicely ();
6550- }
65516545
65526546 /*
65536547 * DROP must be fully qualified in case same name appears in pg_catalog.
You can’t perform that action at this time.
0 commit comments