diff options
| author | Tom Lane | 2018-11-14 20:41:07 +0000 |
|---|---|---|
| committer | Tom Lane | 2018-11-14 20:41:07 +0000 |
| commit | 600b04d6b5ef6c9ad3ea684aad40260bd60d5872 (patch) | |
| tree | 042a86af0ea3063ea3aaa75958e4d73e57819381 /src/include | |
| parent | 06c723447b6b8fc7e394cd2ad23785a6e54e36da (diff) | |
Add a timezone-specific variant of date_trunc().
date_trunc(field, timestamptz, zone_name) performs truncation using
the named time zone as reference, rather than working in the session
time zone as is the default behavior. It's equivalent to
date_trunc(field, timestamptz at time zone zone_name) at time zone zone_name
but it's faster, easier to type, and arguably easier to understand.
Vik Fearing and Tom Lane
Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/catalog/catversion.h | 2 | ||||
| -rw-r--r-- | src/include/catalog/pg_proc.dat | 19 |
2 files changed, 13 insertions, 8 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index 7d78cbe026a..a307a2ba767 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 201811061 +#define CATALOG_VERSION_NO 201811141 #endif diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index 4026018ba9d..9264a2e9872 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -2280,6 +2280,10 @@ descr => 'truncate timestamp with time zone to specified units', proname => 'date_trunc', provolatile => 's', prorettype => 'timestamptz', proargtypes => 'text timestamptz', prosrc => 'timestamptz_trunc' }, +{ oid => '1284', + descr => 'truncate timestamp with time zone to specified units in specified time zone', + proname => 'date_trunc', provolatile => 's', prorettype => 'timestamptz', + proargtypes => 'text timestamptz text', prosrc => 'timestamptz_trunc_zone' }, { oid => '1218', descr => 'truncate interval to specified units', proname => 'date_trunc', prorettype => 'interval', proargtypes => 'text interval', prosrc => 'interval_trunc' }, @@ -5825,8 +5829,8 @@ prorettype => 'timestamptz', proargtypes => '', prosrc => 'pg_backup_start_time' }, { oid => '3436', descr => 'promote standby server', - proname => 'pg_promote', provolatile => 'v', - prorettype => 'bool', proargtypes => 'bool int4', proargnames => '{wait,wait_seconds}', + proname => 'pg_promote', provolatile => 'v', prorettype => 'bool', + proargtypes => 'bool int4', proargnames => '{wait,wait_seconds}', prosrc => 'pg_promote' }, { oid => '2848', descr => 'switch to new wal file', proname => 'pg_switch_wal', provolatile => 'v', prorettype => 'pg_lsn', @@ -10007,10 +10011,11 @@ proallargtypes => '{text,int8,timestamptz}', proargmodes => '{o,o,o}', proargnames => '{name,size,modification}', prosrc => 'pg_ls_waldir' }, { oid => '5031', descr => 'list of files in the archive_status directory', - proname => 'pg_ls_archive_statusdir', procost => '10', prorows => '20', proretset => 't', - provolatile => 'v', prorettype => 'record', proargtypes => '', - proallargtypes => '{text,int8,timestamptz}', proargmodes => '{o,o,o}', - proargnames => '{name,size,modification}', prosrc => 'pg_ls_archive_statusdir' }, + proname => 'pg_ls_archive_statusdir', procost => '10', prorows => '20', + proretset => 't', provolatile => 'v', prorettype => 'record', + proargtypes => '', proallargtypes => '{text,int8,timestamptz}', + proargmodes => '{o,o,o}', proargnames => '{name,size,modification}', + prosrc => 'pg_ls_archive_statusdir' }, { oid => '5029', descr => 'list files in the pgsql_tmp directory', proname => 'pg_ls_tmpdir', procost => '10', prorows => '20', proretset => 't', provolatile => 'v', prorettype => 'record', proargtypes => '', @@ -10036,6 +10041,6 @@ proallargtypes => '{regclass,regclass,regclass,bool,int4}', proargmodes => '{i,o,o,o,o}', proargnames => '{rootrelid,relid,parentrelid,isleaf,level}', - prosrc => 'pg_partition_tree' } + prosrc => 'pg_partition_tree' }, ] |
