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

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Any difference between commit/rollback when only temp tables and \copy are used
Дата
Msg-id CAKFQuwbgDzerfGXVE-1N5YHC-30p8-HqnPyaWw5T2_SgY=eZ7Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Any difference between commit/rollback when only temp tables and \copy are used  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
On Mon, May 16, 2016 at 4:08 PM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 05/16/2016 12:41 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?

I would say that depends on how you are creating the temp table:


​I'm presently using them without an "ON COMMIT" clause - they live until the end of the script/session/transaction (which here are all the same).

So within-transaction storage usage would be controllable ​making the use of BEGIN at least potentially meaningful - as long rollbacks or commits are used and more than one transaction is used to isolate the different parts.

The lack of auto-analyze is something to keep in mind (but haven't been bit by it yet so getting it to stick in memory is more difficult) in either case...though present usage involves sequential scans anyway.

Thanks!

David J.

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Connections - Postgres 9.2
Следующее
От: Melvin Davidson
Дата:
Сообщение: Re: Connections - Postgres 9.2