Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 3C7869FA5B5 for ; Mon, 5 Nov 2007 15:42:42 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 18950-03-4 for ; Mon, 5 Nov 2007 15:42:14 -0400 (AST) Received: from mail.refractions.net (mail.refractions.net [24.68.236.214]) by postgresql.org (Postfix) with ESMTP id 9F9339FB4A4 for ; Mon, 5 Nov 2007 15:25:13 -0400 (AST) Received: from [192.168.50.44] (unknown [192.168.50.44]) by mail.refractions.net (Postfix) with ESMTP id 6A7EB122C2AA for ; Mon, 5 Nov 2007 10:46:51 -0800 (PST) Message-ID: <472F6509.10908@refractions.net> Date: Mon, 05 Nov 2007 10:46:33 -0800 From: Kevin Neufeld User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Parsed Query Trees Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/4 X-Sequence-Number: 17759 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