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

pgspot error on valid plpgsql syntax #211

Open
jgpruitt opened this issue Dec 12, 2024 · 0 comments
Open

pgspot error on valid plpgsql syntax #211

jgpruitt opened this issue Dec 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jgpruitt
Copy link
Contributor

pgspot dies reporting a syntax error on a file containing a return query execute <sql> using <var>; statement.

Here is a SQL script to reproduce the issue.

create schema repro;

create or replace function repro.this_dont_work(x int)
returns table(y int)
as $func$
declare
begin
    return query execute $$
    select y
    from generate_series(1, $1) y
    $$ using x;
end;
$func$ language plpgsql stable security invoker
set search_path to pg_catalog, pg_temp
;

As you can see below, postgres likes the code just fine:
image

But, pgspot dies on it:

pgspot repro.sql

 Errors: 0 Warnings: 0 Unknown: 0 
 syntax error at or near "$$
    select y
    from generate_series(1, $1) y
    $$", at index 0
@jgpruitt jgpruitt added the bug Something isn't working label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant