pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Neufeld <kneufeld@refractions.net>
To: pgsql-jdbc@postgresql.org
Subject: Parsed Query Trees
Date: Mon, 05 Nov 2007 10:46:33 -0800
Message-ID: <472F6509.10908@refractions.net> (raw)

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@refractions.net




view thread (4+ messages)  latest in thread

Message-ID: <472F6509.10908@refractions.net>
Permalink:  ../472F6509.10908@refractions.net/
Also on:    postgresql.org/message-id/472F6509.10908@refractions.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: kneufeld@refractions.net
  Subject: Re: Parsed Query Trees
  In-Reply-To: <472F6509.10908@refractions.net>
  References: <472F6509.10908@refractions.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox