I couldn't get my first stored procedure to work, so I copied this example from the manual:
CREATE PROCEDURE insert_data(a integer, b integer)
LANGUAGE SQL
AS $$
INSERT INTO tbl VALUES (a);
INSERT INTO tbl VALUES (b);
$$;
CALL insert_data(1, 2);
and I get the following error message:
ERROR: syntax error at or near "PROCEDURE" LINE 1: CREATE PROCEDURE insert_data(a integer, b integer) ^ SQL state: 42601 Character: 8
What am I doing wrong?
I'm running the database on localhost, running as admin user. I installed it myself. Installation process completed without errors, and I am able to create tables, functions, triggers, etc.
insert into tbl values (a), (b);
would do just fine