PostgreSQL - pl/pgsql syntax highliting
Hi,
we use PostgreSQL's pl/pgsql procedural language a lot. I would like to add basic syntax highliting for keywords. How to do it? The language syntax is very similair to Oracle's PL/SQL.
Language description:
http://www.postgresql.org/docs/9.0/interactive/plpgsql.html
Thanks for any hints,
Kuba
Please sign in to leave a comment.
Hi Jakub,
"File | Settings | SQL Dialects" and set the PostgreSQL as dialect for the whole project (or specific files/directories).
Hi Andriy,
thanks but it doesn't work for me :-(
Attached is an example of pl/pgsql procedure - it's full of errors although the procedure itself is syntactilly correct. Am I doing someting wrong?
In my example it doesn't correctly recognize:
1) %TYPE construction
2) var := expression; (see first row after BEGIN)
3) SELECT INTO
4) END IF
5) FOR record IN SELECT
6) END LOOP
Is this supposed to work and should I report these as bugs?
Thanks,
Kuba
Attachment(s):
pg.sql.zip
Sorry, but I cannot advice here as I have never used PostgreSQL or Oracle myself. I have tried to use PostgreSQL & Oracle as SQL Dialects but it still shows some errors.
I may recommend to wait for an anwser for a day or so here .. and if no proper advice is given then submit new ticket to Issue Tracker.
Nope, pl/pgsql is not supported.
Basically you won't be able to provide the support youself beyond very very basic highlighting of Settings|File Types|Add...
Feel free to submit a feature request though..
Thanks for your reply. That would be enough for start. Is it possible to make it work with sql code completion?
Kuba
No chance.
For Googlers: PL/pgSQL is supported in IDEA (at least Ultimate). Name the file `_.sql` and select dialect "PostgreSQL" (either for the whole project, or at least the individual file).