Re: remove tablespace for primary key (*not* by drop/recreate constraint)

From: Emi Lu <emilu(at)encs(dot)concordia(dot)ca>
To: Igor Neyman <ineyman(at)perceptron(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: remove tablespace for primary key (*not* by drop/recreate constraint)
Date: 2015-06-05 14:00:40
Message-ID: 5571AB88.6050900@encs.concordia.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<blockquote
cite="mid:A76B25F2823E954C9E45E32FA49D70ECCD45F1F1(at)mail(dot)corp(dot)perceptron(dot)com"
type="cite">
<div class="WordSection1">
<p class="MsoNormal"><br>
<o:p></o:p>
</p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC
1.0pt;padding:0in 0in 0in
6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<blockquote
style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<div>
<blockquote
style="border:none;border-left:solid
#CCCCCC 1.0pt;padding:0in 0in 0in
6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<p class="MsoNormal"> z1 (c1 text) with
pk_z1 PRIMARY KEY (c1), tablespace "abc"<br>
how to remove tablespace(set tablespace
to empty for z1)?<o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</blockquote>
<div>
<div>
<p class="MsoNormal"><span
style="font-family:&quot;Arial&quot;,sans-serif">ALTER
INDEX ... SET TABLESPACE pg_default;<o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<div style="border:none;border-bottom:solid windowtext
1.0pt;padding:0in 0in 1.0pt 0in">
<p class="MsoNormal">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>
<span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D"><o:p></o:p></span></p>
</div>
</div>
</blockquote>
<blockquote
cite="mid:A76B25F2823E954C9E45E32FA49D70ECCD45F1F1(at)mail(dot)corp(dot)perceptron(dot)com"
type="cite">
<div class="WordSection1"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D"><o:p></o:p></span> 
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">GRANT
USAGE ON SCHEMA…<o:p></o:p></span><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D"><o:p> 
</o:p></span><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">GRANT
CREATE ON SCHEMA…<o:p></o:p></span></p>
</div>
</blockquote>
schema owner already have full control for the whole schema, this
username can create/drop tables/indexs, even drop schema. I think
the permission is related to the pg_default - the tablespace. For
example, there are 3 tablespaces: pg_default, abc, test (is the one
used by table z1) <br>
<br>
. alter index pk_z1 set tablespace abc; (success) <br>
. alter index pk_z1 set tablespace test (permission denied) <br>
. alter index pk_z1 set tablespace pg_default (permission denied) <br>
<br>
</body>
</html>

Attachment Content-Type Size
unknown_filename text/html 3.8 KB

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Igor Neyman 2015-06-05 14:25:20 Re: remove tablespace for primary key (*not* by drop/recreate constraint)
Previous Message David G. Johnston 2015-06-05 13:59:21 Re: remove tablespace for primary key (*not* by drop/recreate constraint)