Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UHxP1-0003G6-V3 for pgsql-bugs@arkaria.postgresql.org; Tue, 19 Mar 2013 14:20:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UHxP1-0007fE-AJ for pgsql-bugs@arkaria.postgresql.org; Tue, 19 Mar 2013 14:20:35 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UHxP0-0007ez-CB for pgsql-bugs@postgresql.org; Tue, 19 Mar 2013 14:20:34 +0000 Received: from smtp-outbound-2.vmware.com ([208.91.2.13]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UHxOx-0007qy-Vn for pgsql-bugs@postgresql.org; Tue, 19 Mar 2013 14:20:33 +0000 Received: from sc9-mailhost2.vmware.com (sc9-mailhost2.vmware.com [10.113.161.72]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id A269E98335; Tue, 19 Mar 2013 07:20:30 -0700 (PDT) Received: from zcs-prod-ext-mta-1.vmware.com (zcs-prod-ext-mta-1.vmware.com [10.113.62.223]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 9EF67B0377; Tue, 19 Mar 2013 07:20:30 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTP id BECED1219DA; Tue, 19 Mar 2013 07:24:21 -0700 (PDT) X-Virus-Scanned: amavisd-new at zcs-prod-ext-mta-1.vmware.com Received: from zcs-prod-ext-mta-1.vmware.com ([127.0.0.1]) by localhost (zcs-prod-ext-mta-1.vmware.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lI9_wofQQX-A; Tue, 19 Mar 2013 07:24:21 -0700 (PDT) Received: from zcs-prod-ext-mta-1.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTP id 9DB871219D5; Tue, 19 Mar 2013 07:24:21 -0700 (PDT) Received: from [192.168.1.90] (zimbra-prod-ext-proxy-vip.vmware.com [10.113.63.87]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTPSA; Tue, 19 Mar 2013 07:24:20 -0700 (PDT) Message-ID: <5148742B.2030002@vmware.com> Date: Tue, 19 Mar 2013 16:20:27 +0200 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 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 ) References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -9.4 (---------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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