Re: ISO8601 vs POSIX offset clarification - Mailing list pgsql-general

From rob stone
Subject Re: ISO8601 vs POSIX offset clarification
Date
Msg-id 1512389222.5095.4.camel@gmail.com
Whole thread Raw
In response to Re: ISO8601 vs POSIX offset clarification  (Bharanee Rathna <deepfryed@gmail.com>)
List pgsql-general

On Mon, 2017-12-04 at 14:03 +1100, Bharanee Rathna wrote:
> To be more specific, I expected the output of both these queries to
> be the same.
> 
> # select '2017-12-01 11:00:00 +11:00'::timestamp with time zone at
> time zone '+11:00';
>       timezone       
> ---------------------
>  2017-11-30 13:00:00
> 
> # select '2017-12-01 11:00:00 +11:00'::timestamp with time zone at
> time zone 'Australia/Melbourne';
>       timezone       
> ---------------------
>  2017-12-01 11:00:00
> 
> Cheers
> 


select '2017-12-01 11:00:00 +11:00'::timestamp with time zone at time
zone INTERVAL '+11:00';

Result:-

2017-12-01 11:00:00.0


You need the INTERVAL keyword when using a numeric value instead of a
time zone name. It's in the doco.

The parser ought to throw an error, but it doesn't.
 




pgsql-general by date:

Previous
From: Martin Moore
Date:
Subject: Replication causing publisher node to use excessive cpu over time
Next
From: Jakub Glapa
Date:
Subject: Re: ERROR: too many dynamic shared memory segments