Re: Any difference between commit/rollback when only temp tables and \copy are used

Поиск
Список
Период
Сортировка
От Alan Hodgson
Тема Re: Any difference between commit/rollback when only temp tables and \copy are used
Дата
Msg-id 1500395.EInqayE8N4@skynet.simkin.ca
обсуждение исходный текст
Ответ на Any difference between commit/rollback when only temp tables and \copy are used  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: Any difference between commit/rollback when only temp tables and \copy are used  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
On Monday, May 16, 2016 03:41:23 PM David G. Johnston wrote:
> I have a psql script that obtains data via the \copy command and loads it
> into a temporary table.  Additional work is performed possibly generating
> additional temporary tables but never any "real" tables.  Then the script
> outputs, either to stdout or via \copy, the results.
>
> Does it matter whether I issue a ROLLBACK or a COMMIT at the of the
> transaction?  More basically: does it matter whether I issue a BEGIN?
>
> The script runs on Ubuntu inside a bash shell's heredoc.
>

Some things will complete faster if you use BEGIN to start, as PostgreSQL will
otherwise issue an implicit BEGIN and COMMIT before and after every statement.

If you don't need anything saved at the end it probably doesn't matter if you
use ROLLBACK or COMMIT.




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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Any difference between commit/rollback when only temp tables and \copy are used
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Connections - Postgres 9.2