Skip to content

Commit e24977f

Browse files
committed
Allow qualified type names in CREATE CAST, DROP CAST. Also allow the
construction 'SETOF type[]' which for some reason was previously overlooked (you'd have to name the array type directly to make it work).
1 parent 7bcc6d9 commit e24977f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/backend/parser/gram.y

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.398 2003/02/03 14:04:24 momjian Exp $
14+
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.399 2003/02/05 20:16:42 tgl Exp $
1515
*
1616
* HISTORY
1717
* AUTHOR DATE MAJOR EVENT
@@ -3229,7 +3229,7 @@ any_operator:
32293229
*
32303230
*****************************************************************************/
32313231

3232-
CreateCastStmt: CREATE CAST '(' ConstTypename AS ConstTypename ')'
3232+
CreateCastStmt: CREATE CAST '(' Typename AS Typename ')'
32333233
WITH FUNCTION function_with_argtypes cast_context
32343234
{
32353235
CreateCastStmt *n = makeNode(CreateCastStmt);
@@ -3239,7 +3239,7 @@ CreateCastStmt: CREATE CAST '(' ConstTypename AS ConstTypename ')'
32393239
n->context = (CoercionContext) $11;
32403240
$$ = (Node *)n;
32413241
}
3242-
| CREATE CAST '(' ConstTypename AS ConstTypename ')'
3242+
| CREATE CAST '(' Typename AS Typename ')'
32433243
WITHOUT FUNCTION cast_context
32443244
{
32453245
CreateCastStmt *n = makeNode(CreateCastStmt);
@@ -3257,7 +3257,7 @@ cast_context: AS IMPLICIT_P { $$ = COERCION_IMPLICIT; }
32573257
;
32583258

32593259

3260-
DropCastStmt: DROP CAST '(' ConstTypename AS ConstTypename ')' opt_drop_behavior
3260+
DropCastStmt: DROP CAST '(' Typename AS Typename ')' opt_drop_behavior
32613261
{
32623262
DropCastStmt *n = makeNode(DropCastStmt);
32633263
n->sourcetype = $4;
@@ -4948,9 +4948,10 @@ Typename: SimpleTypename opt_array_bounds
49484948
$$ = $1;
49494949
$$->arrayBounds = $2;
49504950
}
4951-
| SETOF SimpleTypename
4951+
| SETOF SimpleTypename opt_array_bounds
49524952
{
49534953
$$ = $2;
4954+
$$->arrayBounds = $3;
49544955
$$->setof = TRUE;
49554956
}
49564957
;
@@ -5173,6 +5174,8 @@ Bit: BitWithLength
51735174
}
51745175
;
51755176

5177+
/* ConstBit is like Bit except "BIT" defaults to unspecified length */
5178+
/* See notes for ConstCharacter, which addresses same issue for "CHAR" */
51765179
ConstBit: BitWithLength
51775180
{
51785181
$$ = $1;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy