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

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

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [GENERAL] Why extract( ... from timestamp ) is not immutable?
Date: 2012-01-30 18:35:21
Message-ID: 4F26E2E9.50802@agliodbs.com (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers
> preferably I would see extract( epoch from timestamp ) to be really
> immutable, i.e. (in my opinion) it should treat incoming data as UTC
> - for epoch calculation.
> Alternatively - perhaps epoch extraction should be moved to specialized
> function, which would have swapped mutability:

We can't have functions which are immutable or not depending on their
inputs.  That way lies madness.

> get_epoch(timestamptz) would be immutable
> while
> get_epoch(timestamp) would be stable

Well, to_epoch, in order to be consistent with other conversion functions.

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

In response to

Responses

pgsql-hackers by date

Next:From: hubert depesz lubaczewskiDate: 2012-01-30 18:53:51
Subject: Re: [GENERAL] Why extract( ... from timestamp ) is not immutable?
Previous:From: Gilles DaroldDate: 2012-01-30 18:33:53
Subject: Patch pg_is_in_backup()

pgsql-general by date

Next:From: hubert depesz lubaczewskiDate: 2012-01-30 18:53:51
Subject: Re: [GENERAL] Why extract( ... from timestamp ) is not immutable?
Previous:From: Josh BerkusDate: 2012-01-30 18:06:09
Subject: Re: Hot standby off of hot standby?

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