UniqueVision / plpgsql-lsp

MIT License
51 stars 11 forks source link

trigger definitions break parsing #42

Closed a-mckinley closed 2 years ago

a-mckinley commented 2 years ago

Describe the bug

The following trigger definition breaks parsing

create table testing as select * from generate_series(1,5);

create or replace function test() returns trigger as
$$
begin
    return null;
end;
$$ language plpgsql;

drop trigger if exists test on testing;
create or replace trigger t after insert on testing
for each row
execute procedure test();

The error message is

cannot parse. syntax error at or near "trigger"

Environment

yas7010uv commented 2 years ago

@a-mckinley

Sorry :(

This is libpg-query problem. This extension just returns the result from libpg-query.

a-mckinley commented 2 years ago

The problem seems to be they don't yet support PG14.

"create or replace trigger" is PG14 only.

yas7010uv commented 2 years ago

Thanks for your report!

We upgrade the version of npm packages in the next release (including 'libpg-query').