Binding and custom types...

Douglas Mayle <[email protected]>
Newsgroups gmane.comp.python.db.psycopg.devel
Message-ID <[email protected]>
Hello all,
	I was wondering if someone could help me figure out an issue I'm  
having using psycopg2 by way of SQLAlchemy because of my bind  
parameter.  I'm running something like this:

cursor.execute('UPDATE almanacs SET location=%(location)s,  
modified=CURRENT_TIMESTAMP WHERE almanacs.id = %(almanacs_id)s',
{'almanacs_id': 2, 'location':  
"ST_TRANSFORM 
('SRID=900913;01010000007f2ef1fb0b804640cdfc51710f0059c0', 2163)"})


What's coming includes this: SET  
location 
= 
E'ST_TRANSFORM 
(''SRID=900913;010100000033c4b12e6e5544408f554acff48652c0'', 2163)'

Where I need it to be SET  
location 
= 
ST_TRANSFORM('SRID=900913;010100000033c4b12e6e5544408f554acff48652c0',  
2163)

In other words, it's a SQL function, not a text string.  Is there  
anyway to call execute so that it won't escape my string?

Thanks,
Douglas Mayle
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.