dbTalk Databases Forums  

[BUGS] BUG #1720: placeholders do not work with timestamp prefix

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


Discuss [BUGS] BUG #1720: placeholders do not work with timestamp prefix in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Wellie Chao
 
Posts: n/a

Default [BUGS] BUG #1720: placeholders do not work with timestamp prefix - 06-17-2005 , 11:47 PM







The following bug has been logged online:

Bug reference: 1720
Logged by: Wellie Chao
Email address: wchao (AT) yahoo (DOT) com
PostgreSQL version: 8.0.0
Operating system: Linux (with kernel 2.4.18)
Description: placeholders do not work with timestamp prefix
Details:

I am using DBI 1.48 and DBD::Pg 1.42 (the programming language is obviously
Perl) to connect to PostgreSQL 8.0.0. The following statements cause
problems:

2005-06-17 16:21:41 EDT LOG: statement: select * from reservation_tbl where
room_id = $1 and (start_dt, end_dt) overlaps (timestamp $2, timestamp $3)
2005-06-17 16:21:41 EDT ERROR: syntax error at or near "$2" at character
93
2005-06-17 16:21:41 EDT LOG: statement: insert into reservation_tbl
(room_id, account_id, start_dt, end_dt, note) values ($1, $2, timestamp $3,
timestamp $4, $5)
2005-06-17 16:21:41 EDT ERROR: syntax error at or near "$3" at character
101

I think it is something to do with the "timestamp" keyword interacting badly
with placeholders.

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org

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

Default Re: [BUGS] BUG #1720: placeholders do not work with timestamp prefix - 06-18-2005 , 12:56 AM






"Wellie Chao" <wchao (AT) yahoo (DOT) com> writes:
Quote:
I am using DBI 1.48 and DBD::Pg 1.42 (the programming language is obviously
Perl) to connect to PostgreSQL 8.0.0. The following statements cause
problems:

2005-06-17 16:21:41 EDT LOG: statement: select * from reservation_tbl where
room_id = $1 and (start_dt, end_dt) overlaps (timestamp $2, timestamp $3)
2005-06-17 16:21:41 EDT ERROR: syntax error at or near "$2" at character
93
The above is not valid SQL --- the notation "timestamp x" is only legal
when x is a simple string literal. I think you need to complain to the
DBI or DBD::Pg folk, if their code is generating this query.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org


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.