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