Re: Basic question about structuring SQL

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Basic question about structuring SQL
Дата
Msg-id CAKFQuwY5RSsmth4kZxCasdAvc=joAqguB6g7Ut+TyZz6C3=aFQ@mail.gmail.com
обсуждение исходный текст
Ответ на Basic question about structuring SQL  (Robert Inder <robert@interactive.co.uk>)
Список pgsql-general
On Tue, Jul 7, 2020 at 4:41 AM Robert Inder <robert@interactive.co.uk> wrote:
So how should I structure my chunks of SQL so that I can have "safe" (all-or-nothing) blocks,
AND use them from within one another?

While there are more advanced constructs that may aid here I would suggest just following two rules:

top-level scripts handle transactions - usually just a single BEGIN/COMMIT at the top/bottom of the script respectively.  These are scripts you are allowed to name on the psql command line.
support scripts don't handle transactions - these are scripts you include into the main script with \i or \ir

David J.

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

Предыдущее
От: Sebastien Arod
Дата:
Сообщение: Re: Is postgres able to share sorts required by common partition window functions?
Следующее
От: Michael Lewis
Дата:
Сообщение: Re: Is postgres able to share sorts required by common partition window functions?