pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #7970: How 's list all members in a special tablespace ( not as pg_global & pg_default )
2+ messages / 2 participants
[nested] [flat]

* BUG #7970: How 's list all members in a special tablespace ( not as pg_global & pg_default )
@ 2013-03-19 08:19  sunny99991982@yahoo.com.vn
  0 siblings, 1 reply; 2+ messages in thread

From: sunny99991982@yahoo.com.vn @ 2013-03-19 08:19 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      7970
Logged by:          How 's list all members in a special tablespace
Email address:      sunny99991982@yahoo.com.vn
PostgreSQL version: 9.0.4
Operating system:   Enterpride linux 5 x86_64
Description:        

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 rows)

why's return 0 rows ? i don't know

please help me.



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #7970: How 's list all members in a special tablespace ( not as pg_global & pg_default )
@ 2013-03-19 14:20  Heikki Linnakangas <hlinnakangas@vmware.com>
  parent: sunny99991982@yahoo.com.vn
  0 siblings, 0 replies; 2+ messages in thread

From: Heikki Linnakangas @ 2013-03-19 14:20 UTC (permalink / raw)
  To: sunny99991982@yahoo.com.vn; +Cc: pgsql-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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2013-03-19 14:20 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-03-19 08:19 BUG #7970: How 's list all members in a special tablespace ( not as pg_global & pg_default ) sunny99991982@yahoo.com.vn
2013-03-19 14:20 ` Heikki Linnakangas <hlinnakangas@vmware.com>

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