Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YHFE7-0001rU-Iy for pgsql-hackers@arkaria.postgresql.org; Fri, 30 Jan 2015 17:19:27 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YHFE7-0005V7-2E for pgsql-hackers@arkaria.postgresql.org; Fri, 30 Jan 2015 17:19:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YHFE4-0005SN-Td for pgsql-hackers@postgresql.org; Fri, 30 Jan 2015 17:19:24 +0000 Received: from tamriel.snowman.net ([2001:4830:167b::11]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YHFE1-0001JI-E2 for pgsql-hackers@postgresql.org; Fri, 30 Jan 2015 17:19:23 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 7FF6B5F7A3; Fri, 30 Jan 2015 12:19:20 -0500 (EST) Date: Fri, 30 Jan 2015 12:19:20 -0500 From: Stephen Frost To: Robert Haas Cc: "pgsql-hackers@postgresql.org" Subject: Re: tablespaces inside $PGDATA considered harmful Message-ID: <20150130171920.GJ3854@tamriel.snowman.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="m4dDEz192B/qme3Z" Content-Disposition: inline In-Reply-To: X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.13.0-45-generic (x86_64) X-Uptime: 12:16:57 up 8 days, 17:06, 3 users, load average: 0.25, 0.24, 0.17 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org --m4dDEz192B/qme3Z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Robert Haas (robertmhaas@gmail.com) wrote: > Given all this, it seems like a good idea to at least give a warning > if somebody tries to create a tablespace instead the data directory. A warning seems like a good idea. I actually thought we *did* prevent it.. > Arguably, we should prohibit it altogether, but there are obviously > people that want to do it, and there could even be somewhat valid > reasons for that, like wanting to set per-tablespace settings > differently for different tablespaces. Possibly we should prohibit it > anyway, or maybe there should be an option to create a tablespace > whose directory is a real directory, not a symlink. So then: >=20 > CREATE TABLESPACE foo LOCATION '/home/rhaas/pgdata/pg_tblspc/foo'; >=20 > ...would fail, but if you really want a separate tablespace inside the > data directory, we could allow: >=20 > CREATE TABLESPACE foo NO LOCATION; >=20 > ...which would just create a bare directory where the symlink would norma= lly go. I actually really like this 'NO LOCATION' idea. Are there reasons why that would be difficult or ill-advised to do? I could see the NO LOCATION approach being useful for migrating between systems, in particular, or a way to have pg_basebackup work that doesn't involve having to actually map all the tablespaces... Thanks! Stephen --m4dDEz192B/qme3Z Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJUy70YAAoJEO1sijiDR2RVdHwP/2smo6t9WfF67+JoiH3YLiMW EKtL+TeNtUOOap0qedvqVj5mcQzrVW7Pw7MF4PLGEN8HR1OyBSSd6xfigxhCfm9y n8pbgxdC3lRos6nt2OrG8SRvU0a4WdeHnDm9nfoVhv2/DKRmixWzHAZxykTsV1jw aJsLF7BobP6cNkHIkGtC/++r+Nffza83USkhxlMIBQzFWESkcAk4EQ3hyG4h0FL/ WJzQOOjvZVijKCiYpnpHkjjFWXrcWFo6tvtGZEeLWbcbx2wCYvPhRF50H1UVDud6 u00k9iA8jmbCeo4oPYMA7fcCpjE28TUgQM3NHMqIdTPGp9tdJZZRrI2JAytHyCMz 7X82c8KH/X/KiSwlST+JjVTsjCz+UgVmmv9BObEcpHEpQhpD8AShxG/nLPr8J9sT evicszbS4AFINTpOSsMXPePa6+p0Gl4EBJ5p2IcAmEdXCQ/nLWibQ6al8zyVyZXa u/YCY6ap1kG4ARp0zWCkedDmfAwKGxc5ox/CXacXz0oFQ8t9z7CRRECDqj78Z3i3 3oUJwkjFacrxvjMc2+RYt27zQgveCrCEfPJrGncteCih+nyPFLBXaGhkSKEoEUzc 79MZQNen76b3kAweY+/QjYdhoip1QMM/6pSGQ25ijMx8rcba4ZAxSvHPo3w55lLC hIWPhyQk8D39jbuZUul2 =CCHI -----END PGP SIGNATURE----- --m4dDEz192B/qme3Z--