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

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Stored procedure code no longer stored in v14 and v15, changed behaviour
Дата
Msg-id CAKFQuwbYCk0oA3VT+ngEebBTBjdtGsVLEFOdPX2qqQJobA7rtg@mail.gmail.com
обсуждение исходный текст
Ответ на Stored procedure code no longer stored in v14 and v15, changed behaviour  ("Martijn Tonies \(Upscene Productions\)" <m.tonies@upscene.com>)
Ответы Re: Stored procedure code no longer stored in v14 and v15, changed behaviour  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Stored procedure code no longer stored in v14 and v15, changed behaviour  ("Martijn Tonies \(Upscene Productions\)" <m.tonies@upscene.com>)
Список pgsql-general
On Thu, Dec 1, 2022 at 7:59 AM Martijn Tonies (Upscene Productions) <m.tonies@upscene.com> wrote:

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.
 
For database
development, including browsing an existing database and know what each
routine can do, this is quite terrible.


Frankly, this is not all that compelling.  The version controlled source code should be readily referenced to find out the extended details of this nature.  The function name, and a COMMENT ON comment, provide arguably sufficient in-database knowledge for cursory browsing redirecting the reader to the source code for implementation details and history.

Can you modify the server code to store the original body in proc.prosrc
again? It would be very helpful.


I seem to recall that this option had been discussed and rejected when this feature went in.  The parsed body is a feature because its contents can be updated due to, e.g., renaming of objects.  The text source of the original command would be unable to be updated in the same way and so it is possible the text and the parsed contents would diverge over time, which is a situation we do not want to have.

David J.

В списке pgsql-general по дате отправления:

Предыдущее
От: "Martijn Tonies \(Upscene Productions\)"
Дата:
Сообщение: Stored procedure code no longer stored in v14 and v15, changed behaviour
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Stored procedure code no longer stored in v14 and v15, changed behaviour