agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedFrom: Emi Lu <emilu@encs.concordia.ca>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Re: remove tablespace for primary key (*not* by drop/recreate constraint)
Date: Fri, 05 Jun 2015 09:33:05 -0400
Message-ID: <5571A511.9020805@encs.concordia.ca> (raw)
In-Reply-To: <CAKFQuwb9MYyyQxOFp5QDc1wjQjsZOPJ964KujvRkTFB1VPgM=g@mail.gmail.com>
References: <55707FAA.8060204@encs.concordia.ca>
<CAKFQuwaCfLjPv1UxfpkQUgN1Fh1AuZS=nHWXWKX5t-=U+9qfBg@mail.gmail.com>
<55709A8A.7010005@encs.concordia.ca>
<CAKFQuwb9MYyyQxOFp5QDc1wjQjsZOPJ964KujvRkTFB1VPgM=g@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<blockquote
cite="mid:CAKFQuwb9MYyyQxOFp5QDc1wjQjsZOPJ964KujvRkTFB1VPgM=g@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"><span class="">
<blockquote type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote"
style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">to
remove tablespace for primary key please?<br>
<br>
For example, z1 (c1 text) with pk_z1 PRIMARY
KEY (c1), tablespace "abc"<br>
<br>
May I know how to remove tablespace(set
tablespace to empty for z1)?<br>
</blockquote>
<div><br>
</div>
<div>
<div
style="font-family:arial,helvetica,sans-serif;display:inline">
It doesn't make sense to "remove" a
tablespace...the best you can do is change
a table's (and its related indexes)
tablespace</div>
<div
style="font-family:arial,helvetica,sans-serif;display:inline"></div>
<div
style="font-family:arial,helvetica,sans-serif;display:inline">
from one to another.</div>
</div>
<div>
<div
style="font-family:arial,helvetica,sans-serif;display:inline"><br>
</div>
</div>
<div>
<div
style="font-family:arial,helvetica,sans-serif;display:inline">If
"ALTER TABLE ... SET TABLESPACE ..."
doesn't accomplish your goal you will need
to explain yourself better.</div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
</span> Want to SET tablespace = '' for primary key but
not table. Tried alter index ... set tablespace='', but
empty does not work? <br>
<br>
</div>
</blockquote>
<div><br>
</div>
<div>
<div class="gmail_default"
style="font-family:arial,helvetica,sans-serif;display:inline">
So, what you want to do is place the primary key index
back onto the default tablespace while the table resides
on a different tablespace?</div>
</div>
<div>
<div class="gmail_default"
style="font-family:arial,helvetica,sans-serif;display:inline"><br>
</div>
</div>
<div>
<div class="gmail_default"
style="font-family:arial,helvetica,sans-serif;display:inline">Does
this work?</div>
</div>
<div>
<div class="gmail_default"
style="font-family:arial,helvetica,sans-serif;display:inline"><br>
</div>
</div>
<div>
<div class="gmail_default"
style="font-family:arial,helvetica,sans-serif;display:inline">ALTER
INDEX ... SET TABLESPACE pg_default;</div>
</div>
</div>
</div>
</div>
</blockquote>
I think this is what I prefer to run. But it seems that schema owner
does not have permission to run it. <br>
<br>
"permission denied for tablespace pg_default"<br>
<br>
Probably only postmaster can run it?<br>
<br>
Thanks a lot!<br>
</body>
</html>
view thread (11+ messages) latest in thread
Message-ID: <5571A511.9020805@encs.concordia.ca>
Permalink: ../5571A511.9020805@encs.concordia.ca/
Also on: postgresql.org/message-id/5571A511.9020805@encs.concordia.ca
reply
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: emilu@encs.concordia.ca, david.g.johnston@gmail.com
Subject: Re: remove tablespace for primary key (*not* by drop/recreate constraint)
In-Reply-To: <5571A511.9020805@encs.concordia.ca>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox