Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0Zzl-0000U8-5v for pgsql-sql@arkaria.postgresql.org; Thu, 04 Jun 2015 18:36:01 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Z0Zzk-0007Dy-Kc for pgsql-sql@arkaria.postgresql.org; Thu, 04 Jun 2015 18:36:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Z0Zzj-0007CF-3V for pgsql-sql@postgresql.org; Thu, 04 Jun 2015 18:35:59 +0000 Received: from oldperseverance.encs.concordia.ca ([132.205.96.92]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1Z0Zzf-0005sQ-2t for pgsql-sql@postgresql.org; Thu, 04 Jun 2015 18:35:58 +0000 Received: from cacao.encs.concordia.ca (emilu@cacao.encs.concordia.ca [132.205.47.225]) by oldperseverance.encs.concordia.ca (envelope-from emilu@encs.concordia.ca) (8.13.7/8.13.7) with ESMTP id t54IZs5Z018943 for ; Thu, 4 Jun 2015 14:35:54 -0400 Message-ID: <55709A8A.7010005@encs.concordia.ca> Date: Thu, 04 Jun 2015 14:35:54 -0400 From: Emi Lu Reply-To: emilu@encs.concordia.ca User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: remove tablespace for primary key (*not* by drop/recreate constraint) References: <55707FAA.8060204@encs.concordia.ca> In-Reply-To: Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.58 on oldperseverance.encs.concordia.ca at 2015-06-04 14:35:54 EDT X-Pg-Spam-Score: -3.5 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org Hello, 
to remove tablespace for primary key please?

For example, z1 (c1 text) with pk_z1 PRIMARY KEY (c1), tablespace "abc"

May I know how to remove tablespace(set tablespace to empty for z1)?

​ It doesn't make sense to "remove" a tablespace...the best you can do is change a table's (and its related indexes) tablespace
​
 
​ from one to another.

If "ALTER TABLE ... SET TABLESPACE ..." doesn't accomplish your goal you will need to explain yourself better.

Want to SET tablespace = '' for primary key but not table. Tried alter index ... set tablespace='', but empty does not work?

Thanks