Re: pg_upgrade incorrectly equates pg_default and database tablespace

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Ants Aasma <ants(at)cybertec(dot)at>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Bruce Momjian <bruce(at)momjian(dot)us>
Subject: Re: pg_upgrade incorrectly equates pg_default and database tablespace
Date: 2012-03-30 20:11:47
Message-ID: 1333138307.28198.14.camel@sussancws0025
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 2012-03-22 at 14:55 +0200, Ants Aasma wrote:
> Hi,
>
> while working on a support case I stumbled upon a bug in pg_upgrade.
> Upgrade fails with "No such file or directory" when a database is
> moved to a non-default tablespace and contains a table that is moved
> to pg_default. The cause seems to be that the following test
> incorrectly equates empty spclocation with database tablespace:
>
> tblspace = PQgetvalue(res, relnum, i_spclocation);
> /* if no table tablespace, use the database tablespace */
> if (strlen(tblspace) == 0)
> tblspace = dbinfo->db_tblspace;
>
> Patch to fix this is attached.

I confirmed this bug upgrading 9.1 to master, and that this patch fixes
it. Thank you for the report!

Patch looks good to me as well, with one very minor nitpick: the added
comment is missing an apostrophe.

Bruce, can you take a look at this?

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mike Roest 2012-03-30 20:34:03 Re: pg_dump incredibly slow dumping a single schema from a large db
Previous Message Erik Rijkers 2012-03-30 18:15:22 psql: tab-completion fails SET var=