Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2012-01-25, hubert depesz lubaczewski <depesz@xxxxxxxxxx> 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.

it's immutable for all date parts except "epoch".

epoch is backwards to the other date parts.
immutable for timestamptz and stable for timestamp

-- 
⚂⚃ 100% natural


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux