Error when creating a stored procedure in postgreSQL-10 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.
As mentioned in the comments, PostgreSQL-10 does not have stored procedures. Same is true about earlier versions.

Workaround alternatives:


Upgrade to version 11 or later
Use a function


Thanks, @Erwin Brandstetter and @a_horse_with_no_name