From: Magnus Hagander <magnus@hagander.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: PostgreSQL-documentation <pgsql-docs@postgresql.org>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Moving tablespaces
Date: Sun, 4 Dec 2011 17:47:11 +0100
Message-ID: <CABUevEzUujCMEhmJMYxr7eQmD39moj2OPVModNZ6ENk-bg0ugQ@mail.gmail.com> (raw)
In-Reply-To: <23636.1323016890@sss.pgh.pa.us>
References: <CABUevEx2xYV==WRxWdMr=mS3Q1orBUvJcXa8AZx_LVbL122g5Q@mail.gmail.com>
<201112041612.pB4GCHt06225@momjian.us>
<CABUevEzuRQLddyY2yypiZpjWzzEzz0p66TgzoXGuz+jLxKgdkg@mail.gmail.com>
<23636.1323016890@sss.pgh.pa.us>
On Sun, Dec 4, 2011 at 17:41, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Magnus Hagander <magnus@hagander.net> writes:
>> And IIRC, we don't actually *use* spclocation anywhere.
>
> Just for pg_dump, I think.
pg_dumpall :-)
It's also used in pg_upgrade and pg_basebackup, but those are easily
dealt with if we define a function for it.
>> How about we
>> just get rid of them as independents? We could either:
>
>> 1) Remove the column. Rely on the symlink. Create a
>> pg_get_tablespace_location(oid) function, that could be used by
>> pg_dumpall and friends, that just reads the symlink.
>
> Hm, how portable is symlink-reading? If we can actually do that
> without big headaches, then +1.
We already use readlink in a couple of places - including getting
called from find_my_exec. It's also used in pg_basebackup. The use in
find_my_exec is conditional on HAVE_READLINK, but not the one in
backend/replication/basebackup.c. An oversight from my side when
putting that in, but it shows that every single bf member we have now
has readlink - else the whole compilation would fail, AFAICT.
It's not directly portable to win32, but we have a wrapper function
for it in port/ already.
So I think we're fairly committed to having readlink already.
>> 2) Forcibly update the spclocation column when we start the server to
>> be whatever the symlink points to. That will at least automatically
>> restore the system to being consistent.
>
> -1, running a transaction at that level will be a giant pita.
> And how would you do it at all on a hot standby slave?
yeah, it would break that usage scenario, so I'm -1 for that one as well.
--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-docs@postgresql.org
Cc: magnus@hagander.net, tgl@sss.pgh.pa.us, bruce@momjian.us, pgsql-hackers@postgresql.org
Subject: Re: Moving tablespaces
In-Reply-To: <CABUevEzUujCMEhmJMYxr7eQmD39moj2OPVModNZ6ENk-bg0ugQ@mail.gmail.com>
References: <CABUevEx2xYV==WRxWdMr=mS3Q1orBUvJcXa8AZx_LVbL122g5Q@mail.gmail.com> <201112041612.pB4GCHt06225@momjian.us> <CABUevEzuRQLddyY2yypiZpjWzzEzz0p66TgzoXGuz+jLxKgdkg@mail.gmail.com> <23636.1323016890@sss.pgh.pa.us> <CABUevEzUujCMEhmJMYxr7eQmD39moj2OPVModNZ6ENk-bg0ugQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox