Re: Getting "ERROR: unrecognized node type: 444" while creating an AST - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Getting "ERROR: unrecognized node type: 444" while creating an AST
Date
Msg-id 746346.1728095325@sss.pgh.pa.us
Whole thread Raw
In response to Getting "ERROR: unrecognized node type: 444" while creating an AST  (Amaan Haque <amaanhaque@microsoft.com>)
List pgsql-hackers
Amaan Haque <amaanhaque@microsoft.com> writes:
> I’m trying to create an AST representation of a query for the `INSERT` operation. ...

> I found through logs that the error originates from line 2053 in `NodeFuncs.c`. I can’t correlate the unrecognized
nodeto any enum value in `Nodes.h`. Any pointers on how to navigate that file would be greatly appreciated! 

I think most of us rely on gdb these days.  In community v16
I get:

(gdb) p (NodeTag) 444
$1 = T_String

You might have better luck identifying just where it's failing
if you recompile nodeFuncs.c with -O0.

The most obviously fishy thing I'm seeing in your code is

>     A_Expr *onConflictWhereExpr = makeSimpleA_Expr(AEXPR_OP, "<", (Node *)conflictColumnRef,
>         (Node *)makeConst(INT8OID, -1, InvalidOid, sizeof(int64),
>         Int64GetDatum((int)myTimestamp), false, true), -1);

An A_Expr is only valid in raw_parser output, but what you seem
to be trying to construct is a post-parse-analysis tree.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: POC, WIP: OR-clause support for indexes
Next
From: Tatsuo Ishii
Date:
Subject: Re: SET ROLE and parameter status