/pgpatches/enum_opt
text/x-diff
Filename: /pgpatches/enum_opt
Type: text/x-diff
Part: 0
Message:
Re: Removing pg_migrator limitations
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: context
| File | + | − |
|---|---|---|
| doc/src/sgml/ref/create_type.sgml | 1 | 1 |
| src/backend/parser/gram.y | 7 | 2 |
Index: doc/src/sgml/ref/create_type.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/ref/create_type.sgml,v
retrieving revision 1.79
diff -c -c -r1.79 create_type.sgml
*** doc/src/sgml/ref/create_type.sgml 30 Nov 2008 19:01:29 -0000 1.79
--- doc/src/sgml/ref/create_type.sgml 25 Dec 2009 06:15:56 -0000
***************
*** 25,31 ****
( <replaceable class="PARAMETER">attribute_name</replaceable> <replaceable class="PARAMETER">data_type</replaceable> [, ... ] )
CREATE TYPE <replaceable class="parameter">name</replaceable> AS ENUM
! ( '<replaceable class="parameter">label</replaceable>' [, ... ] )
CREATE TYPE <replaceable class="parameter">name</replaceable> (
INPUT = <replaceable class="parameter">input_function</replaceable>,
--- 25,31 ----
( <replaceable class="PARAMETER">attribute_name</replaceable> <replaceable class="PARAMETER">data_type</replaceable> [, ... ] )
CREATE TYPE <replaceable class="parameter">name</replaceable> AS ENUM
! ( [ '<replaceable class="parameter">label</replaceable>' [, ... ] ] )
CREATE TYPE <replaceable class="parameter">name</replaceable> (
INPUT = <replaceable class="parameter">input_function</replaceable>,
Index: src/backend/parser/gram.y
===================================================================
RCS file: /cvsroot/pgsql/src/backend/parser/gram.y,v
retrieving revision 2.699
diff -c -c -r2.699 gram.y
*** src/backend/parser/gram.y 23 Dec 2009 17:41:43 -0000 2.699
--- src/backend/parser/gram.y 25 Dec 2009 06:15:56 -0000
***************
*** 297,303 ****
TableFuncElementList opt_type_modifiers
prep_type_clause
execute_param_clause using_clause returning_clause
! enum_val_list table_func_column_list
create_generic_options alter_generic_options
relation_expr_list dostmt_opt_list
--- 297,303 ----
TableFuncElementList opt_type_modifiers
prep_type_clause
execute_param_clause using_clause returning_clause
! opt_enum_val_list enum_val_list table_func_column_list
create_generic_options alter_generic_options
relation_expr_list dostmt_opt_list
***************
*** 3623,3629 ****
n->coldeflist = $6;
$$ = (Node *)n;
}
! | CREATE TYPE_P any_name AS ENUM_P '(' enum_val_list ')'
{
CreateEnumStmt *n = makeNode(CreateEnumStmt);
n->typeName = $3;
--- 3623,3629 ----
n->coldeflist = $6;
$$ = (Node *)n;
}
! | CREATE TYPE_P any_name AS ENUM_P '(' opt_enum_val_list ')'
{
CreateEnumStmt *n = makeNode(CreateEnumStmt);
n->typeName = $3;
***************
*** 3715,3720 ****
--- 3715,3725 ----
}
;
+ opt_enum_val_list:
+ enum_val_list { $$ = $1; }
+ | /*EMPTY*/ { $$ = NIL; }
+ ;
+
enum_val_list: Sconst
{ $$ = list_make1(makeString($1)); }
| enum_val_list ',' Sconst