X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D97EA54304 for ; Sun, 24 Apr 2005 15:02:27 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 28091-07 for ; Sun, 24 Apr 2005 18:02:17 +0000 (GMT) Received: from home.chandlerfamily.org.uk (82-44-22-127.cable.ubr06.croy.blueyonder.co.uk [82.44.22.127]) by svr1.postgresql.org (Postfix) with ESMTP id 74131542F9 for ; Sun, 24 Apr 2005 15:02:13 -0300 (ADT) Received: from kanger.home ([192.168.0.21]) by home.chandlerfamily.org.uk with esmtp (Exim 4.50) id 1DPlQq-0007Dm-MY for pgsql-sql@postgresql.org; Sun, 24 Apr 2005 19:02:12 +0100 From: Alan Chandler To: pgsql-sql@postgresql.org Subject: Matching the MYSQL "Describe " command Date: Sun, 24 Apr 2005 19:02:16 +0100 User-Agent: KMail/1.8 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200504241902.16770.alan@chandlerfamily.org.uk> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.842 tagged_above=0 required=5 tests=FORGED_RCVD_HELO, RCVD_IN_NJABL_DUL, RCVD_IN_SORBS_DUL X-Spam-Level: * X-Archive-Number: 200504/365 X-Sequence-Number: 21258 I am rather new to Postgres (running 7.4) but I am trying to port some PHP code that has been built to run with mysql. I have got stuck trying to find the equivalent of the Mysql "DESCRIBE ;" SQL statement that lists the columns and type identifiers of a table. I think I am going to do a SELECT on the "pg_attribute" table, but I don't understand what the "attrelid" column of that table refers to. I need to get the table name of the column so that I can restrict the select with a WHERE clause so I assumed it was a key into the pg_class table, but I can't see a column in this table that could potentially correspond and therefore I could join to it. Help -- Alan Chandler http://www.chandlerfamily.org.uk