Re: Wierd "ProgrammingError" with "E" string prefix
Karsten Hilbert <[email protected]>
| Newsgroups | gmane.comp.python.db.psycopg.devel |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Mar 04, 2009 at 11:54:39AM +0100, Federico Di Gregorio wrote:
> > > Something like:
> > >
> > > curs.execute("DROP TABLE %s", (Identifier(unstrusted_data),))
> >
> > Should this, then, translate to
> >
> > drop table quote_ident(untrusted_data);
> >
> > or am I on the wrong track ?
>
> Yes, but unfortunately DROP does not take SQL functions, just
> identifiers.
Ah, true, I forgot. :-(
> So the quoting must happen on Python side.
Does the libpq have anything to help with this ?
Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346