|
11 | 11 | *
|
12 | 12 | *
|
13 | 13 | * IDENTIFICATION
|
14 |
| - * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.253 2001/09/23 03:39:01 momjian Exp $ |
| 14 | + * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.254 2001/09/28 08:09:09 thomas Exp $ |
15 | 15 | *
|
16 | 16 | * HISTORY
|
17 | 17 | * AUTHOR DATE MAJOR EVENT
|
@@ -259,7 +259,7 @@ static void doNegateFloat(Value *v);
|
259 | 259 | %type <str> opt_charset, opt_collate
|
260 | 260 | %type <str> opt_float
|
261 | 261 | %type <ival> opt_numeric, opt_decimal
|
262 |
| -%type <boolean> opt_varying, opt_timezone |
| 262 | +%type <boolean> opt_varying, opt_timezone, opt_timezone_x |
263 | 263 |
|
264 | 264 | %type <ival> Iconst
|
265 | 265 | %type <str> Sconst, comment_text
|
@@ -4229,10 +4229,16 @@ ConstDatetime: datetime
|
4229 | 4229 | $$->name = xlateSqlType($1);
|
4230 | 4230 | $$->typmod = -1;
|
4231 | 4231 | }
|
4232 |
| - | TIMESTAMP opt_timezone |
| 4232 | + | TIMESTAMP opt_timezone_x |
4233 | 4233 | {
|
4234 | 4234 | $$ = makeNode(TypeName);
|
4235 |
| - $$->name = xlateSqlType("timestamp"); |
| 4235 | + if ($2) |
| 4236 | + $$->name = xlateSqlType("timestamptz"); |
| 4237 | + else |
| 4238 | + $$->name = xlateSqlType("timestamp"); |
| 4239 | + /* XXX the timezone field seems to be unused |
| 4240 | + * - thomas 2001-09-06 |
| 4241 | + */ |
4236 | 4242 | $$->timezone = $2;
|
4237 | 4243 | $$->typmod = -1;
|
4238 | 4244 | }
|
@@ -4263,6 +4269,16 @@ datetime: YEAR_P { $$ = "year"; }
|
4263 | 4269 | | SECOND_P { $$ = "second"; }
|
4264 | 4270 | ;
|
4265 | 4271 |
|
| 4272 | +/* XXX Make the default be WITH TIME ZONE for 7.2 to help with database upgrades |
| 4273 | + * but revert this back to WITHOUT TIME ZONE for 7.3. |
| 4274 | + * Do this by simply reverting opt_timezone_x to opt_timezone - thomas 2001-09-06 |
| 4275 | + */ |
| 4276 | + |
| 4277 | +opt_timezone_x: WITH TIME ZONE { $$ = TRUE; } |
| 4278 | + | WITHOUT TIME ZONE { $$ = FALSE; } |
| 4279 | + | /*EMPTY*/ { $$ = TRUE; } |
| 4280 | + ; |
| 4281 | + |
4266 | 4282 | opt_timezone: WITH TIME ZONE { $$ = TRUE; }
|
4267 | 4283 | | WITHOUT TIME ZONE { $$ = FALSE; }
|
4268 | 4284 | | /*EMPTY*/ { $$ = FALSE; }
|
|
0 commit comments