dbTalk Databases Forums  

[BUGS] Bug in 8.1.5: cannot add literal timestamp value and a interval.

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] Bug in 8.1.5: cannot add literal timestamp value and a interval. in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
j.random.programmer
 
Posts: n/a

Default [BUGS] Bug in 8.1.5: cannot add literal timestamp value and a interval. - 10-20-2006 , 04:53 PM






Hi:

This is a regression bug between 8.1.4 and 8.1.5

'2006-10-20 00:00:00' + interval '5' second

With 8.1.4, the following worked fine. However with
8.1.5, this
gives the following error.

test=# select ('2006-10-20 00:00:00' + interval '5'
second) ;
ERROR: invalid input syntax for type interval:
"2006-10-20 00:00:00"

With 8.1.5, the following works:

test=# select (timestamp '2006-10-20 00:00:00' +
interval '5' second);
?column?
---------------------
2006-10-20 00:00:05
(1 row)


As you can see, we have to specify 'timestamp' before
a literal
timestamp value. That's pretty hokey. Is this a bug or
am I
missing something (and if so, why did a literal
timestamp value not
preceded by "timestamp" work fine in earlier versions
of postgres)?

Best regards,
--j


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] Bug in 8.1.5: cannot add literal timestamp value and a interval. - 10-20-2006 , 05:18 PM






"j.random.programmer" <javadesigner (AT) yahoo (DOT) com> writes:
Quote:
This is a regression bug between 8.1.4 and 8.1.5

'2006-10-20 00:00:00' + interval '5' second
No, I don't think so. Every PG release back to the beginning of time
will think that is an interval + interval addition. That's one of the
system's basic heuristics for resolving the type of unmarked string
literals: if it's in a binary operator expression, assume it's the same as
the known type on the other side of the operator. The only way it would
act differently would be if there was no interval + interval operator,
but one has existed since at least 7.0 (the oldest version I have handy
to check).

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.