Re: Consequence of changes to CTE's in 12

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Consequence of changes to CTE's in 12
Дата
Msg-id CAKFQuwa4QJ=LiPuSseooEfYpUoxZs=98koAAFPMfO2po7tXikg@mail.gmail.com
обсуждение исходный текст
Ответ на Consequence of changes to CTE's in 12  (Steve Baldwin <steve.baldwin@gmail.com>)
Список pgsql-general
On Thu, Feb 11, 2021 at 5:07 PM Steve Baldwin <steve.baldwin@gmail.com> wrote:
My 'dilemma' is that this functionality is packaged and the database it is bundled into could be running on a pre-12 version or 12+. Is there any way I can rewrite my view to achieve the same outcome (i.e. only creating 0 or 1 advisory locks) regardless of the server version? I realise I could have two installation scripts but if it is installed into a pre-12 DB and that DB is subsequently upgraded to 12+, my behaviour is broken.

Pretty sure you will need to choose a location in which to make the installation behave version-dependently.  Within PostgreSQL itself that would be most easily done by writing a pl/pgsql function that conditionally adds the MATERIALIZED indicator on the textual representation of the query before executing it.  You can hide that function call within a view if desired.

David J.

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

Предыдущее
От: Michael Lewis
Дата:
Сообщение: Re: Consequence of changes to CTE's in 12
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Consequence of changes to CTE's in 12