Re: Stored procedure code no longer stored in v14 and v15, changed behaviour

Christophe Pettus <xof@thebuild.com>

From: Christophe Pettus <xof@thebuild.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Pasi Oja-Nisula <pon@iki.fi>, pgsql-general@lists.postgresql.org
Date: 2022-12-02T16:05:43Z
Lists: pgsql-general

> On Dec 2, 2022, at 08:02, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 
> Pasi Oja-Nisula <pon@iki.fi> writes:
>> I would be perfectly satisfied, if the sql that produced the procedure
>> would be stored "as is" read-only copy when it was compiled.

> If you want an audit comparison point, I'd suggest capturing
> the result of pg_get_functiondef or one of its sibling functions
> just after creating your function.  "pg_dump -s" is another
> pretty credible mechanism for capturing schema details.

Agreeing with Tom, I find the argument that this is important for auditing unpersuasive.  Storing the original text but allowing the version that is actually executed to be different is a step away from anything like good auditing practice.