11
11
*
12
12
*
13
13
* IDENTIFICATION
14
- * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.179 2000/07/15 00:01:41 tgl Exp $
14
+ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.180 2000/07/28 14:47:23 thomas Exp $
15
15
*
16
16
* HISTORY
17
17
* AUTHORDATEMAJOR EVENT
@@ -251,8 +251,8 @@ static void doNegateFloat(Value *v);
251
251
%type <paramno> ParamNo
252
252
253
253
%type <typnam> Typename ,SimpleTypename ,ConstTypename
254
- Generic ,Numeric ,Character ,ConstDatetime ,ConstInterval ,Bit
255
- %type <str> typename ,generic ,numeric ,character ,datetime ,bit
254
+ Generic ,Numeric ,Geometric , Character ,ConstDatetime ,ConstInterval ,Bit
255
+ %type <str> typename ,generic ,numeric ,geometric , character ,datetime ,bit
256
256
%type <str> extract_arg
257
257
%type <str> opt_charset ,opt_collate
258
258
%type <str> opt_float
@@ -1864,11 +1864,7 @@ def_type: OPERATOR{ $$ = OPERATOR; }
1864
1864
def_name :PROCEDURE {$$ =" procedure" ; }
1865
1865
| JOIN {$$ =" join" ; }
1866
1866
| all_Op {$$ =$1 ; }
1867
- | typename {$$ =$1 ; }
1868
- | TokenId {$$ =$1 ; }
1869
- | INTERVAL {$$ =" interval" ; }
1870
- | TIME {$$ =" time" ; }
1871
- | TIMESTAMP {$$ =" timestamp" ; }
1867
+ | ColId {$$ =$1 ; }
1872
1868
;
1873
1869
1874
1870
definition :' (' def_list ' )' {$$ =$2 ; }
@@ -2361,18 +2357,21 @@ index_elem: attr_name opt_class
2361
2357
}
2362
2358
;
2363
2359
2364
- opt_class :class {
2365
- /*
2366
- * Release 7.0 removed network_ops, timespan_ops, and datetime_ops,
2367
- * so we suppress it from being passed to the backend so the default
2368
- * *_ops is used. This can be removed in some later release.
2369
- * bjm 2000/02/07
2370
- */
2371
- if (strcmp($1 ," network_ops" ) !=0 &&
2372
- strcmp ($1 ," timespan_ops" ) != 0 &&
2373
- strcmp($1 ," datetime_ops" ) != 0)
2374
- $$ = $1;
2375
- else $$ =NULL ; }
2360
+ opt_class :class
2361
+ {
2362
+ /*
2363
+ * Release 7.0 removed network_ops, timespan_ops, and datetime_ops,
2364
+ * so we suppress it from being passed to the backend so the default
2365
+ * *_ops is used. This can be removed in some later release.
2366
+ * bjm 2000/02/07
2367
+ */
2368
+ if (strcmp($1 ," network_ops" ) !=0 &&
2369
+ strcmp ($1 ," timespan_ops" ) != 0 &&
2370
+ strcmp($1 ," datetime_ops" ) != 0)
2371
+ $$ = $1;
2372
+ else
2373
+ $$ =NULL ;
2374
+ }
2376
2375
| USING class {$$ =$2 ; }
2377
2376
| /* EMPTY*/ {$$ =NULL ; }
2378
2377
;
@@ -2465,21 +2464,23 @@ func_args_list: func_arg
2465
2464
* so that won't work here. The only thing we give up is array notation,
2466
2465
* which isn't meaningful in this context anyway.
2467
2466
* - thomas 2000-03-25
2468
- */
2469
- func_arg :opt_arg TokenId SimpleTypename
2467
+ * The following productions are difficult, since it is difficult to
2468
+ * distinguish between TokenId and SimpleTypename:
2469
+ opt_arg TokenId SimpleTypename
2470
2470
{
2471
- /* We can catch over-specified arguments here if we want to,
2472
- * but for now better to silently swallow typmod, etc.
2473
- * - thomas 2000-03-22
2474
- */
2475
2471
$$ = $3;
2476
2472
}
2477
- | opt_arg SimpleTypename
2473
+ |TokenId SimpleTypename
2478
2474
{
2479
2475
$$ = $2;
2480
2476
}
2481
- | TokenId SimpleTypename
2477
+ */
2478
+ func_arg :opt_arg SimpleTypename
2482
2479
{
2480
+ /* We can catch over-specified arguments here if we want to,
2481
+ * but for now better to silently swallow typmod, etc.
2482
+ * - thomas 2000-03-22
2483
+ */
2483
2484
$$ =$2 ;
2484
2485
}
2485
2486
| SimpleTypename
@@ -3964,13 +3965,15 @@ SimpleTypename: ConstTypename
3964
3965
3965
3966
ConstTypename :Generic
3966
3967
| Numeric
3968
+ | Geometric
3967
3969
| Bit
3968
3970
| Character
3969
3971
| ConstDatetime
3970
3972
;
3971
3973
3972
3974
typename :generic {$$ =$1 ; }
3973
3975
| numeric {$$ =$1 ; }
3976
+ | geometric {$$ =$1 ; }
3974
3977
| bit {$$ =$1 ; }
3975
3978
| character {$$ =$1 ; }
3976
3979
| datetime {$$ =$1 ; }
@@ -3985,7 +3988,6 @@ Generic: generic
3985
3988
;
3986
3989
3987
3990
generic :IDENT {$$ =$1 ; }
3988
- | PATH_P {$$ =" path" ; }
3989
3991
| TYPE_P {$$ =" type" ; }
3990
3992
;
3991
3993
@@ -4033,6 +4035,17 @@ numeric: FLOAT{ $$ = xlateSqlType("float"); }
4033
4035
| NUMERIC {$$ = xlateSqlType(" numeric" ); }
4034
4036
;
4035
4037
4038
+ Geometric :PATH_P
4039
+ {
4040
+ $$ = makeNode(TypeName);
4041
+ $$ ->name = xlateSqlType(" path" );
4042
+ $$ ->typmod = -1 ;
4043
+ }
4044
+ ;
4045
+
4046
+ geometric :PATH_P {$$ = xlateSqlType(" path" ); }
4047
+ ;
4048
+
4036
4049
opt_float :' (' Iconst ' )'
4037
4050
{
4038
4051
if ($2 <1 )
@@ -5451,14 +5464,15 @@ UserId: ColId{ $$ = $1; };
5451
5464
* BETWEEN, IN, IS, ISNULL, NOTNULL, OVERLAPS
5452
5465
* Thanks to Tom Lane for pointing this out. - thomas 2000-03-29
5453
5466
*/
5454
- ColId :IDENT {$$ =$1 ; }
5455
- | TokenId {$$ =$1 ; }
5467
+ ColId :generic {$$ =$1 ; }
5456
5468
| datetime {$$ =$1 ; }
5469
+ | TokenId {$$ =$1 ; }
5457
5470
| INTERVAL {$$ =" interval" ; }
5458
5471
| NATIONAL {$$ =" national" ; }
5472
+ | PATH_P {$$ =" path" ; }
5473
+ | SERIAL {$$ =" serial" ; }
5459
5474
| TIME {$$ =" time" ; }
5460
5475
| TIMESTAMP {$$ =" timestamp" ; }
5461
- | TYPE_P {$$ =" type" ; }
5462
5476
;
5463
5477
5464
5478
/* Parser tokens to be used as identifiers.
@@ -5553,7 +5567,6 @@ TokenId: ABSOLUTE{ $$ = "absolute"; }
5553
5567
| SCROLL {$$ =" scroll" ; }
5554
5568
| SESSION {$$ =" session" ; }
5555
5569
| SEQUENCE {$$ =" sequence" ; }
5556
- | SERIAL {$$ =" serial" ; }
5557
5570
| SERIALIZABLE {$$ =" serializable" ; }
5558
5571
| SET {$$ =" set" ; }
5559
5572
| SHARE {$$ =" share" ; }
@@ -5680,7 +5693,6 @@ ColLabel: ColId{ $$ = $1; }
5680
5693
| OUT {$$ =" out" ; }
5681
5694
| OUTER_P {$$ =" outer" ; }
5682
5695
| OVERLAPS {$$ =" overlaps" ; }
5683
- | PATH_P {$$ =" path" ; }
5684
5696
| POSITION {$$ =" position" ; }
5685
5697
| PRECISION {$$ =" precision" ; }
5686
5698
| PRIMARY {$$ =" primary" ; }