Re: Why extract( ... from timestamp ) is not immutable?

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: depesz(at)depesz(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Why extract( ... from timestamp ) is not immutable?
Date: 2012-01-26 00:04:44
Message-ID: 201201251604.45680.adrian.klaver@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Wednesday, January 25, 2012 2:46:39 pm hubert depesz lubaczewski wrote:
> On Wed, Jan 25, 2012 at 02:07:40PM -0800, Adrian Klaver wrote:
> > Finally dawned on me. When you use 'at time zone' on a timestamp
> > with tz it strips the tz which then allows the value to be indexed
> > because:
> >
> > -[ RECORD 5
> > ]-------+---------------------------------------------------------------
> > ---------- Schema | pg_catalog
> > Name | date_part
> > Result data type | double precision
> > Argument data types | text, timestamp without time zone
> > Type | normal
> > Volatility | immutable
> > Owner | postgres
> > Language | internal
> > Source code | timestamp_part
> > Description | extract field from timestamp
>
> yes, but it is not correct - the value is actually stable, and not
> immutable.

Alright, because the epoch and timezone* fields do timezone manipulation on the
supplied values. Well learned a lot. Thanks.

>
> Best regards,
>
> depesz

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Leguevaques Alex 2012-01-26 09:22:16 Composite Type : pros and cons
Previous Message hubert depesz lubaczewski 2012-01-25 22:46:39 Re: Why extract( ... from timestamp ) is not immutable?

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2012-01-26 01:17:28 Re: Vacuum rate limit in KBps
Previous Message hubert depesz lubaczewski 2012-01-25 22:46:39 Re: Why extract( ... from timestamp ) is not immutable?