Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
1fd9883f
Commit
1fd9883f
authored
Dec 26, 2009
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Zero-label enums:
Allow enums to be created with zero labels, for use during binary upgrade.
parent
f9845aca
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
12 deletions
+11
-12
doc/src/sgml/ref/create_type.sgml
doc/src/sgml/ref/create_type.sgml
+2
-2
src/backend/parser/gram.y
src/backend/parser/gram.y
+8
-3
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.c
+1
-7
No files found.
doc/src/sgml/ref/create_type.sgml
View file @
1fd9883f
<!--
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/create_type.sgml,v 1.
79 2008/11/30 19:01:29 tgl
Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/create_type.sgml,v 1.
80 2009/12/26 16:55:21 momjian
Exp $
PostgreSQL documentation
PostgreSQL documentation
-->
-->
...
@@ -25,7 +25,7 @@ CREATE TYPE <replaceable class="parameter">name</replaceable> AS
...
@@ -25,7 +25,7 @@ CREATE TYPE <replaceable class="parameter">name</replaceable> AS
( <replaceable class="PARAMETER">attribute_name</replaceable> <replaceable class="PARAMETER">data_type</replaceable> [, ... ] )
( <replaceable class="PARAMETER">attribute_name</replaceable> <replaceable class="PARAMETER">data_type</replaceable> [, ... ] )
CREATE TYPE <replaceable class="parameter">name</replaceable> AS ENUM
CREATE TYPE <replaceable class="parameter">name</replaceable> AS ENUM
(
'<replaceable class="parameter">label</replaceable>' [, ...
] )
(
[ '<replaceable class="parameter">label</replaceable>' [, ... ]
] )
CREATE TYPE <replaceable class="parameter">name</replaceable> (
CREATE TYPE <replaceable class="parameter">name</replaceable> (
INPUT = <replaceable class="parameter">input_function</replaceable>,
INPUT = <replaceable class="parameter">input_function</replaceable>,
...
...
src/backend/parser/gram.y
View file @
1fd9883f
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.
699 2009/12/23 17:41:43 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.
700 2009/12/26 16:55:21 momjian
Exp $
*
*
* HISTORY
* HISTORY
* AUTHOR DATE MAJOR EVENT
* AUTHOR DATE MAJOR EVENT
...
@@ -297,7 +297,7 @@ static TypeName *TableFuncTypeName(List *columns);
...
@@ -297,7 +297,7 @@ static TypeName *TableFuncTypeName(List *columns);
TableFuncElementList opt_type_modifiers
TableFuncElementList opt_type_modifiers
prep_type_clause
prep_type_clause
execute_param_clause using_clause returning_clause
execute_param_clause using_clause returning_clause
enum_val_list table_func_column_list
opt_enum_val_list
enum_val_list table_func_column_list
create_generic_options alter_generic_options
create_generic_options alter_generic_options
relation_expr_list dostmt_opt_list
relation_expr_list dostmt_opt_list
...
@@ -3623,7 +3623,7 @@ DefineStmt:
...
@@ -3623,7 +3623,7 @@ DefineStmt:
n->coldeflist = $6;
n->coldeflist = $6;
$$ = (Node *)n;
$$ = (Node *)n;
}
}
| CREATE TYPE_P any_name AS ENUM_P '(' enum_val_list ')'
| CREATE TYPE_P any_name AS ENUM_P '('
opt_
enum_val_list ')'
{
{
CreateEnumStmt *n = makeNode(CreateEnumStmt);
CreateEnumStmt *n = makeNode(CreateEnumStmt);
n->typeName = $3;
n->typeName = $3;
...
@@ -3715,6 +3715,11 @@ old_aggr_elem: IDENT '=' def_arg
...
@@ -3715,6 +3715,11 @@ old_aggr_elem: IDENT '=' def_arg
}
}
;
;
opt_enum_val_list:
enum_val_list { $$ = $1; }
| /*EMPTY*/ { $$ = NIL; }
;
enum_val_list: Sconst
enum_val_list: Sconst
{ $$ = list_make1(makeString($1)); }
{ $$ = list_make1(makeString($1)); }
| enum_val_list ',' Sconst
| enum_val_list ',' Sconst
...
...
src/bin/pg_dump/pg_dump.c
View file @
1fd9883f
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
* by PostgreSQL
* by PostgreSQL
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.56
1 2009/12/24 22:09:23
momjian Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.56
2 2009/12/26 16:55:21
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -6542,12 +6542,6 @@ dumpEnumType(Archive *fout, TypeInfo *tyinfo)
...
@@ -6542,12 +6542,6 @@ dumpEnumType(Archive *fout, TypeInfo *tyinfo)
check_sql_result
(
res
,
g_conn
,
query
->
data
,
PGRES_TUPLES_OK
);
check_sql_result
(
res
,
g_conn
,
query
->
data
,
PGRES_TUPLES_OK
);
num
=
PQntuples
(
res
);
num
=
PQntuples
(
res
);
/* should be at least 1 value */
if
(
num
==
0
)
{
write_msg
(
NULL
,
"no label definitions found for enum ID %u
\n
"
,
tyinfo
->
dobj
.
catId
.
oid
);
exit_nicely
();
}
/*
/*
* DROP must be fully qualified in case same name appears in pg_catalog.
* DROP must be fully qualified in case same name appears in pg_catalog.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment