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 1kfzv7-0003nY-Sc for pgsql-general@arkaria.postgresql.org; Fri, 20 Nov 2020 06:29:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kfzv6-00038S-JF for pgsql-general@arkaria.postgresql.org; Fri, 20 Nov 2020 06:29:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kfzv6-00038K-Bh for pgsql-general@lists.postgresql.org; Fri, 20 Nov 2020 06:29:20 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kfzv4-0003sL-Fh for pgsql-general@postgresql.org; Fri, 20 Nov 2020 06:29:19 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 0AK6TH3n1277129; Fri, 20 Nov 2020 01:29:17 -0500 From: Tom Lane To: Steve Baldwin cc: pgsql-general Subject: Re: Locking and postgres_fdw extension In-reply-to: References: Comments: In-reply-to Steve Baldwin message dated "Fri, 20 Nov 2020 10:45:02 +1100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1277127.1605853757.1@sss.pgh.pa.us> Date: Fri, 20 Nov 2020 01:29:17 -0500 Message-ID: <1277128.1605853757@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Steve Baldwin writes: > However if I want it to fail immediately if unable to obtain the lock, it > seems nowait is ignored for foreign tables (or at least with my version of > postgres_fdw). Hmm ... this seems to be intentional, per the comments in deparseLockingClause(): * For now, just ignore any [NO] KEY specification, since (a) * it's not clear what that means for a remote table that we * don't have complete information about, and (b) it wouldn't * work anyway on older remote servers. Likewise, we don't * worry about NOWAIT. However, it's not super clear whether the concern about NOWAIT is just that the remote server might be too old to know that keyword, or whether there's some deeper issue. (I see your example is also falling foul of the non-implementation of NO KEY, which might be confusing matters still more.) regards, tom lane