Re: Deparsing DDL command strings - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Deparsing DDL command strings
Date
Msg-id 8117.1349445783@sss.pgh.pa.us
Whole thread Raw
In response to Deparsing DDL command strings  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
Responses Re: Deparsing DDL command strings
Re: Deparsing DDL command strings
List pgsql-hackers
Dimitri Fontaine <dimitri@2ndQuadrant.fr> writes:
> So I have a Node *parsetree containing some CHECK and DEFAULT raw
> expressions to work with. Those can reference non existing tables,
> either to-be-created or already-dropped. 

Why don't you just pass the original query string, instead of writing
a mass of maintenance-requiring new code to reproduce it?

This would require (1) making sure the query string is still available
where needed.  I think we are 99% of the way there but maybe not 100%.
(2) being able to identify the substring corresponding to the current
command, when we're processing a multi-command string.  The parser could
easily provide that, I think --- we've just never insisted that it do
so before.
        regards, tom lane



pgsql-hackers by date:

Previous
From: zafer yagmuroglu
Date:
Subject: FW: PQntuples and PQgetvalue problem.
Next
From: Andres Freund
Date:
Subject: Re: Deparsing DDL command strings