libpg_query icon indicating copy to clipboard operation
libpg_query copied to clipboard

fix some plpgsql errors

Open MGorkov opened this issue 10 months ago • 1 comments

This patch fixes the #243 , #160 , #248 issues and the following errors: "variable "$1" does not exist" "collations are not supported by type -" "variable "ref" must be of type cursor or refcursor" missing expression at or near ";"

changes in JSON:

  1. add declared variable with "alliasfor" parameter pointing to associated variable, e.g. DECLARE _a ALIAS FOR $1;
    {
      PLpgSQL_var: {
        refname: '_a',
        aliasfor: '$1',
        lineno: 3,
        datatype: { PLpgSQL_type: { typname: 'text' } }
      }
  1. add "retvarno" parameter for RETURN NEXT statement
    {
      PLpgSQL_stmt_return_next: { lineno: 6, retvarno: 2 }
    }

MGorkov avatar Apr 16 '24 13:04 MGorkov