From: Martijn Tonies \(Upscene Productions\) <m.tonies@upscene.com>
To: pgsql-general@lists.postgresql.org
Subject: Stored procedure code no longer stored in v14 and v15, changed behaviour
Date: Thu, 1 Dec 2022 15:58:37 +0100
Message-ID: <23DE96C56DFC404096553A22DDC5093B@MARTIJNWS> (raw)
Hi all,
In PosgreSQL version 13, the source code for a stored procedure or function
in SQL/plpgsql/etc was stored in pg_proc.prosrc. This column would hold the
original procedure or function body, verbatim.
Since version 14, the source code for a stored procedure or function written
in plain (compound) SQL, a new feature, is no longer stored in
pg_proc.prosrc, instead, there’s an additional column prosqlbody which
returns some kind of pre-parsed SQL which has no use for the user.
I know you can use pg_get_functiondef to get a CREATE PROCEDURE/FUNCTION
statement, but for compound SQL based routines in v14 and v15, this removes
all formatting and comments in the original CREATE statement. For database
development, including browsing an existing database and know what each
routine can do, this is quite terrible.
What is the reason for this?
Can you modify the server code to store the original body in proc.prosrc
again? It would be very helpful.
With regards,
Martijn Tonies
Upscene Productions
https://www.upscene.com
Database Workbench - developer tool for Oracle, SQL Server, PostgreSQL,
MySQL, InterBase, NexusDB and Firebird.
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-general@postgresql.org
Cc: m.tonies@upscene.com
Subject: Re: Stored procedure code no longer stored in v14 and v15, changed behaviour
In-Reply-To: <23DE96C56DFC404096553A22DDC5093B@MARTIJNWS>
References: <23DE96C56DFC404096553A22DDC5093B@MARTIJNWS>
* 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