SQL:
CREATE PROCEDURE insert_data(a integer, b integer)
LANGUAGE SQL
BEGIN ATOMIC
INSERT INTO tbl VALUES (a);
INSERT INTO tbl VALUES (b);
END;
ERROR for "CREATE PROCEDURE insert_data(a int, b int) LANGUAGE sql BEGIN ATOMIC INSERT INTO tbl VALUES (a); INSERT INTO tbl VALUES (b); END"
deparse: unpermitted node type in a_expr/b_expr: 231
parsetree: {"version":150001,"stmts":[{"stmt":{"CreateFunctionStmt":{"is_procedure":true,"funcname":[{"String":{"sval":"insert_data"}}],"parameters":[{"FunctionParameter":{"name":"a","argType":{"names":[{"String":{"sval":"pg_catalog"}},{"String":{"sval":"int4"}}],"typemod":-1,"location":31},"mode":"FUNC_PARAM_DEFAULT"}},{"FunctionParameter":{"name":"b","argType":{"names":[{"String":{"sval":"pg_catalog"}},{"String":{"sval":"int4"}}],"typemod":-1,"location":38},"mode":"FUNC_PARAM_DEFAULT"}}],"options":[{"DefElem":{"defname":"language","arg":{"String":{"sval":"sql"}},"defaction":"DEFELEM_UNSPEC","location":43}}],"sql_body":{"List":{"items":[{"List":{"items":[{"InsertStmt":{"relation":{"relname":"tbl","inh":true,"relpersistence":"p","location":81},"selectStmt":{"SelectStmt":{"valuesLists":[{"List":{"items":[{"ColumnRef":{"fields":[{"String":{"sval":"a"}}],"location":93}}]}}],"limitOption":"LIMIT_OPTION_DEFAULT","op":"SETOP_NONE"}},"override":"OVERRIDING_NOT_SET"}},{"InsertStmt":{"relation":{"relname":"tbl","inh":true,"relpersistence":"p","location":109},"selectStmt":{"SelectStmt":{"valuesLists":[{"List":{"items":[{"ColumnRef":{"fields":[{"String":{"sval":"b"}}],"location":121}}]}}],"limitOption":"LIMIT_OPTION_DEFAULT","op":"SETOP_NONE"}},"override":"OVERRIDING_NOT_SET"}}]}}]}}}}}]}
SQL: CREATE PROCEDURE insert_data(a integer, b integer) LANGUAGE SQL BEGIN ATOMIC INSERT INTO tbl VALUES (a); INSERT INTO tbl VALUES (b); END;
ERROR for "CREATE PROCEDURE insert_data(a int, b int) LANGUAGE sql BEGIN ATOMIC INSERT INTO tbl VALUES (a); INSERT INTO tbl VALUES (b); END" deparse: unpermitted node type in a_expr/b_expr: 231 parsetree: {"version":150001,"stmts":[{"stmt":{"CreateFunctionStmt":{"is_procedure":true,"funcname":[{"String":{"sval":"insert_data"}}],"parameters":[{"FunctionParameter":{"name":"a","argType":{"names":[{"String":{"sval":"pg_catalog"}},{"String":{"sval":"int4"}}],"typemod":-1,"location":31},"mode":"FUNC_PARAM_DEFAULT"}},{"FunctionParameter":{"name":"b","argType":{"names":[{"String":{"sval":"pg_catalog"}},{"String":{"sval":"int4"}}],"typemod":-1,"location":38},"mode":"FUNC_PARAM_DEFAULT"}}],"options":[{"DefElem":{"defname":"language","arg":{"String":{"sval":"sql"}},"defaction":"DEFELEM_UNSPEC","location":43}}],"sql_body":{"List":{"items":[{"List":{"items":[{"InsertStmt":{"relation":{"relname":"tbl","inh":true,"relpersistence":"p","location":81},"selectStmt":{"SelectStmt":{"valuesLists":[{"List":{"items":[{"ColumnRef":{"fields":[{"String":{"sval":"a"}}],"location":93}}]}}],"limitOption":"LIMIT_OPTION_DEFAULT","op":"SETOP_NONE"}},"override":"OVERRIDING_NOT_SET"}},{"InsertStmt":{"relation":{"relname":"tbl","inh":true,"relpersistence":"p","location":109},"selectStmt":{"SelectStmt":{"valuesLists":[{"List":{"items":[{"ColumnRef":{"fields":[{"String":{"sval":"b"}}],"location":121}}]}}],"limitOption":"LIMIT_OPTION_DEFAULT","op":"SETOP_NONE"}},"override":"OVERRIDING_NOT_SET"}}]}}]}}}}}]}