Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eGUZa-0001Xe-Tv for pgsql-general@arkaria.postgresql.org; Sun, 19 Nov 2017 18:44:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eGUZa-000199-3n for pgsql-general@arkaria.postgresql.org; Sun, 19 Nov 2017 18:44:06 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eGUX2-0005Fa-OX for pgsql-general@postgresql.org; Sun, 19 Nov 2017 18:41:28 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eGUWt-0003sY-8V for pgsql-general@postgresql.org; Sun, 19 Nov 2017 18:41:27 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id vAJIfD8W011961; Sun, 19 Nov 2017 13:41:13 -0500 From: Tom Lane To: Chris Mair cc: pgsql-general@postgresql.org Subject: Re: parallel query in 9.6.6 + oracle_fdw -> ERROR: invalid cache ID: 41 In-reply-to: <96420364a3d055172776752a1de80714@smtp.hushmail.com> References: <96420364a3d055172776752a1de80714@smtp.hushmail.com> Comments: In-reply-to Chris Mair message dated "Sun, 19 Nov 2017 19:18:04 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <11959.1511116873.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 19 Nov 2017 13:41:13 -0500 Message-ID: <11960.1511116873@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org Chris Mair writes: > Whenever a session has performed a query on a foreign table, any subseque= nt > query on a local table big enough to use the parallel query feature exits= with > an error: > ERROR: invalid cache ID: 41 > CONTEXT: parallel worker Hm, syscache 41 is PROCNAMEARGSNSP in 9.6, if I counted right. > (gdb) bt > #0 0x00007f16a0f4d1f7 in raise () from /lib64/libc.so.6 > #1 0x00007f16a0f4e8e8 in abort () from /lib64/libc.so.6 > #2 0x00000000008094b4 in errfinish (dummy=3Ddummy@entry=3D0) at elog.c:5= 57 > #3 0x000000000080aea2 in elog_finish (elevel=3Delevel@entry=3D22, fmt=3D= fmt@entry=3D0x9d9965 "invalid cache ID: %d") at elog.c:1378 > #4 0x00000000007ffd82 in SearchSysCacheList (cacheId=3DcacheId@entry=3D4= 1, nkeys=3Dnkeys@entry=3D2, key1=3Dkey1@entry=3D139734905138463, key2=3D, key3=3Dkey3@entry=3D0, key4=3Dkey4@entry=3D0) at syscache.c:1= 210 > #5 0x00007f169161a59f in _PG_init () at oracle_fdw.c:709 > #6 0x000000000080c476 in internal_load_library (libname=3D, libname@entry=3D0x7f16a1bfdde8
) a= t dfmgr.c:276 > #7 0x000000000080c708 in RestoreLibraryState (start_address=3D0x7f16a1bf= dde8
) at dfmgr.c:741 > #8 0x00000000004e72cf in ParallelWorkerMain (main_arg=3D)= at parallel.c:1069 Apparently, oracle_fdw is trying to do a procedure lookup in its _PG_init function. This is a horrible idea: it assumes that _PG_init is invoked inside a transaction, which is wrong if the library is preloaded, for example. (I'd bet that adding oracle_fdw to shared_preload_libraries would fail badly, though perhaps not with this exact error message.) So I'd call this an oracle_fdw bug. It needs to postpone what it's doing here to the first normal FDW function call in a session. regards, tom lane --=20 Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general