[GENERAL] Per-query local timezone

2011-06-14 Thread Mark Morgan Lloyd
Is it possible to incorporate SET TIMEZONE into a query, so that to_char(...'TZ') etc. is appropriately localised? The development environment I'm working with uses short-lifetime sessions, and it's proving difficult to get a set command and a query associated with the same handle. -- Mark

Re: [GENERAL] Per-query local timezone

2011-06-14 Thread Karsten Hilbert
On Tue, Jun 14, 2011 at 09:40:20AM +, Mark Morgan Lloyd wrote: Is it possible to incorporate SET TIMEZONE into a query, so that to_char(...'TZ') etc. is appropriately localised? You seem to want AT TIME ZONE. Karsten -- GPG key ID E4071346 @ gpg-keyserver.de E167 67FD A291 2BEA 73BD

Re: [GENERAL] Per-query local timezone

2011-06-14 Thread John R Pierce
On 06/14/11 2:40 AM, Mark Morgan Lloyd wrote: The development environment I'm working with uses short-lifetime sessions, and it's proving difficult to get a set command and a query associated with the same handle. this environment doesn't support even a transaction? -- john r pierce

Re: [GENERAL] Per-query local timezone

2011-06-14 Thread Mark Morgan Lloyd
Karsten Hilbert wrote: On Tue, Jun 14, 2011 at 09:40:20AM +, Mark Morgan Lloyd wrote: Is it possible to incorporate SET TIMEZONE into a query, so that to_char(...'TZ') etc. is appropriately localised? You seem to want AT TIME ZONE. Thanks for that. How can I do /this/ select

Re: [GENERAL] Per-query local timezone

2011-06-14 Thread Tom Lane
John R Pierce pie...@hogranch.com writes: On 06/14/11 2:40 AM, Mark Morgan Lloyd wrote: The development environment I'm working with uses short-lifetime sessions, and it's proving difficult to get a set command and a query associated with the same handle. this environment doesn't support

Re: [GENERAL] Per-query local timezone

2011-06-14 Thread Steve Crawford
On 06/14/2011 05:13 AM, Mark Morgan Lloyd wrote: Karsten Hilbert wrote: On Tue, Jun 14, 2011 at 09:40:20AM +, Mark Morgan Lloyd wrote: Is it possible to incorporate SET TIMEZONE into a query, so that to_char(...'TZ') etc. is appropriately localised? You seem to want AT TIME ZONE.

Re: [GENERAL] Per-query local timezone

2011-06-14 Thread Mark Morgan Lloyd
Tom Lane wrote: John R Pierce pie...@hogranch.com writes: On 06/14/11 2:40 AM, Mark Morgan Lloyd wrote: The development environment I'm working with uses short-lifetime sessions, and it's proving difficult to get a set command and a query associated with the same handle. this environment

Re: [GENERAL] Per-query local timezone

2011-06-14 Thread Mark Morgan Lloyd
Steve Crawford wrote: On 06/14/2011 05:13 AM, Mark Morgan Lloyd wrote: Karsten Hilbert wrote: On Tue, Jun 14, 2011 at 09:40:20AM +, Mark Morgan Lloyd wrote: Is it possible to incorporate SET TIMEZONE into a query, so that to_char(...'TZ') etc. is appropriately localised? You seem to