From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Dan Colish <dan(at)unencrypted(dot)org> |
Cc: | PGHACKERS <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Convert stmt back into queryString |
Date: | 2009-08-05 02:55:07 |
Message-ID: | 27974.1249440907@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Dan Colish <dan(at)unencrypted(dot)org> writes:
> On Tue, Aug 04, 2009 at 10:00:24PM -0400, Tom Lane wrote:
>> Hmm, you mean a Query, or a raw unanalyzed InsertStmt?
> 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.
Hm, so you have an InsertStmt but not the text it was generated from?
Where? By and large the design plan is that the source text should
still be available anyplace that's dealing with raw parsetrees.
I believe you can just pass NULL as the querystring --- the only thing
you lose from that is syntax location pointers in error messages. But
in ordinary situations you shouldn't have to. (Also, the fact that
that's what the string is used for means that ginning up a string from
the nodetree is a bit pointless. It won't contain the detail that it's
meant to provide.)
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | David E. Wheeler | 2009-08-05 02:58:01 | Re: md.c should not call files "relations" |
Previous Message | Greg Stark | 2009-08-05 02:53:02 | Re: the case for machine-readable error fields |