Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jiJFo-0005GB-H1 for pgsql-general@arkaria.postgresql.org; Mon, 08 Jun 2020 15:00:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jiJFn-0002HL-Eb for pgsql-general@arkaria.postgresql.org; Mon, 08 Jun 2020 14:59:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jiJFn-0002HD-6O for pgsql-general@lists.postgresql.org; Mon, 08 Jun 2020 14:59:59 +0000 Received: from mail.am-soft.de ([83.218.36.120]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jiJFk-00082t-Id for pgsql-general@lists.postgresql.org; Mon, 08 Jun 2020 14:59:58 +0000 Received: from mail.am-soft.de (localhost [127.0.0.1]) by mail.am-soft.de (Postfix) with ESMTP id 2479129CDC70 for ; Mon, 8 Jun 2020 16:59:55 +0200 (CEST) Received: from tschoening-nb.fritz.box (unknown [77.78.178.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.am-soft.de (Postfix) with ESMTPSA id 01EB829CDC6E for ; Mon, 8 Jun 2020 16:59:53 +0200 (CEST) Date: Mon, 8 Jun 2020 16:09:44 +0200 From: =?iso-8859-15?Q?Thorsten_Sch=F6ning?= Organization: AM-SoFT GmbH IT-Systeme Message-ID: <24615333.20200608160944@am-soft.de> To: pgsql-general@lists.postgresql.org Subject: Re: Concurrenctly running CREATE TEMP TABLE IF NOT EXISTS [...] AS [...] In-Reply-To: <555f2665-0880-4d63-9314-b73521b8c5e8@manitou-mail.org> References: <1561641372.20200608112737@am-soft.de> <555f2665-0880-4d63-9314-b73521b8c5e8@manitou-mail.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable X-AV-Checked: ClamAV using ClamSMTP List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Guten Tag Daniel Verite, am Montag, 8. Juni 2020 um 12:07 schrieben Sie: > 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.[...] I was looking at JDBC-docs and those explicitly allow sharing one connection by multiple threads, while at the same time not explicitly forbidding concurrent access. https://docs.oracle.com/javadb/10.8.3.0/devguide/cdevconcepts23499.html https://docs.oracle.com/javadb/10.8.3.0/devguide/cdevconcepts89498.html Therefore I had assumed that concurrent access is available as long as one follows the recommened practices, which is what I do. Though, that concurrent access seems to not be available because of additional synchronization in the JDBC-driver of Postgres. https://stackoverflow.com/a/52798543/2055163 https://github.com/pgjdbc/pgjdbc/blob/ecbc48ff6ad293a2555465d4f7fb6a33a403a= f26/pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java#L276 Is that the case with all JDBC-drivers most likely or simply some implementation detail of some and others might allow truly concurrent access within one session? Nevertheless, I think I can at least partly answer some of my questions now. So thanks for forcing digging deeper into this than I obviously did before. :-) Mit freundlichen Gr=FC=DFen, Thorsten Sch=F6ning --=20 Thorsten Sch=F6ning E-Mail: Thorsten.Schoening@AM-SoFT.de AM-SoFT IT-Systeme http://www.AM-SoFT.de/ Telefon...........05151- 9468- 55 Fax...............05151- 9468- 88 Mobil..............0178-8 9468- 04 AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln AG Hannover HRB 207 694 - Gesch=E4ftsf=FChrer: Andreas Muchow