pgsql.vim icon indicating copy to clipboard operation
pgsql.vim copied to clipboard

Backslash string-escaping incorrect?

Open koyae opened this issue 6 years ago • 1 comments

For compatibility with systems which may have changed the default LIKE-clause escape-character, sometimes it will be specified explicitly:

    SELECT * FROM information_schema WHERE 
        table_name LIKE 'd\_%' ESCAPE '\'
        AND table_schema IN ('chapow_core')

Despite the syntax highlighting you may see above indicating there's an un-terminated string, you'll note from this SQL Fiddle that Postgres does not treat the backslash as an escape-character within the string, and therefore does not hit a syntax-error. This behavior may be different from generic SQL.

I'm happy to submit test and modifications using a patch or pull-request if you'll take it.

Cheers.

koyae avatar Mar 06 '18 22:03 koyae

sure, feel free to add pull request

exu avatar Mar 07 '18 07:03 exu