Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIljU-0002yU-Qq for pgsql-general@arkaria.postgresql.org; Tue, 23 Apr 2019 03:04:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hIljT-0008QH-5w for pgsql-general@arkaria.postgresql.org; Tue, 23 Apr 2019 03:04:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIljS-0008QA-Q9 for pgsql-general@lists.postgresql.org; Tue, 23 Apr 2019 03:04:30 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIljO-0006wy-5O for pgsql-general@postgresql.org; Tue, 23 Apr 2019 03:04:29 +0000 Received: by mail-pg1-x542.google.com with SMTP id j26so6802407pgl.5 for ; Mon, 22 Apr 2019 20:04:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=qw/bzBkW5x1RmsmkukuP+5UicZVGxFC3XKjrhfXs6do=; b=ChpMZKYwViewhqc34z4kARPHYwSA06AwVsy5qEiNHiiFnXxtXTxYoW5ydgff1Pi34n BPKOO7aaLXF6OsfUuGIuxVaOpOcB2KrGn4hMKwysV4NmHe9ZHsPbTtGA+oFmfBBBDFqs T4KAKl1Qto5K+zInLQff/Bq29YsNNHONx0pkzvjaMjnkl5nvaUpBWJF/Q/aHwSa2cYzx Rle0d8IKhH1ywZRhrmHWzhUYq5bfiFDsw+b8i4UXMgErw6TO/H/uTiCQ3MVckcfYi7Fh ESvCro37Sx37SVTHmzXmiM/EPSqArcRYK/lqAfnP/bMNcs6F2u42qPfW28gmi6cIjSO5 hTgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=qw/bzBkW5x1RmsmkukuP+5UicZVGxFC3XKjrhfXs6do=; b=Ak5UBLPXX1n3xR21DILvJd4CugpcMI6MU7OmjlzHLLlPCwlIuJldGFCXOJ1PFMgDTq ZzVD2Q0yoUyEg1Srz/x+5rY/FaA8UQsPngsCk63lL21R83hrPTtdsw57vidYIP0JqoNS E9tMGhGDnzN/50FuJ/jio41KnBucahd/oRsD3mtj/FbuudtwvNYVvCKWTvwcStKLXJdJ l92oMvR30rjY6EH2AP14e9JmcymBZuLZFMaLvzcy8mls2etqOjJIm9UDBIp4rcy3jVu+ /TYR+o+wgzlM9hcTTlJQuvsgZbY1amvaT5hpeafygnw3B+DKVqKPO/lr8/gzCuoiFld1 f/5g== X-Gm-Message-State: APjAAAWpjq8c3voe0jtUeB/QG6FQEVb5H3A2BT6i0wPZzKFGqYSNYJH/ A9wOfpj8BZt8erCeND4Prg8h+5kt X-Google-Smtp-Source: APXvYqyXgna0eUF1v0T0TXl3fEdkYxP8J/sHgAZSVRxzBcdydKCVkLn6+sE6qIPUuXKRiUQ7qkZSGg== X-Received: by 2002:a65:6489:: with SMTP id e9mr21799312pgv.364.1555988663242; Mon, 22 Apr 2019 20:04:23 -0700 (PDT) Received: from [192.168.1.11] ([36.79.250.46]) by smtp.gmail.com with ESMTPSA id a10sm18477093pfc.21.2019.04.22.20.04.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Apr 2019 20:04:22 -0700 (PDT) Subject: Re: cache lookup failed for function 1 on fmgr_info_cxt_security, fmgr.c:184 To: Tom Lane Cc: pgsql-general@postgresql.org References: <3982.1555941867@sss.pgh.pa.us> From: Soni Message-ID: Date: Tue, 23 Apr 2019 10:04:19 +0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <3982.1555941867@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk We have no other extensions installed, just plpgsql. Here's the backtrace. Please let me know if it helps. #0  errfinish (dummy=dummy@entry=0) at elog.c:414 #1  0x0000000000820068 in elog_finish (elevel=elevel@entry=20, fmt=fmt@entry=0x864278 "cache lookup failed for function %u") at elog.c:1376 #2  0x0000000000821e63 in fmgr_info_cxt_security (functionId=1, functionId@entry=18230952, finfo=finfo@entry=0x7ffcd9090460, mcxt=,     ignore_security=ignore_security@entry=0 '\000') at fmgr.c:184 #3  0x00000000008233f2 in fmgr_info (finfo=0x7ffcd9090460, functionId=18230952) at fmgr.c:129 #4  OidFunctionCall1Coll (functionId=functionId@entry=1, collation=collation@entry=0, arg1=arg1@entry=75471) at fmgr.c:1325 #5  0x0000000000532054 in ProcedureCreate (procedureName=, procNamespace=procNamespace@entry=2200, replace=,     returnsSet=returnsSet@entry=0 '\000', returnType=returnType@entry=2950, proowner=10, languageObjectId=languageObjectId@entry=13,     languageValidator=languageValidator@entry=1, prosrc=prosrc@entry=0x1139fb0 "uuid_nil", probin=probin@entry=0x1139f80 "$libdir/uuid-ossp", isAgg=isAgg@entry=0 '\000',     isWindowFunc=isWindowFunc@entry=0 '\000', security_definer=security_definer@entry=0 '\000', isLeakProof=isLeakProof@entry=0 '\000', isStrict=isStrict@entry=1 '\001',     volatility=volatility@entry=105 'i', parallel=parallel@entry=115 's', parameterTypes=parameterTypes@entry=0x1162e90, allParameterTypes=allParameterTypes@entry=0,     parameterModes=parameterModes@entry=0, parameterNames=parameterNames@entry=0, parameterDefaults=parameterDefaults@entry=0x0, trftypes=trftypes@entry=0,     proconfig=proconfig@entry=0, procost=procost@entry=1, prorows=prorows@entry=0) at pg_proc.c:714 #6  0x00000000005a3a2e in CreateFunction (pstate=pstate@entry=0x1133990, stmt=stmt@entry=0x113a250) at functioncmds.c:1083 #7  0x0000000000720967 in ProcessUtilitySlow (pstate=pstate@entry=0x1133990, pstmt=pstmt@entry=0x1149698,     queryString=queryString@entry=0x113fb38 "/* contrib/uuid-ossp/uuid-ossp--1.1.sql */\n\n-- complain if script is sourced in psql, rather than via CREATE EXTENSION\n\n\nCREATE FUNCTION uuid_nil()\nRETURNS uuid\nAS '$libdir/uuid-ossp', 'uuid_nil'\nIMMU"..., context=context@entry=PROCESS_UTILITY_QUERY, params=params@entry=0x0,     queryEnv=queryEnv@entry=0x0, completionTag=completionTag@entry=0x0, dest=0xca42a0 ) at utility.c:1433 #8  0x000000000071fa6f in standard_ProcessUtility (pstmt=0x1149698,     queryString=0x113fb38 "/* contrib/uuid-ossp/uuid-ossp--1.1.sql */\n\n-- complain if script is sourced in psql, rather than via CREATE EXTENSION\n\n\nCREATE FUNCTION uuid_nil()\nRETURNS uuid\nAS '$libdir/uuid-ossp', 'uuid_nil'\nIMMU"..., context=PROCESS_UTILITY_QUERY, params=0x0, queryEnv=0x0, dest=0xca42a0 ,     completionTag=0x0) at utility.c:931 #9  0x000000000059a6ac in execute_sql_string (filename=0x112bc18 "/usr/pgsql-10/share/extension/uuid-ossp--1.1.sql",     sql=0x113fb38 "/* contrib/uuid-ossp/uuid-ossp--1.1.sql */\n\n-- complain if script is sourced in psql, rather than via CREATE EXTENSION\n\n\nCREATE FUNCTION uuid_nil()\nRETURNS uuid\nAS '$libdir/uuid-ossp', 'uuid_nil'\nIMMU"...) at extension.c:763 #10 execute_extension_script (extensionOid=extensionOid@entry=75470, control=control@entry=0x112c310, from_version=from_version@entry=0x0,     version=version@entry=0x1132b78 "1.1", requiredSchemas=requiredSchemas@entry=0x0, schemaName=schemaName@entry=0x112c2f8 "public", schemaOid=)     at extension.c:924 #11 0x000000000059b135 in CreateExtensionInternal (extensionName=0x10fa100 "uuid-ossp", schemaName=0x112c2f8 "public", schemaName@entry=0x0, versionName=0x1132b78 "1.1",     versionName@entry=0x0, oldVersionName=oldVersionName@entry=0x0, cascade=, parents=parents@entry=0x0, is_create=is_create@entry=1 '\001')     at extension.c:1536 #12 0x000000000059b647 in CreateExtension (pstate=pstate@entry=0x1149428, stmt=stmt@entry=0x10fa120) at extension.c:1725 #13 0x0000000000720cdf in ProcessUtilitySlow (pstate=pstate@entry=0x1149428, pstmt=pstmt@entry=0x10fa440,     queryString=queryString@entry=0x10f9738 "create extension \"uuid-ossp\" ;", context=context@entry=PROCESS_UTILITY_TOPLEVEL, params=params@entry=0x0,     queryEnv=queryEnv@entry=0x0, completionTag=completionTag@entry=0x7ffcd9091930 "", dest=0x10fa520) at utility.c:1352 #14 0x000000000071fa6f in standard_ProcessUtility (pstmt=0x10fa440, queryString=0x10f9738 "create extension \"uuid-ossp\" ;", context=PROCESS_UTILITY_TOPLEVEL,     params=0x0, queryEnv=0x0, dest=0x10fa520, completionTag=0x7ffcd9091930 "") at utility.c:931 #15 0x000000000071d368 in PortalRunUtility (portal=0x114a4c8, pstmt=0x10fa440, isTopLevel=, setHoldSnapshot=, dest=0x10fa520,     completionTag=0x7ffcd9091930 "") at pquery.c:1178 #16 0x000000000071dda7 in PortalRunMulti (portal=portal@entry=0x114a4c8, isTopLevel=isTopLevel@entry=1 '\001', setHoldSnapshot=setHoldSnapshot@entry=0 '\000', ---Type to continue, or q to quit---     dest=dest@entry=0x10fa520, altdest=altdest@entry=0x10fa520, completionTag=completionTag@entry=0x7ffcd9091930 "") at pquery.c:1331 #17 0x000000000071e995 in PortalRun (portal=, count=9223372036854775807, isTopLevel=, run_once=, dest=0x10fa520,     altdest=0x10fa520, completionTag=0x7ffcd9091930 "") at pquery.c:799 #18 0x000000000071aa13 in exec_simple_query (query_string=) at postgres.c:1122 #19 0x000000000071bd0c in PostgresMain (argc=, argv=, dbname=, username=) at postgres.c:4117 #20 0x000000000047b246 in BackendRun (port=0x1098a20) at postmaster.c:4405 #21 BackendStartup (port=0x1098a20) at postmaster.c:4077 #22 ServerLoop () at postmaster.c:1755 #23 0x00000000006b25ef in PostmasterMain (argc=argc@entry=3, argv=argv@entry=0x1070bc0) at postmaster.c:1363 #24 0x000000000047c06f in main (argc=3, argv=0x1070bc0) at main.c:228 Thanks, Soni On 22/04/2019 21:04, Tom Lane wrote: > Soni writes: >> When "create extension "uuid-ossp"", I got : >> 2019-04-22 02:41:53.323 UTC [10305] XX000ERROR:  XX000: cache lookup >> failed for function 1 >> 2019-04-22 02:41:53.323 UTC [10305] XX000LOCATION: >> fmgr_info_cxt_security, fmgr.c:184 >> 2019-04-22 02:41:53.323 UTC [10305] XX000STATEMENT:  create extension >> "uuid-ossp" ; > That is just bizarre. uuid-ossp's installation script does nothing > beyond a few simple CREATE FUNCTION commands, so it's really hard to > see how you could be getting to an incorrect function call. > > Do you perhaps have any other extensions installed that could be > running add-on code during DDL commands? I'm thinking of pgaudit > or auto_explain or the like. If so, try disabling those to see > if the problem goes away. > > If that's not it, could we trouble you to get a stack trace of > this problem? Set a breakpoint at errfinish, run the CREATE > EXTENSION, and when it stops send us the output of "bt". > (Make sure that fmgr_info_cxt_security appears one or two levels > down in the trace, else you stopped at the wrong message output.) > > https://wiki.postgresql.org/wiki/Generating_a_stack_trace_of_a_PostgreSQL_backend > > regards, tom lane