Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 1ABC7B5DBD6 for ; Fri, 17 Jun 2011 20:06:54 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 88835-06 for ; Fri, 17 Jun 2011 23:06:47 +0000 (UTC) X-Greylist: delayed 00:15:54.519013 by SQLgrey-1.7.6 Received: from sam.nabble.com (sam.nabble.com [216.139.236.26]) by mail.postgresql.org (Postfix) with ESMTP id DD3DFB5DBC2 for ; Fri, 17 Jun 2011 20:06:47 -0300 (ADT) Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1QXhsK-0007LE-Dk for pgsql-general@postgresql.org; Fri, 17 Jun 2011 15:50:52 -0700 Date: Fri, 17 Jun 2011 15:50:52 -0700 (PDT) From: hyelluas To: pgsql-general@postgresql.org Message-ID: <1308351052419-4500200.post@n5.nabble.com> Subject: how to find a tablespace for the table? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.778 tagged_above=-5 required=5 tests=BAYES_00=-1.9, URI_HEX=1.122 X-Spam-Level: X-Archive-Number: 201106/519 X-Sequence-Number: 176952 hello, I'm looking into pg_tables view and only one tablespace is displayed is pg_global. All my tables are created in my custom tablespace and that column is empty for them. select * from pg_tablespace show my tablespace, pgAdmin shows that tablespace for each table. I need to query the data dictionary to find the tablespace for the table in my proc. select t.spcname, c.relname AS tablename from pg_class c , pg_tablespace t where t.oid = c.reltablespace does not show my tables, only the dd tables. SELECT COALESCE(tbs.spcname, '*') AS tbsname FROM pg_catalog.pg_class AS t JOIN pg_catalog.pg_namespace AS s ON (s.oid = t.relnamespace) LEFT OUTER JOIN pg_catalog.pg_tablespace AS tbs ON (tbs.oid = t.reltablespace) WHERE t.relname like 'summ%' AND s.nspname = 'public'; returns * please help. thank you. Helen -- View this message in context: http://postgresql.1045698.n5.nabble.com/how-to-find-a-tablespace-for-the-table-tp4500200p4500200.html Sent from the PostgreSQL - general mailing list archive at Nabble.com.