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 6E2768BA146 for ; Tue, 15 Feb 2005 11:17:47 +0000 (GMT) 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 26669-06 for ; Tue, 15 Feb 2005 11:17:43 +0000 (GMT) Received: from mail.ccl.ru (mail.ccl.ru [195.222.130.78]) by svr1.postgresql.org (Postfix) with ESMTP id 6EEB58BA143 for ; Tue, 15 Feb 2005 11:17:41 +0000 (GMT) Received: from s02.mz.intra (mail.mz.perm.ru [195.222.139.86]) by mail.ccl.ru (8.13.1/8.13.1) with ESMTP id j1FBHclJ091020 for ; Tue, 15 Feb 2005 16:17:39 +0500 (YEKT) Received: from server1c ([192.168.22.73]) by s02.mz.intra with Microsoft SMTPSVC(6.0.3790.0); Tue, 15 Feb 2005 16:15:59 +0500 Date: Tue, 15 Feb 2005 16:15:51 +0500 From: Mihail Nasedkin X-Mailer: The Bat! (v2.00) CD5BF9353B3B7091 Reply-To: Mihail Nasedkin X-Priority: 3 (Normal) Message-ID: <15115500796.20050215161551@mail.ru> To: pgsql-sql@postgresql.org Subject: Re: How to view the list of tables? In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit X-OriginalArrivalTime: 15 Feb 2005 11:15:59.0358 (UTC) FILETIME=[B9FC21E0:01C5134F] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.167 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200502/151 X-Sequence-Number: 20262 Hello, Konstantin. You wrote February, 15 2005 Ç., 15:16:57: KD> I need to view the list of tables in a database. In MySQL I KD> can do it with the command "SHOW TABLES". What about PostgreSQL? All tables: select ... from pg_catalog.pg_class where c.relkind='r'; All tables of the public schema: select ... from pg_catalog.pg_class c join pg_catalog.pg_namespace n on c.relnamespace=n.oid where c.relkind='r' and n.nspname='public'; KD> Can I also see somehow the datatypes of tables' fields? select ... from pg_catalog.pg_class c join pg_catalog.pg_attribute a on c.oid=a.attrelid join pg_catalog.pg_type t on a.atttypid=t.oid See also: \d pg_class \d pg_namespace \d pg_attribute \d pg_type -- rgds, Mihail mailto:m.nasedkin.perm@mail.ru