markdrago / pgsanity

Check syntax of postgresql sql files
MIT License
309 stars 27 forks source link

Doesn't work with psql meta-commands & plpgsql syntax? #28

Open bhaskar2khaneja opened 5 years ago

bhaskar2khaneja commented 5 years ago

Hi! Noticed the following two issues when using pgsanity:

  1. pgsanity seems to throw an error on the first line in this SQL code:

    \set start 1234
    delete from x where y >= :start;
  2. Also doesn't seem to catch syntax errors in plpgsql code block:

    DO $zzz$
    dsafdsf
    BEGIN
    update test set id=4 where city='def';
    END
    $zzz$ LANGUAGE plpgsql;
d2a-raudenaerde commented 4 years ago

Can confirm doesn't work inside code blocks. This is most unfortunate, as we are moving more and more to functions.