Re: [HACKERS] placeholder syntax

2004-06-21 Thread Thomas Hallgren
Personally, I agree. The '?' sucks for multiple reasons. The major reason being when you want to use the same parameter in more than one place in a statement. Another reason is query rewrites where you have to reorganize the actual order of parameters. You are then forced to first convert the '?' i

Re: [HACKERS] placeholder syntax

2004-06-21 Thread Mike Mascari
Greg Stark wrote: Tom Lane <[EMAIL PROTECTED]> writes: Abhijit Menon-Sen <[EMAIL PROTECTED]> writes: Should Postgres accept ? as a placeholder? In short, I think this notation sucks and I don't want to emulate it. Certainly it sucks. Unfortunately it's the supported ODBC API which is emulated by ev

Re: [HACKERS] placeholder syntax

2004-06-21 Thread Greg Stark
Tom Lane <[EMAIL PROTECTED]> writes: > Abhijit Menon-Sen <[EMAIL PROTECTED]> writes: > > Should Postgres accept ? as a placeholder? > > In short, I think this notation sucks and I don't want to emulate it. Certainly it sucks. Unfortunately it's the supported ODBC API which is emulated by everyo

Re: [HACKERS] placeholder syntax

2004-06-21 Thread Tom Lane
Abhijit Menon-Sen <[EMAIL PROTECTED]> writes: > Should Postgres accept ? as a placeholder? We think it's an operator character: regression=# select 1 ? 4; ERROR: operator does not exist: integer ? integer I count eighteen standard operators that would be broken if we changed '?' to mean a param

[HACKERS] placeholder syntax

2004-06-21 Thread Abhijit Menon-Sen
PostgreSQL currently uses $1/$2 for placeholders in prepared statements. I'm writing something that may potentially submit queries to both Oracle and Postgres, and it seems Oracle doesn't accept this syntax. Someone on IRC said I could use ? for both Oracle and Postgres. It isn't entirely clear to