here's a test, passes for me (even that it uses terrible names for the bound parameters in this case):
from sqlalchemy import create_engine from sqlalchemy.sql import literal_column, select e = create_engine("postgresql://scott:tiger@localhost/test", echo=True) assert e.scalar(select([literal_column(r"'hello \\ world'").like(r'% \\ world', escape='^')])) assert e.scalar(select([literal_column(r"'hello \ world'").like(r'% \ world', escape='^')])) On Jul 4, 2013, at 9:52 AM, Michael Bayer <mike...@zzzcomputing.com> wrote: > do you mean to say r'\\' there ? > > > On Jun 27, 2013, at 9:11 PM, Burak Arslan <burak.ars...@arskom.com.tr> wrote: > >> On 06/27/13 13:41, Simon King wrote: >>> Remember that Python also has its own string escaping. When you write >>> a literal '\\' in Python, you are creating a string containing a >>> single backslash. >> >> >> Hi Simon, >> >> I'm aware of that. My issue is that SQLAlchemy produces an invalid query >> for .like('\\') in postgresql. >> >> Best, >> Burak >> >> -- >> You received this message because you are subscribed to the Google Groups >> "sqlalchemy" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to sqlalchemy+unsubscr...@googlegroups.com. >> To post to this group, send email to sqlalchemy@googlegroups.com. >> Visit this group at http://groups.google.com/group/sqlalchemy. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sqlalchemy+unsubscr...@googlegroups.com. > To post to this group, send email to sqlalchemy@googlegroups.com. > Visit this group at http://groups.google.com/group/sqlalchemy. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/groups/opt_out.