Re: Convert stmt back into queryString - Mailing list pgsql-hackers

From Dan Colish
Subject Re: Convert stmt back into queryString
Date
Msg-id 20090805021243.GN3109@blackbox.spiretech.com
Whole thread Raw
In response to Re: Convert stmt back into queryString  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Convert stmt back into queryString
List pgsql-hackers
On Tue, Aug 04, 2009 at 10:00:24PM -0400, Tom Lane wrote:
> Dan Colish <dan@unencrypted.org> writes:
> >     I am currently trying to convert an insertstmt back into a const
> >     char *queryString, but I can't find an existing function to do this
> >     for the life of me.  I will write one if none exits, but I figured I
> >     ask here first.  Unfortunately, nodeToString is not quite right for
> >     what I'm doing. Thanks in advance.
> 
> Hmm, you mean a Query, or a raw unanalyzed InsertStmt?  If the former,
> ruleutils.c will help.  If the latter, be prepared to write a lot of
> code; there's nothing closer than nodeToString, and even that is pretty
> incomplete for raw grammar output nodes IIRC.
> 
>             regards, tom lane

In this case, its a raw InsertStmt. I would like to pass this back to
parse_analyze, but I need to have a queryString to go with that call, so
crafting a function to rate that seems to be the only way, atm.

--
--Dan


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Convert stmt back into queryString
Next
From: Joe Conway
Date:
Subject: Re: async notification patch for dblink