Re: how to find a tablespace for the table?

From: Raghavendra <raghavendra(dot)rao(at)enterprisedb(dot)com>
To: hyelluas <helen_yelluas(at)mcafee(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: how to find a tablespace for the table?
Date: 2011-06-20 19:27:41
Message-ID: BANLkTik-59+H6ZYnT3N+LHk27YFmNvv3VQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

let me correct on this query, it shows only those tables which wont belong
to default_tablespace...

select relname,reltablespace from pg_class where reltablespace
in(select oid from pg_tablespace where spcname not in
('pg_default','pg_global'));

---
Best Regards,
Raghavendra
EnterpriseDB Corporation
Blog: http://raghavt.blogspot.com/

On Tue, Jun 21, 2011 at 12:55 AM, Raghavendra <
raghavendra(dot)rao(at)enterprisedb(dot)com> wrote:

> hmmm....Strange..
>
> What is the output of
>
> select oid,* from pg_tablespace;
>
> and
>
> select relname,reltablespace from pg_class where relname='
> application_category';
>
>
> ---
> Best Regards,
> Raghavendra
> EnterpriseDB Corporation
> Blog: http://raghavt.blogspot.com/
>
>
>
> On Tue, Jun 21, 2011 at 12:48 AM, hyelluas <helen_yelluas(at)mcafee(dot)com>wrote:
>
>> well,
>>
>> here is the query :
>>
>> profiler1=# select relname,reltablespace from pg_class where reltablespace
>> in(select oid from pg_tablespace where spcname not in
>> ('pg_default','pg_global'));
>> relname | reltablespace
>> ---------+---------------
>>
>>
>> why it shows no records?
>>
>> profiler1=# select * from pg_catalog.pg_tables where
>> tablename='application_category';
>> schemaname | tablename | tableowner | tablespace | hasindexes
>> |
>> hasrules | hastrigge
>> rs
>>
>> ------------+----------------------+------------+------------+------------+----------+----------
>> ---
>> public | application_category | postgres | | t
>> |
>> f | f
>> (1 row)
>>
>>
>> and that query show empty for the tablespace...
>>
>> thank you
>> Helen
>>
>> --
>> View this message in context:
>> http://postgresql.1045698.n5.nabble.com/how-to-find-a-tablespace-for-the-table-tp4500200p4507624.html
>> Sent from the PostgreSQL - general mailing list archive at Nabble.com.
>>
>> --
>> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-general
>>
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Leon Match 2011-06-20 19:32:31 insert a SYSTIMESTAMP value in postgres
Previous Message Raghavendra 2011-06-20 19:25:51 Re: how to find a tablespace for the table?