Re: remove tablespace for primary key (*not* by drop/recreate constraint)
От | Emi Lu |
---|---|
Тема | Re: remove tablespace for primary key (*not* by drop/recreate constraint) |
Дата | |
Msg-id | 5571AB88.6050900@encs.concordia.ca обсуждение исходный текст |
Ответ на | Re: remove tablespace for primary key (*not* by drop/recreate constraint) (Igor Neyman <ineyman@perceptron.com>) |
Список | pgsql-sql |
<blockquote cite="mid:A76B25F2823E954C9E45E32FA49D70ECCD45F1F1@mail.corp.perceptron.com" type="cite"><div class="WordSection1"><pclass="MsoNormal"><br /><blockquote style="margin-top:5.0pt;margin-bottom:5.0pt"><div><div><div><blockquotestyle="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><blockquotestyle="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_z1PRIMARY KEY (c1), tablespace "abc"<br /> how to remove tablespace(set tablespace to empty for z1)?</blockquote></div></div></div></blockquote></div></blockquote><div><div><pclass="MsoNormal"><span style="font-family:"Arial",sans-serif">ALTERINDEX ... SET TABLESPACE pg_default;</span></div></div></div></div></div></blockquote><divstyle="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 doesnot have permission to run it. <br /><br /> "permission denied for tablespace pg_default"<br /><br /> Probably only postmastercan run it?<br /><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"></span></div></div></blockquote><blockquote cite="mid:A76B25F2823E954C9E45E32FA49D70ECCD45F1F1@mail.corp.perceptron.com"type="cite"><div class="WordSection1"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"></span> <p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">GRANTUSAGE ON SCHEMA…</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">GRANTCREATE ON SCHEMA…</span></div></blockquote>schema owner already have full control for the whole schema, this username can create/droptables/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 settablespace abc; (success) <br /> . alter index pk_z1 set tablespace test (permission denied) <br /> . alter index pk_z1set tablespace pg_default (permission denied) <br /><br />
В списке pgsql-sql по дате отправления: