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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pasi Oja-Nisula <pon(at)iki(dot)fi>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Stored procedure code no longer stored in v14 and v15, changed behaviour
Date: 2022-12-02 16:02:18
Message-ID: 1937424.1669996938@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Pasi Oja-Nisula <pon(at)iki(dot)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.

As I mentioned upthread, we used to have that behavior (store both
compiled form and original text) for column default expressions and
CHECK constraint expressions. We got rid of that because it caused
far more confusion, and bugs, than it was worth. Not bugs in the
database, but faulty behavior in applications that thought they
could trust the text form to be accurate. I don't intend to
fail to learn from that history.

Also, we've *never* had storage of the original text for views.
I'm a little mystified by people claiming they use original
text for vetting functions when they clearly have no equivalent
ability for views ... or are your applications completely
view-free?

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.

> If an object
> rename makes it invalid, tweak a bit telling so, but don't change the text
> until next alter procedure is run.

I'm astonished at the number of people who think that poorly-implemented
Oracle behavior is something we should emulate.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Christophe Pettus 2022-12-02 16:05:43 Re: Stored procedure code no longer stored in v14 and v15, changed behaviour
Previous Message Peter J. Holzer 2022-12-02 15:05:11 Re: Stored procedure code no longer stored in v14 and v15, changed behaviour