Skip site navigation (1) Skip section navigation (2)

Re: create tablespace fails silently, or succeeds improperly

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Dave Cramer <pg(at)fastcrypt(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: create tablespace fails silently, or succeeds improperly
Date: 2010-10-18 19:16:35
Message-ID: 201010181916.o9IJGZd14131@momjian.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Robert Haas wrote:
> On Mon, Oct 18, 2010 at 3:05 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> > Robert Haas wrote:
> >> On Mon, Oct 18, 2010 at 3:02 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> > Bruce Momjian <bruce(at)momjian(dot)us> writes:
> >> >> Robert Haas wrote:
> >> >>> Perhaps we should fix the behavior rather than the documentation.
> >> >
> >> >> We can't fix the behavior because we have to allow an old cluster to
> >> >> keep its tablespace files during a pg_upgrade. ?They are given a script
> >> >> to delete those files later, if they want.
> >> >
> >> > The new *layout* of the files may be forced by pg_upgrade
> >> > considerations, but I don't think that proves much of anything about
> >> > ownership and permissions settings --- especially not the fact that we
> >> > are now enforcing settings that were designed for the data directory
> >> > itself on what is effectively one level up from that.
> >>
> >> I haven't yet been convinced we need or want to relax the rule about
> >> the directory being empty.
> >
> > Uh, how would pg_upgrade work then? ?It would require renaming the
> > top-level tablespace directory, which might require root permissions.
> 
> Huh?  Whether or not we choose to store our data files in a
> subdirectory is an independent question from whether or not we verify
> that the directory is empty before we start scribbling on it.

But the directory will not be empty when pg_upgrade creates the
tablespace subdirectory.

Backing up, the problem was that we originally stored the data in the
symlink directory, and that made it impossible for pg_upgrade to create
a parallel tablespace directory for the new version.  By using a
subdirectory, pg_upgrade knows where to store the tablespace
subdirectory and does not interfere with other PG versions stored in the
same top-leavel directory.

-- 
  Bruce Momjian  <bruce(at)momjian(dot)us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +

In response to

pgsql-hackers by date

Next:From: Andres FreundDate: 2010-10-18 19:17:24
Subject: Re: Creation of temporary tables on read-only standby servers
Previous:From: Robert HaasDate: 2010-10-18 19:07:16
Subject: Re: create tablespace fails silently, or succeeds improperly

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group