From: Heikki Linnakangas <hlinnakangas@vmware.com>
To: sunny99991982@yahoo.com.vn
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7970: How 's list all members in a special tablespace ( not as pg_global & pg_default )
Date: Tue, 19 Mar 2013 16:20:27 +0200
Message-ID: <5148742B.2030002@vmware.com> (raw)
In-Reply-To: <E1UHrm2-0005mw-Bs@wrigleys.postgresql.org>
References: <E1UHrm2-0005mw-Bs@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
On 19.03.2013 10:19, sunny99991982@yahoo.com.vn wrote:
> I tried this, which will get the list of tables belong to 'XYZ' tablespace.
>
> CREATE TABLESPACE TBS1 OWNER access LOCATION '/u03/tbs';
>
> --> OK
>
> Create table public.SinhVien ( MaSV text, TenSV text, Sodt int ) tablespace
> TBS1;
>
> --> OK
>
> Insert into public.SinhVien (MaSV,TenSV,Sodt) Values ('001','Nguyen
> Van',123456789),('002','Nguyen Ha',987654321);
>
> --> OK
>
> select relname from pg_class where reltablespace=(select oid from
> pg_tablespace where spcname='TBS1');
>
> relname
> ---------0
> (0 rows)
>
> why's return 0 rows ? i don't know
You didn't quote the tablespace name in the CREATE TABLESPACE statement,
so it's actually called tbs1, in lower case. Try:
select relname from pg_class where reltablespace=(select oid from
pg_tablespace where spcname='tbs1');
- Heikki
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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-bugs@postgresql.org
Cc: hlinnakangas@vmware.com, sunny99991982@yahoo.com.vn
Subject: Re: BUG #7970: How 's list all members in a special tablespace ( not as pg_global & pg_default )
In-Reply-To: <5148742B.2030002@vmware.com>
References: <E1UHrm2-0005mw-Bs@wrigleys.postgresql.org> <5148742B.2030002@vmware.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