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