Skip site navigation (1) Skip section navigation (2)

Parsed Query Trees

From: Kevin Neufeld <kneufeld(at)refractions(dot)net>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Parsed Query Trees
Date: 2007-11-05 18:46:33
Message-ID: 472F6509.10908@refractions.net (view raw or flat)
Thread:
Lists: pgsql-jdbc
Does anyone know if a parsed query tree object is exposed in the jdbc 
API?  I couldn't find any such thing, nor could I find it in the 
developers roadmap.

My particular requirement is that I need to be able to parse / 
deconstruct an arbitrary SELECT query (which may be overly complicated) 
and add custom filters to the WHERE clause depending on what columns 
(optionally schema-qualified) and server datatypes are specified in the 
select clause.

I'm currently use a sql parser that I wrote, but it seems silly to have 
to re-invent the wheel.  I suppose I could use a 3rd party jar, like 
sql4j or Zsql, but these are rather old and simplistic and don't seem to 
do what I need them to do.  Postgres is already parsing my sql queries - 
it would just be nice to have access to these parsed query trees so I 
can edit and then resend them to the database.

Cheers,
Kevin

-------------
Kevin Neufeld
Software Developer
Refractions Research Inc.
300-1207 Douglas St.
Victoria, B.C., V8W 2E7

Phone: (250) 383-3022
Email: kneufeld(at)refractions(dot)net


Responses

pgsql-jdbc by date

Next:From: Oliver JowettDate: 2007-11-05 22:53:48
Subject: Re: Parsed Query Trees
Previous:From: Heikki LinnakangasDate: 2007-11-02 20:56:01
Subject: Re: storing large arrays of floats

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group