Re: [GENERAL] Exclusion constraints with time expressions

2012-11-17 Thread Jasen Betts
On 2012-11-06, Kevin Grittner 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 T

Re: [GENERAL] Exclusion constraints with time expressions

2012-11-17 Thread Jasen Betts
On 2012-11-06, Kevin Grittner 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 said, I'm not

Re: [GENERAL] Exclusion constraints with time expressions

2012-11-17 Thread Jasen Betts
On 2012-11-06, Albe Laurenz 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 to m

Re: [GENERAL] Exclusion constraints with time expressions

2012-11-06 Thread Tom Lane
"Kevin Grittner" 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 "problem" is

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 wo

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 valu

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

Re: [GENERAL] Exclusion constraints with time expressions

2012-11-06 Thread hari . fuchs
"Albe Laurenz" 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. SELECT TIME

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 th

[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 benefi