Re: Concurrenctly running CREATE TEMP TABLE IF NOT EXISTS [...] AS[...]

Поиск
Список
Период
Сортировка
Искать
От
Daniel Verite
Тема
Re: Concurrenctly running CREATE TEMP TABLE IF NOT EXISTS [...] AS[...]
Дата
Msg-id
3ab95c06-a632-4601-8ccc-2f285a587f09@manitou-mail.org
Ответ на
Список
Дерево обсуждения
Concurrenctly running CREATE TEMP TABLE IF NOT EXISTS [...] AS [...] Thorsten Schöning <tschoening@am-soft.de>
Re: Concurrenctly running CREATE TEMP TABLE IF NOT EXISTS [...] AS [...] Thorsten Schöning <tschoening@am-soft.de>
Re: Concurrenctly running CREATE TEMP TABLE IF NOT EXISTS [...] AS[...] "Daniel Verite" <daniel@manitou-mail.org>
Re: Concurrenctly running CREATE TEMP TABLE IF NOT EXISTS [...] AS [...] Thorsten Schöning <tschoening@am-soft.de>
Re: Concurrenctly running CREATE TEMP TABLE IF NOT EXISTS [...] AS[...] "Daniel Verite" <daniel@manitou-mail.org>
Re: Concurrenctly running CREATE TEMP TABLE IF NOT EXISTS [...] AS [...] Thorsten Schöning <tschoening@am-soft.de>
Re: Concurrenctly running CREATE TEMP TABLE IF NOT EXISTS [...] AS[...] Ravi Krishna <srkrishna@outlook.com>
Re: Concurrenctly running CREATE TEMP TABLE IF NOT EXISTS [...] AS[...] Ron <ronljohnsonjr@gmail.com>
Re: Concurrenctly running CREATE TEMP TABLE IF NOT EXISTS [...] AS [...] Thorsten Schöning <tschoening@am-soft.de>
Re: Concurrenctly running CREATE TEMP TABLE IF NOT EXISTS [...] AS[...] Ron <ronljohnsonjr@gmail.com>
Re: Concurrenctly running CREATE TEMP TABLE IF NOT EXISTS [...] AS[...] Adrian Klaver <adrian.klaver@aklaver.com>
	Thorsten Schöning wrote:

> I'm using "CREATE TEMP TABLE IF NOT EXISTS [...] AS [...]" and the
> associated queries can take a long time. So the following lists some
> questions about executing those concurrently, even thouzgh I've
> already read threads like the following:

> > The bottom line is that CREATE TABLE IF NOT EXISTS doesn't pretend
> > to handle concurrency issues any better than regular old CREATE
> > TABLE, which is to say not very well.[...]
> 
> https://www.postgresql.org/message-id/CA+TgmoZAdYVtwBfp1FL2sMZbiHCWT4UPrzRLNnX1Nb30Ku3-gg@mail.gmail.com


The caveat you mention about IF NOT EXISTS does not apply to 
temporary tables, as they're not shared across sessions.
That is, if two concurrent transactions execute at the same time
CREATE TEMP TABLE IF NOT EXISTS foo(...)
it can't fail as described above because that creates two distinct tables,
each private to their session.


Best regards,
-- 
Daniel Vérité
PostgreSQL-powered mailer: https://www.manitou-mail.org
Twitter: @DanielVerite


В списке pgsql-general по дате отправления
От: Oleksandr Shulgin
Дата:
От: Thorsten Schöning
Дата:
FAQ