Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 598B23E3C9D; Sun, 4 Dec 2011 12:47:25 -0400 (AST) Received: from mail-qw0-f53.google.com ([209.85.216.53]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RXFDo-0002xl-Oh; Sun, 04 Dec 2011 16:47:25 +0000 Received: by qadb15 with SMTP id b15so2258373qad.19 for ; Sun, 04 Dec 2011 08:47:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.197.73 with SMTP id ej9mr5106713qab.30.1323017231493; Sun, 04 Dec 2011 08:47:11 -0800 (PST) Received: by 10.229.218.200 with HTTP; Sun, 4 Dec 2011 08:47:11 -0800 (PST) In-Reply-To: <23636.1323016890@sss.pgh.pa.us> References: <201112041612.pB4GCHt06225@momjian.us> <23636.1323016890@sss.pgh.pa.us> Date: Sun, 4 Dec 2011 17:47:11 +0100 Message-ID: Subject: Re: Moving tablespaces From: Magnus Hagander To: Tom Lane Cc: Bruce Momjian , PostgreSQL-documentation , PostgreSQL-development Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201112/9 X-Sequence-Number: 7116 On Sun, Dec 4, 2011 at 17:41, Tom Lane wrote: > Magnus Hagander 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? =A0If 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. --=20 =A0Magnus Hagander =A0Me: http://www.hagander.net/ =A0Work: http://www.redpill-linpro.com/