Re: Adding XMLEXISTS to the grammar - Mailing list pgsql-hackers

From Mike Fowler
Subject Re: Adding XMLEXISTS to the grammar
Date
Msg-id 4C20F03A.5010001@mlfowler.com
Whole thread Raw
In response to Re: Adding XMLEXISTS to the grammar  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Adding XMLEXISTS to the grammar  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
> Look at how the POSITION() pseudofunction is defined around gram.y
> line 9651.  Essentially any special syntax of this type gets converted
> to a regular function call internally.  So in your case I think there
> will be some function that gets called something ike this:
>
> xmlexists(xpath_expression, xml_expression)
>
> ...but the grammar can be modified to allow a different syntax for
> that function call.
>   
I've finally managed to get gram.y to parse the syntax correctly. After 
progressing from a segmentation fault that occured when the grammar was 
correct I'm now left with a cryptic error:

xmltest=# SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beers' 
PASSING BY REF data);
ERROR:  unrecognized node type: 1852140847

At a guess there is another step that I need to do after modifying 
gram.y. One mailing list posting I found mentioned copyfuncs.c but 
really I'm unsure as to what next. Anyone know what the missing step is?

Regards,

-- 
Mike Fowler
Registered Linux user: 379787



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: TCP keepalive support for libpq
Next
From: Alvaro Herrera
Date:
Subject: Re: missing "else" in postmaster.c?