Re: [GENERAL] Sequences not moved to new tablespace

2015-03-03 Thread Bruce Momjian
On Tue, Feb 24, 2015 at 10:32:42AM -0500, Tom Lane wrote: > For implementation reasons, ALTER DATABASE SET TABLESPACE refuses the > case where the database already has some tables that have been explicitly > placed into that tablespace. (I forget the exact reason for this, but > it's got something

Re: [GENERAL] Sequences not moved to new tablespace

2015-02-25 Thread Albe Laurenz
Guillaume Drolet wrote: If you want to move a whole database to a different tablespace (the only reason I can think of for doing what you are trying to so), use the command ALTER DATABASE ... SET TABLESPACE ... >>> Thanks Laurenz. I tried your suggestion: >>> >>> psql -U postg

Re: [GENERAL] Sequences not moved to new tablespace

2015-02-24 Thread Guillaume Drolet
2015-02-24 10:39 GMT-05:00 Albe Laurenz : > Guillaume Drolet wrote: > >> If you want to move a whole database to a different tablespace (the > only reason > >> I can think of for doing what you are trying to so), use the command > >> ALTER DATABASE ... SET TABLESPACE ... > > > Thanks Laurenz. I tr

Re: [GENERAL] Sequences not moved to new tablespace

2015-02-24 Thread Guillaume Drolet
2015-02-24 10:18 GMT-05:00 Adrian Klaver : > On 02/24/2015 07:10 AM, Guillaume Drolet wrote: > >> >> >> > >> >> So how did all this stuff get into the non-default tablespace in the >> first place? >> >> >> Stuff got there using the ALTER TABLE.../ALTER INDEX... SQL files >> mentionned in m

Re: [GENERAL] Sequences not moved to new tablespace

2015-02-24 Thread Guillaume Drolet
2015-02-24 10:32 GMT-05:00 Tom Lane : > Adrian Klaver writes: > > On 02/24/2015 07:10 AM, Guillaume Drolet wrote: > >> That makes sense. I will give it a try. Thanks. > > > Alright, now I am thoroughly confused:) I thought this is how you to > > this point, using the above commands to move from t

Re: [GENERAL] Sequences not moved to new tablespace

2015-02-24 Thread Albe Laurenz
Guillaume Drolet wrote: >> If you want to move a whole database to a different tablespace (the only >> reason >> I can think of for doing what you are trying to so), use the command >> ALTER DATABASE ... SET TABLESPACE ... > Thanks Laurenz. I tried your suggestion: > > psql -U postgres -c "ALTER

Re: [GENERAL] Sequences not moved to new tablespace

2015-02-24 Thread Adrian Klaver
On 02/24/2015 07:32 AM, Tom Lane wrote: Adrian Klaver writes: On 02/24/2015 07:10 AM, Guillaume Drolet wrote: That makes sense. I will give it a try. Thanks. Alright, now I am thoroughly confused:) I thought this is how you to this point, using the above commands to move from the non-defaul

Re: [GENERAL] Sequences not moved to new tablespace

2015-02-24 Thread Tom Lane
Adrian Klaver writes: > On 02/24/2015 07:10 AM, Guillaume Drolet wrote: >> That makes sense. I will give it a try. Thanks. > Alright, now I am thoroughly confused:) I thought this is how you to > this point, using the above commands to move from the non-default > tablespace back to the default

Re: [GENERAL] Sequences not moved to new tablespace

2015-02-24 Thread Adrian Klaver
On 02/24/2015 07:10 AM, Guillaume Drolet wrote: So how did all this stuff get into the non-default tablespace in the first place? Stuff got there using the ALTER TABLE.../ALTER INDEX... SQL files mentionned in my previous post. The answer would seem to be just reverse whate

Re: [GENERAL] Sequences not moved to new tablespace

2015-02-24 Thread Guillaume Drolet
2015-02-24 10:06 GMT-05:00 Adrian Klaver : > On 02/24/2015 05:06 AM, Guillaume Drolet wrote: > >> >> >> 2015-02-24 7:07 GMT-05:00 Guillaume Drolet > >: >> >> >> >> 2015-02-23 14:14 GMT-05:00 Adrian Klaver > >: >> >> >>

Re: [GENERAL] Sequences not moved to new tablespace

2015-02-24 Thread Guillaume Drolet
2015-02-24 8:45 GMT-05:00 Albe Laurenz : > Guillaume Drolet wrote: > > Digging a little more, I found that not only sequences were not moved > but also many tables in > > pg_catalog are still in my old tablespace. This is expected since the > query in the SQL files I used to > > move the tables an

Re: [GENERAL] Sequences not moved to new tablespace

2015-02-24 Thread Adrian Klaver
On 02/24/2015 05:06 AM, Guillaume Drolet wrote: 2015-02-24 7:07 GMT-05:00 Guillaume Drolet mailto:droletguilla...@gmail.com>>: 2015-02-23 14:14 GMT-05:00 Adrian Klaver mailto:adrian.kla...@aklaver.com>>: On 02/23/2015 10:08 AM, Guillaume Drolet wrote: Hello,

Re: [GENERAL] Sequences not moved to new tablespace

2015-02-24 Thread Albe Laurenz
Guillaume Drolet wrote: > Digging a little more, I found that not only sequences were not moved but > also many tables in > pg_catalog are still in my old tablespace. This is expected since the query > in the SQL files I used to > move the tables and indexes had a WHERE clause like this: > > SEL

Re: [GENERAL] Sequences not moved to new tablespace

2015-02-24 Thread Guillaume Drolet
2015-02-24 7:07 GMT-05:00 Guillaume Drolet : > > > 2015-02-23 14:14 GMT-05:00 Adrian Klaver : > > On 02/23/2015 10:08 AM, Guillaume Drolet wrote: >> >>> Hello, >>> >>> I moved all my tables and indexes from one tablespace to pg_default using >>> >>> ALTER TABLE ... SET TABLESPACE pg_default; >>> A

Re: [GENERAL] Sequences not moved to new tablespace

2015-02-24 Thread Guillaume Drolet
2015-02-23 14:14 GMT-05:00 Adrian Klaver : > On 02/23/2015 10:08 AM, Guillaume Drolet wrote: > >> Hello, >> >> I moved all my tables and indexes from one tablespace to pg_default using >> >> ALTER TABLE ... SET TABLESPACE pg_default; >> ALTER INDEX ... SET TABLESPACE pg_default; >> >> Some 2500 fi

Re: [GENERAL] Sequences not moved to new tablespace

2015-02-23 Thread Adrian Klaver
On 02/23/2015 10:08 AM, Guillaume Drolet wrote: Hello, I moved all my tables and indexes from one tablespace to pg_default using ALTER TABLE ... SET TABLESPACE pg_default; ALTER INDEX ... SET TABLESPACE pg_default; Some 2500 files were moved to pg_default but 461 files remain in the tablespace

Re: [GENERAL] Sequences not moved to new tablespace

2015-02-23 Thread Adrian Klaver
On 02/23/2015 10:08 AM, Guillaume Drolet wrote: Hello, I moved all my tables and indexes from one tablespace to pg_default using ALTER TABLE ... SET TABLESPACE pg_default; ALTER INDEX ... SET TABLESPACE pg_default; Some 2500 files were moved to pg_default but 461 files remain in the tablespace

Re: [GENERAL] Sequences not moved to new tablespace

2015-02-23 Thread Adrian Klaver
On 02/23/2015 10:08 AM, Guillaume Drolet wrote: Hello, I moved all my tables and indexes from one tablespace to pg_default using ALTER TABLE ... SET TABLESPACE pg_default; ALTER INDEX ... SET TABLESPACE pg_default; Some 2500 files were moved to pg_default but 461 files remain in the tablespace