Hackers,

This seems reasonable:

    david=# DO $$
    david$# BEGIN
    david$#     WITH now AS (SELECT now())
    david$#     SELECT * from now;
    david$# END;
    david$# $$;
    ERROR:  query has no destination for result data
    HINT:  If you want to discard the results of a SELECT, use PERFORM instead.
    CONTEXT:  PL/pgSQL function inline_code_block line 3 at SQL statement

This not so much:

    david=# DO $$
    david$# BEGIN
    david$#     WITH now AS (SELECT now())
    david$#     PERFORM * from now;
    david$# END;
    david$# $$;
    ERROR:  syntax error at or near "PERFORM"
    LINE 4:     PERFORM * from now;
                ^
Parser bug in PL/pgSQL, perhaps?

Best,

David



-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to