X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id A17894758BD for ; Mon, 3 Feb 2003 21:43:02 -0500 (EST) Received: from netbdc01.devis.com (unknown [209.219.127.12]) by postgresql.org (Postfix) with ESMTP id 194AE475843 for ; Mon, 3 Feb 2003 21:43:02 -0500 (EST) Received: from pool-151-200-238-160.res.east.verizon.net (10.10.10.12 [10.10.10.12]) by netbdc01.devis.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id 1BBRP2TX; Mon, 3 Feb 2003 21:13:19 -0500 Subject: pg_views From: Lex Berezhny To: "'pgsql-sql@postgresql.org'" Content-Type: text/plain Organization: Message-Id: <1044326043.13139.17.camel@buddha> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.1 Date: 03 Feb 2003 21:34:03 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/70 X-Sequence-Number: 11468 hi, I'm trying to write some code that can analyze the database structure and i need a way to discover the composition of a view (the tables and table.column info). I've managed to do much of this by querying the pg_views for the definition and literally parsing the SQL myself, but obviously that has many limitations unless I impliment a complete SQL parser and that's beyond the scope of what I want :-) I'm wondering if PostgreSQL actually reparses the view definition on each invocation or if it stores the required information in some accessible place. My goal is to take a view name as input and output the tables and columns composing the view. thanks in advance, - lex -- Lex Berezhny