Skip site navigation (1) Skip section navigation (2)

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

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Why extract( ... from timestamp ) is not immutable?
Date: 2012-01-25 22:46:39
Message-ID: 20120125224639.GB2651@depesz.com (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers
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.

Best regards,

depesz

-- 
The best thing about modern society is how easy it is to avoid contact with it.
                                                             http://depesz.com/

In response to

Responses

pgsql-hackers by date

Next:From: Adrian KlaverDate: 2012-01-26 00:04:44
Subject: Re: Why extract( ... from timestamp ) is not immutable?
Previous:From: Alvaro HerreraDate: 2012-01-25 22:45:15
Subject: Re: Second thoughts on CheckIndexCompatible() vs. operator families

pgsql-general by date

Next:From: Adrian KlaverDate: 2012-01-26 00:04:44
Subject: Re: Why extract( ... from timestamp ) is not immutable?
Previous:From: Adrian KlaverDate: 2012-01-25 22:07:40
Subject: Re: Why extract( ... from timestamp ) is not immutable?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group