Re: date_trunc on date is immutable?

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
Cc: Kian Wright <kian(dot)wright(at)senioreducators(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: date_trunc on date is immutable?
Date: 2009-12-25 14:45:44
Message-ID: 407d949e0912250645x6b083656t1e7c0c6bf65dc514@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Dec 25, 2009 at 1:58 AM, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com> wrote:
> Isn't it the client timezone and not the system timezone that actually
> sets the tz the tstz is set to on retrieval?

It's the GUC:

stark=> set timezone = 'America/Los_Angeles';
SET
stark=> select now();
now
-------------------------------
2009-12-25 06:44:33.238187-08
(1 row)

I'm not sure if and how we initialize the GUC on a new connection
though. It might vary depending on the driver you use too.

--
greg

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2009-12-25 15:56:43 Re: Session based transaction!!
Previous Message Farhan Malik 2009-12-25 14:42:08 Out of space making backup