Re: [BUGS] timestamp arithmetic

2004-12-16 Thread Tom Lane
"Ed L." <[EMAIL PROTECTED]> writes: > Note the queries below generate the same result regardless of the timezone > input: This isn't a bug. Per documentation: : For timestamp [without time zone], any explicit time zone specified in : the input is silently ignored. That is, the resulting date/ti

[BUGS] timestamp arithmetic

2004-12-16 Thread Ed L.
Note the queries below generate the same result regardless of the timezone input: % env | grep TZ PGTZ=CST6CDT TZ=CST6CDT % psql -t -c "select version()" PostgreSQL 8.0.0beta3 on i686-pc-linux-gnu, compiled by GCC 2.96 % psql -t -c "select '1970-01-01 00:00:00+09'::timestamp + '1089352800 sec

Re: [BUGS] timestamp arithmetic (a possible bug?)

2004-07-02 Thread Tom Lane
Stephan Szabo <[EMAIL PROTECTED]> writes: >>> Should we be providing an interval + timestamp operator as well since it >>> looks like the spec implies both orderings should work? >> >> If you see spec support for it, then yes ... where do you read that >> exactly? > SQL92 (draft) 4.5.3 Operators

Re: [BUGS] timestamp arithmetic (a possible bug?)

2004-07-02 Thread Stephan Szabo
On Fri, 2 Jul 2004, Tom Lane wrote: > Stephan Szabo <[EMAIL PROTECTED]> writes: > > On Fri, 2 Jul 2004, Tom Lane wrote: > >> (There is a timestamp + interval operator, so you could make it work by > >> flipping around the outer addition.) > > > Should we be providing an interval + timestamp opera

Re: [BUGS] timestamp arithmetic (a possible bug?)

2004-07-02 Thread Tom Lane
Stephan Szabo <[EMAIL PROTECTED]> writes: > On Fri, 2 Jul 2004, Tom Lane wrote: >> (There is a timestamp + interval operator, so you could make it work by >> flipping around the outer addition.) > Should we be providing an interval + timestamp operator as well since it > looks like the spec implie

Re: [BUGS] timestamp arithmetic (a possible bug?)

2004-07-02 Thread Stephan Szabo
On Fri, 2 Jul 2004, Tom Lane wrote: > Ilir Gashi <[EMAIL PROTECTED]> writes: > > I saw this behaviour in PostgreSQL 7.2. (Once again, I know this is an old > > release but I do not have a newer version installed, and I am only using > > the server for research purposes). If you execute the followi

Re: [BUGS] timestamp arithmetic (a possible bug?)

2004-07-02 Thread Tom Lane
Ilir Gashi <[EMAIL PROTECTED]> writes: > I saw this behaviour in PostgreSQL 7.2. (Once again, I know this is an old > release but I do not have a newer version installed, and I am only using > the server for research purposes). If you execute the following statement > SELECT (CAST('01.01.2004 10

Re: [BUGS] timestamp arithmetic (a possible bug?)

2004-07-02 Thread Ilir Gashi
On Jul 2 2004, Achilleus Mantzios wrote: SELECT '01.01.2004 10:00:00'::timestamp + ('01.01.2004 10:01:00'::timestamp - '01.01.2004 10:00:00'::timestamp)::interval; ?column? - 2004-01-01 10:01:00 (1 row) works fine in my 7.4.2 Yes. I've just tried it in PostgreSQL 7.2 and it

Re: [BUGS] timestamp arithmetic (a possible bug?)

2004-07-02 Thread Achilleus Mantzios
O kyrios Ilir Gashi egrapse stis Jul 2, 2004 : SELECT '01.01.2004 10:00:00'::timestamp + ('01.01.2004 10:01:00'::timestamp - '01.01.2004 10:00:00'::timestamp)::interval; ?column? - 2004-01-01 10:01:00 (1 row) works fine in my 7.4.2 > Hi, > > I saw this behaviour in P

Re: [BUGS] timestamp arithmetic (a possible bug?)

2004-07-02 Thread Theodore Petrosky
Interesting If I reverse the order it works... agencysacks=# SELECT CAST('01.01.2004 10:00:00' AS TIMESTAMP) + (CAST('01.01.2004 10:01:00' AS TIMESTAMP) - CAST('01.01.2004 10:00:00' AS TIMESTAMP)) as answer; answer - 2004-01-01 10:01:00 (1 row) However you

[BUGS] timestamp arithmetic (a possible bug?)

2004-07-02 Thread Ilir Gashi
Hi, I saw this behaviour in PostgreSQL 7.2. (Once again, I know this is an old release but I do not have a newer version installed, and I am only using the server for research purposes). If you execute the following statement SELECT (CAST('01.01.2004 10:01:00' AS TIMESTAMP) - CAST('01.01.2004 1