pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: hyelluas <helen_yelluas@mcafee.com>
To: pgsql-general@postgresql.org
Subject: how to find a tablespace for the table?
Date: Fri, 17 Jun 2011 15:50:52 -0700 (PDT)
Message-ID: <1308351052419-4500200.post@n5.nabble.com> (raw)

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.htm...
Sent from the PostgreSQL - general mailing list archive at Nabble.com.



view thread (16+ messages)  latest in thread

Message-ID: <1308351052419-4500200.post@n5.nabble.com>
Permalink:  ../1308351052419-4500200.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1308351052419-4500200.post@n5.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: helen_yelluas@mcafee.com
  Subject: Re: how to find a tablespace for the table?
  In-Reply-To: <1308351052419-4500200.post@n5.nabble.com>
  References: <1308351052419-4500200.post@n5.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox