Re: Move vs. copy table between databases that share a tablespace?
От
Steven Lembark
Тема
Re: Move vs. copy table between databases that share a tablespace?
Дата
Msg-id
20190403083933.515a990b.lembark@wrkhors.com
Ответ на
Список
Дерево обсуждения
Move vs. copy table between databases that share a tablespace? Steven Lembark <lembark@wrkhors.com>
Re: Move vs. copy table between databases that share a tablespace? Tom Lane <tgl@sss.pgh.pa.us>
Re: Move vs. copy table between databases that share a tablespace? Tom Lane <tgl@sss.pgh.pa.us>
Re: Move vs. copy table between databases that share a tablespace? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Move vs. copy table between databases that share a tablespace? Tom Lane <tgl@sss.pgh.pa.us>
Re: Move vs. copy table between databases that share a tablespace? Bruce Momjian <bruce@momjian.us>
Re: Move vs. copy table between databases that share a tablespace? Ron <ronljohnsonjr@gmail.com>
Re: Move vs. copy table between databases that share a tablespace? Steven Lembark <lembark@wrkhors.com>
Re: Move vs. copy table between databases that share a tablespace? Ron <ronljohnsonjr@gmail.com>
Re: Move vs. copy table between databases that share a tablespace? Steven Lembark <lembark@wrkhors.com>
Re: Move vs. copy table between databases that share a tablespace? Adrian Klaver <adrian.klaver@aklaver.com>
On Wed, 3 Apr 2019 08:33:54 -0500 Ron wrote: > On 4/3/19 8:18 AM, Steven Lembark wrote: > > Trying to find a way of moving a large table between databases > > in the same cluster. There is not sufficient space to copy the > > contents -- the dedicated tablespace that fits the beastie is > > on an 80% full disk. > > > > Given that the two databases live in the same cluster and have > > the owner & the tablespace in common, is there any way to move > > the contents without a dump & reload? > > COPY TO STDIN and pipe that through ssh to another server? That makes a copy. There is no place to store two copies of the full data on disk. I'm basically trying to perform the moral equivalent of what "mv" does in the filesystem: re-link the inode and remove the old inode without duplicating the data. Since the tablespace is visible to both I would get that there is some way to alter table... that allocates the space on disk to the new database w/o having to unload all 400M rows -- if it comes down to that I'll have to copy it into xz and load it back in the new database. -- Steven Lembark 3920 10th Ave South Workhorse Computing Birmingham, AL 35222 lembark@wrkhors.com +1 888 359 3508
В списке pgsql-general по дате отправления
От: Tom Lane
Дата: