Re: [GENERAL] Exclusion constraints with time expressions

2012-11-17 Thread Jasen Betts
On 2012-11-06, Albe Laurenz laurenz.a...@wien.gv.at wrote: hari.fu...@gmail.com wrote: I think the problem is that this + operator is implemented by the function timestamptz_pl_interval, which is STABLE but not IMMUTABLE. I am not sure why this function cannot be IMMUTABLE, it seems

Re: [GENERAL] Exclusion constraints with time expressions

2012-11-17 Thread Jasen Betts
On 2012-11-06, Kevin Grittner kgri...@mail.com wrote: For TIMESTAMP WITHOUT TIME ZONE it couldn't be IMMUTABLE, because the result would be based on the time zone setting of the client connection; but adding a fixed interval to a UTC time to get a UTC time seems pretty immutable to me. That

Re: [GENERAL] Exclusion constraints with time expressions

2012-11-17 Thread Jasen Betts
On 2012-11-06, Kevin Grittner kgri...@mail.com wrote: hari.fu...@gmail.com No: the result of e.g.  SELECT TIMESTAMPTZ '2012-10-28 01:30:00' + INTERVAL '24 hours'; depends on the client's timezone and its DST rules. Can you give an example of where adding an interval based on *hours* to

Re: [GENERAL] Exclusion constraints with time expressions

2012-11-06 Thread Albe Laurenz
Thomas Munro wrote: I am using 9.1.6, and I've set up a partitioned table as described in the manual, with partitions based on a timestamptz column called 'time'. The exclusion constraints work nicely when I select ranges of times with literal constants. But why would a WHERE clause like the

Re: [GENERAL] Exclusion constraints with time expressions

2012-11-06 Thread hari . fuchs
Albe Laurenz laurenz.a...@wien.gv.at writes: I think the problem is that this + operator is implemented by the function timestamptz_pl_interval, which is STABLE but not IMMUTABLE. I am not sure why this function cannot be IMMUTABLE, it seems to me that it should be. No: the result of e.g.

Re: [GENERAL] Exclusion constraints with time expressions

2012-11-06 Thread Albe Laurenz
hari.fu...@gmail.com wrote: I think the problem is that this + operator is implemented by the function timestamptz_pl_interval, which is STABLE but not IMMUTABLE. I am not sure why this function cannot be IMMUTABLE, it seems to me that it should be. No: the result of e.g.

Re: [GENERAL] Exclusion constraints with time expressions

2012-11-06 Thread Kevin Grittner
hari.fu...@gmail.com No: the result of e.g.  SELECT TIMESTAMPTZ '2012-10-28 01:30:00' + INTERVAL '24 hours'; depends on the client's timezone and its DST rules. Can you give an example of where adding an interval based on *hours* to TIMESTAMP WITH TIME ZONE would give a different value

Re: [GENERAL] Exclusion constraints with time expressions

2012-11-06 Thread Kevin Grittner
Albe Laurenz wrote: Thomas Munro wrote: I am using 9.1.6, and I've set up a partitioned table as described in the manual, with partitions based on a timestamptz column called 'time'. The exclusion constraints work nicely when I select ranges of times with literal constants. But why would a

Re: [GENERAL] Exclusion constraints with time expressions

2012-11-06 Thread Tom Lane
Kevin Grittner kgri...@mail.com writes: Now, if you wanted to argue that *this* query might depend on time zone information, I'd be more willing to believe it, and maybe the problem is that we use the same function for both: SELECT TIMESTAMPTZ '2012-10-28 01:30:00' + INTERVAL '1 day'; The

[GENERAL] Exclusion constraints with time expressions

2012-11-05 Thread Thomas Munro
Hi I am using 9.1.6, and I've set up a partitioned table as described in the manual, with partitions based on a timestamptz column called 'time'. The exclusion constraints work nicely when I select ranges of times with literal constants. But why would a WHERE clause like the following not