Prepared statements?
"Dawid Kuroczko" <[email protected]>
| Newsgroups | gmane.comp.python.db.psycopg.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello.
I'm wondering if psycopg2 has an API for server-side
prepared statements. And if so, how to use it efficiently?
And if not... well what are the road blocks? ;)
The other question is about execute() command, so far
I have seen two syntaxes:
execute("SELECT foo FROM bar WHERE baz=%d" % intval)
execute("SELECT foo FROM bar WHERE baz=%s", (intval,))
...seems like the latter is more efficient (and seems it doesn't
like "%d"). Am I correct? Or maybe there are other syntaxes
that are even better?
Regards,
Dawid
--
Solving [site load issues] with [more database replication] is a lot
like solving your own personal problems with heroin - at first it
sorta works, but after a while things just get out of hand.