Re: API 3.0 limiting paramstyle to ['named', 'qmark'] is okay. ('format' is not desirable)

Christoph Zwerschke <[email protected]>
Newsgroups gmane.comp.python.db
Message-ID <[email protected]>
Am 17.05.2013 18:41, schrieb Daniele Varrazzo:
 > You have tested it wrong, and haven't bothered reading the first few
 > lines of the first page of the documentation of the driver library.

Yes, sorry for creating confusion today, I tested it wrong and psycopg2 
*does* add the quotes.

But then I wonder why you gave this example:

Select 'Guess how many params this query has?? ? ? %s'

Because if params must not be quoted this makes little sense.

How do you expect the command above to be executed by the driver? Should 
the parameters now appear without quotes because they are already in a 
literal string? At least psycopg2 quotes them anyway, so you would have 
double quotes and a syntax error. So I think it's safe to assume or 
require that parameters appear only outside of strings and then it's not 
ambiguous any more, because ? and : cannot appear in SQL outside quotes.

-- Chris
_______________________________________________
DB-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/db-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.