Re: Concurrenctly running CREATE TEMP TABLE IF NOT EXISTS [...] AS[...] - Mailing list pgsql-general

From Daniel Verite
Subject Re: Concurrenctly running CREATE TEMP TABLE IF NOT EXISTS [...] AS[...]
Date
Msg-id 555f2665-0880-4d63-9314-b73521b8c5e8@manitou-mail.org
Whole thread Raw
In response to Re: Concurrenctly running CREATE TEMP TABLE IF NOT EXISTS [...] AS [...]  (Thorsten Schöning <tschoening@am-soft.de>)
Responses Re: Concurrenctly running CREATE TEMP TABLE IF NOT EXISTS [...] AS [...]  (Thorsten Schöning <tschoening@am-soft.de>)
List pgsql-general
    Thorsten Schöning wrote:

> > The caveat you mention about IF NOT EXISTS does not apply to
> > temporary tables, as they're not shared across sessions.[...]
>
> That's what I understood as well, but I'm creating those concurrently
> WITHIN one and the same session and transaction. :-)

But a SQL session on the server takes its statements from a FIFO queue
and processes them serially, so there's no intra-session concurrency.
In fact multi-threaded SQL clients *must* make sure that they don't
send concurrent queries to the same connection. The best they can
do in terms of throughput is to queue up a new query while
the server is busy executing a previous one, but that's pipelining,
not parallelism.


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



pgsql-general by date:

Previous
From: Thorsten Schöning
Date:
Subject: Re: Concurrenctly running CREATE TEMP TABLE IF NOT EXISTS [...] AS [...]
Next
From: Laura Smith
Date:
Subject: Postgres 12 RLS