Re: [GENERAL] Escaping underscores in LIKE

2001-03-08 Thread Tom Lane
[EMAIL PROTECTED] writes: > Am I doing something stupid trying to escape an underscore in LIKE? You need more backslashes. Don't forget the string-literal parser eats one level of backslashes, before LIKE ever gets to see the pattern. regards, tom lane -

[GENERAL] Escaping underscores in LIKE

2001-03-08 Thread dev
Am I doing something stupid trying to escape an underscore in LIKE? Version 7.1b3 richardh=> select * from foo; a - a_c a_d abc (3 rows) richardh=> select * from foo where a like 'a_c'; a - a_c abc (2 rows) richardh=> select * from foo where a like 'a\_c'; a - a_c abc