Pasi Oja-Nisula <pon@xxxxxx> 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