Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backslash string-escaping incorrect? #17

Open
koyae opened this issue Mar 6, 2018 · 1 comment
Open

Backslash string-escaping incorrect? #17

koyae opened this issue Mar 6, 2018 · 1 comment

Comments

@koyae
Copy link

koyae commented Mar 6, 2018

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 added a commit to koyae/migration that referenced this issue Mar 6, 2018
…or Postgres to prevent incorrect highlighting under WHERE LIKE ESCAPE where the escape-character is a backslash (probably not the only possible usecase, note). More detail at exu/pgsql.vim#17. If that's fixed centrally I should include the file via pathogen but this works for now.
@exu
Copy link
Owner

exu commented Mar 7, 2018

sure, feel free to add pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants