Re: How to use the SQL parser subsystem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Ravindra Jaju <list(dot)jaju(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: How to use the SQL parser subsystem
Date: 2007-01-04 15:20:42
Message-ID: 16997.1167924042@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> On Thu, Jan 04, 2007 at 08:01:17PM +0530, Ravindra Jaju wrote:
>> 2] If yes, I found that none of the shared library files expose this
>> function - I could not link a simple C program with this function
>> successfully. (I tried all the .so files related to postgres! :-()

> It's inside the server, it's not in a seperate library. To use it you
> need to be inside the server.

By and large there is no part of the backend that is designed to be run
standalone --- almost everything relies on palloc and elog, for instance.
I concur with the suggestion to consider doing this as a backend
function rather than in a standalone program.

Note that what raw_parser gives you is the raw grammar output, which is
probably not really what you want. For almost any sort of interesting
analysis, I'd think you'd want to run the syntax tree through
parse_analyze() or one of its siblings, so that semantic interpretation
gets done. There is definitely no hope of pulling out parse_analyze(),
because it has to consult the catalogs ...

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Arindam 2007-01-04 15:33:21 Moving from 7.2.1 to 8.1.5 - looking for jdbc
Previous Message Ravindra Jaju 2007-01-04 15:20:10 Re: How to use the SQL parser subsystem