1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Add support for AT LOCAL

When converting a timestamp to/from with/without time zone, the SQL
Standard specifies an AT LOCAL variant of AT TIME ZONE which uses the
session's time zone.  This includes three system functions able to do
the work in the same way as the existing flavors for AT TIME ZONE,
except that these need to be marked as stable as they depend on the
session's TimeZone GUC.

Bump catalog version.

Author: Vik Fearing
Reviewed-by: Laurenz Albe, Cary Huang, Michael Paquier
Discussion: https://postgr.es/m/8e25dec4-5667-c1a5-6581-167d710c2182@postgresfriends.org
This commit is contained in:
Michael Paquier
2023-10-13 13:01:37 +09:00
parent 0013ba290b
commit 97957fdbaa
11 changed files with 294 additions and 4 deletions

View File

@@ -14508,6 +14508,13 @@ a_expr: c_expr { $$ = $1; }
COERCE_SQL_SYNTAX,
@2);
}
| a_expr AT LOCAL %prec AT
{
$$ = (Node *) makeFuncCall(SystemFuncName("timezone"),
list_make1($1),
COERCE_SQL_SYNTAX,
-1);
}
/*
* These operators must be called out explicitly in order to make use
* of bison's automatic operator-precedence handling. All other