File tree 3 files changed +11
-12
lines changed
3 files changed +11
-12
lines changed Original file line number Diff line number Diff line change 1
1
<!--
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 $
3
3
PostgreSQL documentation
4
4
-->
5
5
@@ -25,7 +25,7 @@ CREATE TYPE <replaceable class="parameter">name</replaceable> AS
25
25
( <replaceable class="PARAMETER">attribute_name</replaceable> <replaceable class="PARAMETER">data_type</replaceable> [, ... ] )
26
26
27
27
CREATE TYPE <replaceable class="parameter">name</replaceable> AS ENUM
28
- ( '<replaceable class="parameter">label</replaceable>' [, ... ] )
28
+ ( [ '<replaceable class="parameter">label</replaceable>' [, ... ] ] )
29
29
30
30
CREATE TYPE <replaceable class="parameter">name</replaceable> (
31
31
INPUT = <replaceable class="parameter">input_function</replaceable>,
Original file line number Diff line number Diff line change 11
11
*
12
12
*
13
13
* 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 $
15
15
*
16
16
* HISTORY
17
17
* AUTHOR DATE MAJOR EVENT
@@ -297,7 +297,7 @@ static TypeName *TableFuncTypeName(List *columns);
297
297
TableFuncElementList opt_type_modifiers
298
298
prep_type_clause
299
299
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
301
301
create_generic_options alter_generic_options
302
302
relation_expr_list dostmt_opt_list
303
303
@@ -3623,7 +3623,7 @@ DefineStmt:
3623
3623
n->coldeflist = $6 ;
3624
3624
$$ = (Node *)n;
3625
3625
}
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 ' )'
3627
3627
{
3628
3628
CreateEnumStmt *n = makeNode(CreateEnumStmt);
3629
3629
n->typeName = $3 ;
@@ -3715,6 +3715,11 @@ old_aggr_elem: IDENT '=' def_arg
3715
3715
}
3716
3716
;
3717
3717
3718
+ opt_enum_val_list:
3719
+ enum_val_list { $$ = $1 ; }
3720
+ | /* EMPTY*/ { $$ = NIL; }
3721
+ ;
3722
+
3718
3723
enum_val_list: Sconst
3719
3724
{ $$ = list_make1(makeString($1 )); }
3720
3725
| enum_val_list ' ,' Sconst
Original file line number Diff line number Diff line change 12
12
* by PostgreSQL
13
13
*
14
14
* 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 $
16
16
*
17
17
*-------------------------------------------------------------------------
18
18
*/
@@ -6542,12 +6542,6 @@ dumpEnumType(Archive *fout, TypeInfo *tyinfo)
6542
6542
check_sql_result (res , g_conn , query -> data , PGRES_TUPLES_OK );
6543
6543
6544
6544
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
- }
6551
6545
6552
6546
/*
6553
6547
* 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