From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: Amine Tengilimoglu <aminetengilimoglu@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: ERROR: unrecognized node type
Date: Thu, 30 Sep 2021 11:06:21 +0200
Message-ID: <42a5f581-0482-0c3f-f36e-04c90e6358cb@enterprisedb.com> (raw)
In-Reply-To: <CADTdw-wtwq2qqQPZm5Nr3ZJSsLwhkVVnadjC1c0XnyZinaRX4A@mail.gmail.com>
References: <CADTdw-yGfNyHSLXajBFgCEod9dCh8Ys2=9j-gNh6kX5oEpkRNA@mail.gmail.com>
<2990076.1632935803@sss.pgh.pa.us>
<CADTdw-xJX90ToHcrMxxWvJWssjvbBVunq-W=EfXXu7is7+YobQ@mail.gmail.com>
<80c95c0d-3d32-8fad-0533-d26ebc2e8e5e@aklaver.com>
<2994270.1632940636@sss.pgh.pa.us>
<b75d8a17-f1fd-3b5c-114b-1b98318fbd84@enterprisedb.com>
<CADTdw-wtwq2qqQPZm5Nr3ZJSsLwhkVVnadjC1c0XnyZinaRX4A@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tomas.vondra@enterprisedb.com, aminetengilimoglu@gmail.com, tgl@sss.pgh.pa.us, adrian.klaver@aklaver.com
Subject: Re: ERROR: unrecognized node type
In-Reply-To: <42a5f581-0482-0c3f-f36e-04c90e6358cb@enterprisedb.com>
References: <CADTdw-yGfNyHSLXajBFgCEod9dCh8Ys2=9j-gNh6kX5oEpkRNA@mail.gmail.com> <2990076.1632935803@sss.pgh.pa.us> <CADTdw-xJX90ToHcrMxxWvJWssjvbBVunq-W=EfXXu7is7+YobQ@mail.gmail.com> <80c95c0d-3d32-8fad-0533-d26ebc2e8e5e@aklaver.com> <2994270.1632940636@sss.pgh.pa.us> <b75d8a17-f1fd-3b5c-114b-1b98318fbd84@enterprisedb.com> <CADTdw-wtwq2qqQPZm5Nr3ZJSsLwhkVVnadjC1c0XnyZinaRX4A@mail.gmail.com> <42a5f581-0482-0c3f-f36e-04c90e6358cb@enterprisedb.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox