Re: ON COMMIT options for non temporary tables

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: ON COMMIT options for non temporary tables
Дата
Msg-id 20191122072709.GD42684@paquier.xyz
обсуждение исходный текст
Ответ на Re: ON COMMIT options for non temporary tables  (Laurenz Albe <laurenz.albe@cybertec.at>)
Список pgsql-general
On Thu, Nov 21, 2019 at 05:13:31PM +0100, Laurenz Albe wrote:
> How should that work for tables other than temporary tables?
> Should COMMIT lock if somebody else accesses the table?

Postgres does not support read uncommitted, so the table would not be
visible to other sessions until the transaction that created it is
committed.  Anyway, the goal is to use the table just within a
transaction without having it produce WAL, right?

> What keeps you from explicitly dropping the table right before
> you commit?

Yeah, that would be the most simple.  Another idea I can think of here
is to use a combination of event trigger and deferred triggered on a
dummy constraint: register the table creation using the event trigger
on CREATE TABLE, and then drop it using the deferred trigger.  Using a
DROP TABLE before the commit or once your transaction is done with
this table is much more simple of course :)
--
Michael

Вложения

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: Adding LIMIT changes PostgreSQL plan from good to a bad one
Следующее
От: rutuparna andhare
Дата:
Сообщение: Active-Passive DB