Commit 3e20a726 authored by Peter Eisentraut's avatar Peter Eisentraut

Make all valid uses of the COLLATE clause yield the same result: a syntax

error.  There is no point in providing some kind of forward compatibility
now, because no one can tell what a future implementation will look like.
parent 4060f075
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.430 2003/08/22 20:34:33 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.431 2003/09/06 14:01:51 petere Exp $
* *
* HISTORY * HISTORY
* AUTHOR DATE MAJOR EVENT * AUTHOR DATE MAJOR EVENT
...@@ -294,7 +294,7 @@ static void doNegateFloat(Value *v); ...@@ -294,7 +294,7 @@ static void doNegateFloat(Value *v);
Bit ConstBit BitWithLength BitWithoutLength Bit ConstBit BitWithLength BitWithoutLength
%type <str> character %type <str> character
%type <str> extract_arg %type <str> extract_arg
%type <str> opt_charset opt_collate %type <str> opt_charset
%type <ival> opt_numeric opt_decimal %type <ival> opt_numeric opt_decimal
%type <boolean> opt_varying opt_timezone %type <boolean> opt_varying opt_timezone
...@@ -441,7 +441,6 @@ static void doNegateFloat(Value *v); ...@@ -441,7 +441,6 @@ static void doNegateFloat(Value *v);
%right UMINUS %right UMINUS
%left '[' ']' %left '[' ']'
%left '(' ')' %left '(' ')'
%left COLLATE
%left TYPECAST %left TYPECAST
%left '.' %left '.'
/* /*
...@@ -1461,19 +1460,13 @@ TableElement: ...@@ -1461,19 +1460,13 @@ TableElement:
| TableConstraint { $$ = $1; } | TableConstraint { $$ = $1; }
; ;
columnDef: ColId Typename ColQualList opt_collate columnDef: ColId Typename ColQualList
{ {
ColumnDef *n = makeNode(ColumnDef); ColumnDef *n = makeNode(ColumnDef);
n->colname = $1; n->colname = $1;
n->typename = $2; n->typename = $2;
n->constraints = $3; n->constraints = $3;
n->is_local = true; n->is_local = true;
if ($4 != NULL)
ereport(NOTICE,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("CREATE TABLE / COLLATE is not yet implemented; clause ignored")));
$$ = (Node *)n; $$ = (Node *)n;
} }
; ;
...@@ -3843,17 +3836,12 @@ DropdbStmt: DROP DATABASE database_name ...@@ -3843,17 +3836,12 @@ DropdbStmt: DROP DATABASE database_name
*****************************************************************************/ *****************************************************************************/
CreateDomainStmt: CreateDomainStmt:
CREATE DOMAIN_P any_name opt_as Typename ColQualList opt_collate CREATE DOMAIN_P any_name opt_as Typename ColQualList
{ {
CreateDomainStmt *n = makeNode(CreateDomainStmt); CreateDomainStmt *n = makeNode(CreateDomainStmt);
n->domainname = $3; n->domainname = $3;
n->typename = $5; n->typename = $5;
n->constraints = $6; n->constraints = $6;
if ($7 != NULL)
ereport(NOTICE,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("CREATE DOMAIN / COLLATE is not yet implemented; clause ignored")));
$$ = (Node *)n; $$ = (Node *)n;
} }
; ;
...@@ -5463,11 +5451,6 @@ opt_charset: ...@@ -5463,11 +5451,6 @@ opt_charset:
| /*EMPTY*/ { $$ = NULL; } | /*EMPTY*/ { $$ = NULL; }
; ;
opt_collate:
COLLATE ColId { $$ = $2; }
| /*EMPTY*/ { $$ = NULL; }
;
ConstDatetime: ConstDatetime:
TIMESTAMP '(' Iconst ')' opt_timezone TIMESTAMP '(' Iconst ')' opt_timezone
{ {
...@@ -5753,15 +5736,6 @@ qual_all_Op: ...@@ -5753,15 +5736,6 @@ qual_all_Op:
a_expr: c_expr { $$ = $1; } a_expr: c_expr { $$ = $1; }
| a_expr TYPECAST Typename | a_expr TYPECAST Typename
{ $$ = makeTypeCast($1, $3); } { $$ = makeTypeCast($1, $3); }
| a_expr COLLATE ColId
{
FuncCall *n = makeNode(FuncCall);
n->funcname = SystemFuncName($3);
n->args = makeList1($1);
n->agg_star = FALSE;
n->agg_distinct = FALSE;
$$ = (Node *) n;
}
| a_expr AT TIME ZONE c_expr | a_expr AT TIME ZONE c_expr
{ {
FuncCall *n = makeNode(FuncCall); FuncCall *n = makeNode(FuncCall);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment