From: Shahzad Ahmad <shahzadahmad00@gmail.com>
To: 'David G. Johnston' <david.g.johnston@gmail.com>
To: 'PostgreSQL mailing lists' <pgsql-bugs@lists.postgresql.org>
Subject: RE: BUG #16181: Error Creating Stored Procedures
Date: Wed, 1 Jan 2020 19:18:32 -0500
Message-ID: <002901d5c102$2abfb5c0$803f2140$@gmail.com> (raw)
In-Reply-To: <CAKFQuwYeco+sqTV4qpFob7egVUFe3nqSPZdbx_+GS=L0jRianQ@mail.gmail.com>
References: <16181-3b69f6cdd6047372@postgresql.org>
<CAKFQuwYeco+sqTV4qpFob7egVUFe3nqSPZdbx_+GS=L0jRianQ@mail.gmail.com>
David,
Thanks for the quick reply.
It is working with BEGIN and END.
The code was generated by pgAdmin4 GUI and I somehow incorrectly assumed that GUI would include BEGIN and END statements.
Thanks for your help.
Shahzad
From: David G. Johnston <david.g.johnston@gmail.com>
Sent: Wednesday, January 1, 2020 7:02 PM
To: shahzadahmad00@gmail.com; PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #16181: Error Creating Stored Procedures
On Wed, Jan 1, 2020 at 4:43 PM PG Bug reporting form <noreply@postgresql.org <mailto:noreply@postgresql.org> > wrote:
The following bug has been logged on the website:
Bug reference: 16181
Logged by: Shahzad Ahmad
Email address: shahzadahmad00@gmail.com <mailto:shahzadahmad00@gmail.com>
PostgreSQL version: 12.1
Operating system: Ubuntu 18.04.3 LTS
Description:
I tried both pgAdmin GUI and psql using a script file. In both instances i
got the same error.
CREATE OR REPLACE PROCEDURE admin.my_test(IN role_id integer DEFAULT 0)
LANGUAGE 'plpgsql'
Not a bug...the documentation shows how to write a pl/pgsql function/stored procedure.
https://www.postgresql.org/docs/12/plpgsql-structure.html
Note the "BEGIN" and "END" portions of that syntax diagram are not optional.
David J.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: shahzadahmad00@gmail.com, david.g.johnston@gmail.com
Subject: Re: BUG #16181: Error Creating Stored Procedures
In-Reply-To: <002901d5c102$2abfb5c0$803f2140$@gmail.com>
References: <16181-3b69f6cdd6047372@postgresql.org> <CAKFQuwYeco+sqTV4qpFob7egVUFe3nqSPZdbx_+GS=L0jRianQ@mail.gmail.com> <002901d5c102$2abfb5c0$803f2140$@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox