vscode-postgres icon indicating copy to clipboard operation
vscode-postgres copied to clipboard

Some syntax not supported

Open lnicola opened this issue 6 years ago • 5 comments

Possibly fixed by https://github.com/Borvik/vscode-postgres/projects/2.

begin;
select 1;
commit;

shows syntax errors for begin and commit.

PS: Your extension is awesome! I like the autocompletion, parameter and return type suggestions, and also being able to see multiple result sets at once.

lnicola avatar Aug 17 '18 08:08 lnicola

Yeah, it probably would be fixed by that - the challenge is in finding/building a language parser, and then building the language for it. It is rather slow going on that front.

Borvik avatar Aug 17 '18 10:08 Borvik

CREATE TYPE processing_state AS ENUM ('loaded', 'all processed', 'error');

Here ENUM shows syntax error. Otherwise excellent work, man!

StenliH avatar Jul 09 '19 09:07 StenliH

The following valid sql statements show syntax errors: image image

govindrai avatar Aug 13 '20 00:08 govindrai

I'm seeing these syntax errors as well.

@Borvik any idea why this might be? These errors makes the SQL validation unusable.

bfelbo avatar Dec 02 '21 21:12 bfelbo

Currently the error validation is powered by postgres itself by prepending each statement with an EXPLAIN and running that. Postgres itself is returning these errors.

EXPLAIN was not meant for CREATE/ALTER statements - but works good for SELECT statements.

However creating a whole parser that can do this analysis is tricky at best, but to also create one that can be kept up-to-date with the version of postgres anyone might be connected to... yeah... really not my forte (also this is a side-project I don't really have a lot of time to work on)

Borvik avatar Dec 03 '21 03:12 Borvik