Re: [GENERAL] pg_upgrade & tablespaces

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Joseph Kregloh <jkregloh(at)sproutloud(dot)com>, John R Pierce <pierce(at)hogranch(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [GENERAL] pg_upgrade & tablespaces
Date: 2014-01-12 15:35:32
Message-ID: CABUevEwJpdmfLteao2o9De1A+PS=Ax8D2rnJyBE63ADmUpT=Ag@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Sun, Jan 12, 2014 at 5:26 AM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:

> On Sat, Jan 11, 2014 at 12:48:51PM -0800, Adrian Klaver wrote:
> > >pg_upgrade looks in the pg_tablespace in pre-9.2, and uses a function in
> > >9.2+. The query is:
> > >
> > > snprintf(query, sizeof(query),
> > > "SELECT %s "
> > > "FROM pg_catalog.pg_tablespace "
> > > "WHERE spcname != 'pg_default' AND "
> > > " spcname != 'pg_global'",
> > > /* 9.2 removed the spclocation column */
> > > (GET_MAJOR_VERSION(old_cluster.major_version) <= 901) ?
> > >--> "spclocation" : "pg_catalog.pg_tablespace_location(oid) AS
> spclocation");
> >
> >
> > I see, though I have another question. If pg_tablespace and the
> > symlinks can get out of sync, as you say below, why is pg_tablespace
> > considered the authority? Or to put it another way, why not just
> > look at the symlinks as in 9.2+?
>
> Uh, good question. I think I used the system tables because they were
> easier to access. I can't remember if we used the symlinks for some
> things and pg_tablespace for other things in pre-9.2.
>

If you mean PostgreSQL internally then no, we didn't use pg_tablespace for
anything ever. We only used the symlinks. Which is why it was so easy to
remove.

If you were using it for something inside pg_upgrade I don't know, but the
backend didn't.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2014-01-12 17:48:40 Re: [GENERAL] pg_upgrade & tablespaces
Previous Message Szymon Guz 2014-01-12 14:58:31 Re: DB Authentication Design

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2014-01-12 15:35:55 Re: Deprecations in authentication
Previous Message Florian Pflug 2014-01-12 15:20:00 Re: Why does numeric_out produce so many trailing zeros?