Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vlTeV-00CnCF-2j for pgsql-general@arkaria.postgresql.org; Thu, 29 Jan 2026 15:09:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vlTeV-009toD-00 for pgsql-general@arkaria.postgresql.org; Thu, 29 Jan 2026 15:09:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vlTeU-009tne-02 for pgsql-general@lists.postgresql.org; Thu, 29 Jan 2026 15:09:46 +0000 Received: from fhigh-a8-smtp.messagingengine.com ([103.168.172.159]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vlTeR-002w2l-2G for pgsql-general@lists.postgresql.org; Thu, 29 Jan 2026 15:09:45 +0000 Received: from phl-compute-07.internal (phl-compute-07.internal [10.202.2.47]) by mailfhigh.phl.internal (Postfix) with ESMTP id 7828814001A1; Thu, 29 Jan 2026 10:09:43 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-07.internal (MEProxy); Thu, 29 Jan 2026 10:09:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1769699383; x=1769785783; bh=G4B2TXrAouOoREYtQl6zzUHeL7x9HbSpDTqOYS2jbDA=; b= QILn4QKcOo4Pah+WbJsEgvJvWJkrM2vQ2qvuCtO180jkn7c0840WunfHmCA4lqlf VbePzXop2JeG0NW6VMRIDcPVnz9PduCHQvQ/4qSI6+8GKXqssecH2mZ6NKLT5N4m P2MAqU/pjKySM2AFlrn/EOXBv1frWjsadiELfYNqkYHqRMB2C0IOsNuLeqDUltdK yQcUgdFml4FP7WqwEEwBgvXqrFx5PUjzs2Kk0Z6eKbvDCWoIMuh96BSzpZpa161J Zhsr4XvwG4MDiR3xiDfft6T+vsTk6mXNgMUg7RbUE3Zuo+urURj/mhvg+42PVJeX 6aOTbaAYgyUDt7QxYeKtYA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1769699383; x=1769785783; bh=G 4B2TXrAouOoREYtQl6zzUHeL7x9HbSpDTqOYS2jbDA=; b=hf7gHc/2ACje64liw dQclGJ6WrEydyy/LdIL+FzxE1SId1d1Qj0ozyi/GrL1RrUNoe874kEbKTUU42Dtn SE6p06TZBtl1lPIXZviU7zzBFZGPEBYlSg57CsGDVZPbuGBudZ+z44jlHpYg6Ctb Tz8V+AQbm9SERugoWE1bX8l7lQrRgd1G16iG8RKZd4Lhf+LTr4j7xr7w9A9PY25i D08c9btM35MwxvP0XAvxf4pjUaEqBOT8XAovc4v1n1kk7TkHIrhy2d6Xw01Y7C4O reRmCIGu+iIETO59dFUEMUR5PjUTwGU8Lnt9RtjzD3ovpI+pBvuR58bCShbvrWb8 j2U4g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdduieeiheefucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepkfffgggfuffvfhfhjggtgfesthejredttddvjeenucfhrhhomheptegurhhirghn ucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmqe enucggtffrrghtthgvrhhnpeeivdfhieehheegueeileejieettdejhedugeefleekvdel keehtdfgiefffeekudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmpdhnsggp rhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehpghesuhhkkh hurdhukhdprhgtphhtthhopehpghhsqhhlqdhgvghnvghrrghlsehlihhsthhsrdhpohhs thhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 29 Jan 2026 10:09:42 -0500 (EST) Message-ID: Date: Thu, 29 Jan 2026 07:09:42 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: UNLOGGED table CREATEd on one connection not immediately visible to another connection To: Geoff Winkless , "pgsql-generallists.postgresql.org" References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 1/29/26 07:04, Geoff Winkless wrote: > Hi > > In our application we have a situation where once a day one process > CREATEs an UNLOGGED table and INSERTs several hundred records using > individual queries (no explicit transactions) all of which return > successfully. We then send the ID of the table that we have created > over a TCP socket to a second process, which runs a query that JOINs > against that new table. > > Unfortunately quite often the second process is getting a > PGRES_FATAL_ERROR with > > Primary: relation "qreftmp750" does not exist > > Now (and this is very important) this appears to be a race condition, > because when that process immediately retries the same query (which we > do when we get FATAL_ERROR) it sometimes works on the second or third > (or even 11th) attempt. > > If we were somehow failing to create the table then the retries would > never work, and we absolutely don't send the qreftmp ID to the second > process until we've successfully INSERTed all of the records, so the > race isn't on the application side. There's no explicit transactions > in either process involved, they all just use implicit autocommit, so > I don't see that this can be a DDL versioning issue. > > I'm loathe to point the finger at PG because I'm sure that if this > were a real issue it would have been flagged up well before now, but > I've been staring at our code for days and I'm stumped. Any > suggestions? Provide the code for the procedure(s) that create the table and send the ID to the other process. Question, why is this not run in a single process? > > Thanks > > Geoff > > -- Adrian Klaver adrian.klaver@aklaver.com