Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mVs1V-0004DG-Ao for pgsql-general@arkaria.postgresql.org; Thu, 30 Sep 2021 09:06:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mVs1S-0004g3-4Z for pgsql-general@arkaria.postgresql.org; Thu, 30 Sep 2021 09:06:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mVs1R-0004fv-Gd for pgsql-general@lists.postgresql.org; Thu, 30 Sep 2021 09:06:33 +0000 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mVs1K-00036l-1J for pgsql-general@lists.postgresql.org; Thu, 30 Sep 2021 09:06:32 +0000 Received: by mail-ed1-x536.google.com with SMTP id s17so19177758edd.8 for ; Thu, 30 Sep 2021 02:06:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=9XSibyEcWaui/mAd1yrP2DwwVtuo1/qy3vBBCb2h/4Y=; b=Giw2LfEEFDzCKOHULmodhwWBUzbNy9dga9RjjBtM+7Y8ztsY8t8YlK/m1ifzXNk1QY fg+1ECyFZ4+we3l6xjE2t4D2HSBBci82E1Grq6GduH7MsSJGh7ePqFq2UeoPDFdNHyI6 NIfUxaRRUNxUmaxVTEDph5aVPRzPJMaQ34MTCCgj4hoQsBnJgsgdSFv/u3MdWbX+uqqc gRSk55tXFoGZmHF1EWP+V98RyZRLKX2j+rwMRv93Q8DVyTkgeuq+riWxLRVO8V0HtuqM X05OKAI71lYErZ2XcYqxj+Lkzs58eEdaxdFppg4OYTcbau2GFb+lE93AVUcuQzq56ZzV Gg3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=9XSibyEcWaui/mAd1yrP2DwwVtuo1/qy3vBBCb2h/4Y=; b=jlL5Yo0mUBqCC8gCocnpumrs6EN7G2Yguur6ZkPT1/2q6r6JfgXIij6epQg1dHrcYx jSmmsmRUlbVRQVRux7ZtwpY4grOFwwZ6cxziFrujj/bhxOvtan9OAYxffwvpeiaLXpJY LpPAkFLTcsgcBUnqHqUjZqogrNNCAZjRJtRKWHUlhQpHyRFFwoigyH55J4/C92GUmvtP 000McUT7SwMgnACMsk2znWgHwoOKqZOADCkBGMOi0sbfB8Ps/phCiQc81VgsRqsEYC+I xV6ty87Xjyhfe+vSnPy6sPocvJCfMpWYwOfJStGf6k+bGkRyg6CjAOwDiUMfcFk6D2ie WRew== X-Gm-Message-State: AOAM530COAnKIDA3KPyXQXZA//KISNwM/4JvvWixUYEIjFYYwpnOTXa3 qY+NYM9arj59EuaGEviGRpok4hGowjI15g08OrmacXKU42QWIuR5sA9x2epZwk1ZbZwUIittQys QUul4AoxEeW3Hfde3QdIJN8e29iwBC6fRDHZeNjMxG9Dz5lBT/Xe5sQ8RCw/cGyeqnQtgA9p825 JGlR/en4RStTv6fE9uxiKj5HqQEjRnylA9VG5epdjGloKq0yOteoKJ9jCm7ytrCjtn3iQQrFOOp y6VLbl3CwmVZ9x8ahPfXjGZ9KTNzhDQQ7qHU6ve8Ddjn4x9gs/fOA== X-Google-Smtp-Source: ABdhPJyWVPeeFbLHXy5/OEIRpLjeumOl9BVtLp2NyynFS75nUruPQj/l4ee4tDht/tNoTxISBJ0uwg== X-Received: by 2002:a17:906:1146:: with SMTP id i6mr5478787eja.12.1632992783632; Thu, 30 Sep 2021 02:06:23 -0700 (PDT) Received: from [10.137.0.18] (static-84-42-175-93.net.upcbroadband.cz. [84.42.175.93]) by smtp.gmail.com with ESMTPSA id g23sm1146214edt.1.2021.09.30.02.06.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Sep 2021 02:06:23 -0700 (PDT) Subject: Re: ERROR: unrecognized node type To: Amine Tengilimoglu Cc: Tom Lane , Adrian Klaver , pgsql-general@lists.postgresql.org References: <2990076.1632935803@sss.pgh.pa.us> <80c95c0d-3d32-8fad-0533-d26ebc2e8e5e@aklaver.com> <2994270.1632940636@sss.pgh.pa.us> From: Tomas Vondra Message-ID: <42a5f581-0482-0c3f-f36e-04c90e6358cb@enterprisedb.com> Date: Thu, 30 Sep 2021 11:06:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 9/30/21 8:38 AM, Amine Tengilimoglu wrote: > ... > Remarkable thing  the related error occurs when executing sql > statements containing where.  The sqls that do not contain a where > are not getting an error. Location information as below; > > ERROR:  XX000: unrecognized node type: 223 > *LOCATION:  exprType, nodeFuncs.c:263* > STATEMENT:  SELECT n.nspname as "Schema", >           c.relname as "Name", >           CASE c.relkind WHEN 'r' THEN 'table' WHEN 'v' THEN 'view' > WHEN 'm' THEN 'materialized view' WHEN 'i' THEN 'index' WHEN 'S' > THEN 'sequence' WHEN 's' THEN 'special' WHEN 'f' THEN 'foreign > table' WHEN 'p' THEN 'partitioned table' WHEN 'I' THEN 'partitioned > index' END as "Type", >           pg_catalog.pg_get_userbyid(c.relowner) as "Owner" >         FROM pg_catalog.pg_class c >              LEFT JOIN pg_catalog.pg_namespace n ON n.oid = > c.relnamespace >         WHERE c.relkind IN ('r','p','v','m','S','f','') >               AND n.nspname <> 'pg_catalog' >               AND n.nspname <> 'information_schema' >               AND n.nspname !~ '^pg_toast' >           AND pg_catalog.pg_table_is_visible(c.oid) >         ORDER BY 1,2; > I'm unable to reproduce the issue, so it probably depends on what tables are created etc. But if you say it only happens with WHERE clause, that's interesting. It suggests the failure probably happens somewhere in transformWhereClause, but we can only speculate why and the query conditions look entirely reasonable. I suggest you do this: 1) start a session, identify the PID of the backend select pg_backend_pid(); 2) attach a debugger (e.g. gdb) to the pid gdb -p $PID 3) set breakpoint to the location in the error message (gdb) break nodeFuncs.c:263 (gdb) continue 4) run the query, the breakpoint should be triggered 5) extract full backtrace (gdb) bt full 6) print the expression (gdb) p nodeToString(expr) That should give us some hints about what might be wrong ... regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company