agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Emi Lu <emilu@encs.concordia.ca>
To: Igor Neyman <ineyman@perceptron.com>
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 10:00:40 -0400
Message-ID: <5571AB88.6050900@encs.concordia.ca> (raw)
In-Reply-To: <A76B25F2823E954C9E45E32FA49D70ECCD45F1F1@mail.corp.perceptron.com>
References: <55707FAA.8060204@encs.concordia.ca>
	<CAKFQuwaCfLjPv1UxfpkQUgN1Fh1AuZS=nHWXWKX5t-=U+9qfBg@mail.gmail.com>
	<55709A8A.7010005@encs.concordia.ca>
	<CAKFQuwb9MYyyQxOFp5QDc1wjQjsZOPJ964KujvRkTFB1VPgM=g@mail.gmail.com>
	<5571A511.9020805@encs.concordia.ca>
	<A76B25F2823E954C9E45E32FA49D70ECCD45F1D7@mail.corp.perceptron.com>
	<A76B25F2823E954C9E45E32FA49D70ECCD45F1F1@mail.corp.perceptron.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">
    <blockquote
cite="mid:A76B25F2823E954C9E45E32FA49D70ECCD45F1F1@mail.corp.perceptron.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@mail.corp.perceptron.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>




view thread (11+ messages)  latest in thread

Message-ID: <5571AB88.6050900@encs.concordia.ca>
Permalink:  ../5571AB88.6050900@encs.concordia.ca/
Also on:    postgresql.org/message-id/5571AB88.6050900@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, ineyman@perceptron.com, david.g.johnston@gmail.com
  Subject: Re: remove tablespace for primary key (*not* by drop/recreate constraint)
  In-Reply-To: <5571AB88.6050900@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