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.94.2) (envelope-from ) id 1qmaXR-0089Vx-ED for pgsql-general@arkaria.postgresql.org; Sat, 30 Sep 2023 14:01:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qmaXP-00A9Ai-6y for pgsql-general@arkaria.postgresql.org; Sat, 30 Sep 2023 14:01:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qmaXO-00A8x9-C9 for pgsql-general@lists.postgresql.org; Sat, 30 Sep 2023 14:01:42 +0000 Received: from rs6162.luxsci.com ([162.142.76.255]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qmaXJ-008SFQ-IB for pgsql-general@lists.postgresql.org; Sat, 30 Sep 2023 14:01:40 +0000 Received: from pfortin.com (h128.249.89.75.dynamic.ip.windstream.net [75.89.249.128]) (authenticated bits=0) by rs6162.luxsci.com (8.15.2/8.14.9) with ESMTPSA id 38UE1XkC1180627 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Sat, 30 Sep 2023 14:01:33 GMT Date: Sat, 30 Sep 2023 10:01:32 -0400 From: pf@pfortin.com To: pgsql-general@lists.postgresql.org Subject: Re: cache lookup failed for function 0 Message-ID: <20230930100132.44da3c45@pfortin.com> In-Reply-To: <8fd58b4c-ef57-3218-b7e3-f087e15db784@aklaver.com> References: <20230929163739.3bea46e5.pfortin@pfortin.com> <8fd58b4c-ef57-3218-b7e3-f087e15db784@aklaver.com> X-Mailer: Claws Mail 4.1.1git67 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Lux-Comment: Message 38UE1XkC1180627 sent by user #22429 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pfortin.com; h=date:from:to:subject:message-id:in-reply-to:references:mime-version:content-type:content-transfer-encoding; s=dkim; bh=fN7bA+Nd9napiDGS8Xz+MIEA/Dq2pv0sgeAiOdE21v8=; b=wqLWlbhIPn+yLpFlnipli6pXn9ndSuZgFo4ETuCyuAf9eif4yeFNftQfvY/nLyXGghyT6EiuC4keAeF6Q7DnaOGE+HX6795WSFceADoyg6k3FSE5BBrHJWCnWyPp1gpfaVSVWnfSWOadEpfLUwg278umCQjjW2SFVOiUSQrYp6M= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Adrian,On Fri, 29 Sep 2023 14:27:48 -0700 Adrian Klaver wrote: >On 9/29/23 1:37 PM, pf@pfortin.com wrote: >> Hi, >> >> select version(); >> PostgreSQL 15.4 on x86_64-mageia-linux-gnu, >> compiled by gcc (Mageia 12.3.0-3.mga9) 12.3.0, 64-bit >> >> As a test, rather than use INSERT, I recently wrote a python test script >> to import some 8M & 33M record files with COPY instead. These worked with >> last weekend's data dump. Next, I wanted to look into importing a subset >> of columns using the below logic; but I'm getting "ERROR: cache lookup >> failed for function 0". Re-running the same full imports that worked >> Saturday, I now get the same error. >> >> Could something in the DB cause this "function" error? >> >> >> Simplified statements; just trying to import a subset of columns: >> >> DROP TABLE IF EXISTS t; >> >> CREATE TABLE IF NOT EXISTS t ( >> f1 text, f2 text, f3 text, f4 text, f5 text ); >> >> COPY t ( -- import only a subset of columns > >I'm going to say it is the > >( -- import only a subset of columns > >I suspect the -- comment is the issue. I wish it was that easy. It's not in the code; I added that as a clarification within the email only. >You need to show the actual Python code for a more complete answer. Attached... Source file (44,530 records): https://s3.amazonaws.com/dl.ncsbe.gov/data/ncvoter53.zip Attached is a 10 row (incl. header) sample file. $ dbcopy_voter2 /tmp/ncvoter53_10.txt test ncv53 >> f1, f3, f5 ) FROM '/tmp/foo.txt' >> WITH (FORMAT CSV, HEADER, DELIMITER ' ', ENCODING 'ISO-8859-1') ; >> >> ERROR: cache lookup failed for function 0 >> Where: COPY t, line 1 >> 1 statement failed. >> >> "function"? Is this referring to an implied/internal function? Searching >> has not provided any clue, yet... >> >> There are no user functions in the database: >> ostgres=# \df >> List of functions >> Schema | Name | Result data type | Argument data types | Type >> --------+------+------------------+---------------------+------ >> (0 rows) >> >> It feels like something changed since the previously working script no >> longer works... >> >> Clues? >> >> Thanks, >> Pierre >> >> >> > >