Re: Wierd "ProgrammingError" with "E" string prefix

Federico Di Gregorio <fog-NGVKUo/i/[email protected]>
Newsgroups gmane.comp.python.db.psycopg.devel
Organization initd.org
Message-ID <[email protected]>
Il giorno mer, 04/03/2009 alle 15.51 +0100, Federico Di Gregorio ha
scritto:
> > Might want to take a look at dbapiext which already does this :)
> > 
> > http://furius.ca/pubcode/pub/antiorm/lib/python/dbapiext.py.html
> 
> This is something I DON'T want to use. Why? Try this using a real table
> in your database (and using execute() instead of apply()):
> 
> q = dbapiext.qcompile('SELECT foo FROM %(table)s')
> print q.apply(table="bar;DROP TABLE foo;")

Sorry, wrong example. Try this one using a real table name :)

q = dbapiext.qcompile('SELECT * FROM %(table)s')
q.execute(curs, table="tablename;DROP TABLE tablename")

-- 
Federico Di Gregorio                         http://people.initd.org/fog
Debian GNU/Linux Developer                                [email protected]
INIT.D Developer                                           fog-NGVKUo/i/[email protected]
                            Non vi sono certezze, solo opportunità. -- V

_______________________________________________
Psycopg mailing list
Psycopg-IAPFreCvJWPBWskQ1e/[email protected]
http://lists.initd.org/mailman/listinfo/psycopg
signature.asc (application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEABECAAYFAkmulngACgkQvcCgrgZGjevZxQCgoD7NOZ1BUNqxgOJFTj3dhYdg
HNQAoNBcXhpeA9DHlOVO/PR6H3qc3jiQ
=7MId
-----END PGP SIGNATURE-----
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.