Re: ERREUR: cache lookup failed for function 0 with PostgreSQL 15 beta 2, no error with PostgreSQL 14.4

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Phil Florent <philflorent(at)hotmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, David Rowley <drowley(at)postgresql(dot)org>
Subject: Re: ERREUR: cache lookup failed for function 0 with PostgreSQL 15 beta 2, no error with PostgreSQL 14.4
Date: 2022-08-04 13:33:06
Message-ID: 20220804133306.GM19644@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Aug 04, 2022 at 01:19:59PM +0000, Phil Florent wrote:
> A DSS developer from my company, Julien Roze, reported me an error I cannot explained. Is it a new behavior or a bug ?
>
> Original query is much more complicated but here is a simplified test case with postgresql 14 and 15 beta 2 on Debian 11, packages from pgdg :

Thanks for simplifying and reporting it.

It looks like an issue with window run conditions (commit 9d9c02ccd).

+David

(gdb) b pg_re_throw
(gdb) bt
#0 pg_re_throw () at elog.c:1795
#1 0x0000557c85645e69 in errfinish (filename=<optimized out>, filename(at)entry=0x557c858db7da "fmgr.c", lineno=lineno(at)entry=183, funcname=funcname(at)entry=0x557c858dc410 <__func__.24841> "fmgr_info_cxt_security") at elog.c:588
#2 0x0000557c85650e21 in fmgr_info_cxt_security (functionId=functionId(at)entry=0, finfo=finfo(at)entry=0x557c86a05ad0, mcxt=<optimized out>, ignore_security=ignore_security(at)entry=false) at fmgr.c:183
#3 0x0000557c85651284 in fmgr_info (functionId=functionId(at)entry=0, finfo=finfo(at)entry=0x557c86a05ad0) at fmgr.c:128
#4 0x0000557c84b32c73 in ExecInitFunc (scratch=scratch(at)entry=0x7ffc369a9cf0, node=node(at)entry=0x557c869f59b8, args=0x557c869f5a68, funcid=funcid(at)entry=0, inputcollid=inputcollid(at)entry=0, state=state(at)entry=0x557c86a05620)
at execExpr.c:2748
#5 0x0000557c84b27904 in ExecInitExprRec (node=node(at)entry=0x557c869f59b8, state=state(at)entry=0x557c86a05620, resv=resv(at)entry=0x557c86a05628, resnull=resnull(at)entry=0x557c86a05625) at execExpr.c:1147
#6 0x0000557c84b33a1d in ExecInitQual (qual=0x557c869f5b18, parent=parent(at)entry=0x557c86a05080) at execExpr.c:253
#7 0x0000557c84c8eadb in ExecInitWindowAgg (node=node(at)entry=0x557c869f4d20, estate=estate(at)entry=0x557c86a04e10, eflags=eflags(at)entry=16) at nodeWindowAgg.c:2420
#8 0x0000557c84b8edda in ExecInitNode (node=node(at)entry=0x557c869f4d20, estate=estate(at)entry=0x557c86a04e10, eflags=eflags(at)entry=16) at execProcnode.c:345
#9 0x0000557c84b70ea2 in InitPlan (queryDesc=queryDesc(at)entry=0x557c8695af50, eflags=eflags(at)entry=16) at execMain.c:938
#10 0x0000557c84b71658 in standard_ExecutorStart (queryDesc=queryDesc(at)entry=0x557c8695af50, eflags=16, eflags(at)entry=0) at execMain.c:265
#11 0x0000557c84b71ca4 in ExecutorStart (queryDesc=queryDesc(at)entry=0x557c8695af50, eflags=0) at execMain.c:144
#12 0x0000557c8525292b in PortalStart (portal=portal(at)entry=0x557c869a45e0, params=params(at)entry=0x0, eflags=eflags(at)entry=0, snapshot=snapshot(at)entry=0x0) at pquery.c:517
#13 0x0000557c8524b2a4 in exec_simple_query (
query_string=query_string(at)entry=0x557c86938af0 "with fakedata as (\n", ' ' <repetidos 15 veces>, "select 'hello' word\n", ' ' <repetidos 15 veces>, "union all\n", ' ' <repetidos 15 veces>, "select 'world' word\n)\nselect *\nfrom (\n", ' ' <repetidos 15 veces>, "select word, count(*) over (partition by word) nb fro"...) at postgres.c:1204
#14 0x0000557c8524e8bd in PostgresMain (dbname=<optimized out>, username=username(at)entry=0x557c86964298 "pryzbyj") at postgres.c:4505
#15 0x0000557c85042db6 in BackendRun (port=port(at)entry=0x557c8695a910) at postmaster.c:4490
#16 0x0000557c8504a79a in BackendStartup (port=port(at)entry=0x557c8695a910) at postmaster.c:4218
#17 0x0000557c8504ae12 in ServerLoop () at postmaster.c:1808
#18 0x0000557c8504c926 in PostmasterMain (argc=3, argv=<optimized out>) at postmaster.c:1480
#19 0x0000557c84ce4209 in main (argc=3, argv=0x557c86933000) at main.c:197

(gdb) fr 7
#7 0x0000557c84c8eadb in ExecInitWindowAgg (node=node(at)entry=0x557c869f4d20, estate=estate(at)entry=0x557c86a04e10, eflags=eflags(at)entry=16) at nodeWindowAgg.c:2420
2420 winstate->runcondition = ExecInitQual(node->runCondition,

--
Justin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-08-04 13:41:05 Re: fix typos
Previous Message Amit Langote 2022-08-04 13:21:31 Re: enable/disable broken for statement triggers on partitioned tables