pg_upgrade incorrectly equates pg_default and database tablespace

From: Ants Aasma <ants(at)cybertec(dot)at>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_upgrade incorrectly equates pg_default and database tablespace
Date: 2012-03-22 12:55:32
Message-ID: CA+CSw_vDb2nmPhumR4QzOre=ai+ktrJ8KwaZQv7M0nU9L5A9sw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

Regards,
Ants Aasma
--
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt
Web: http://www.postgresql-support.de

Attachment Content-Type Size
pgupgrade-default-tblspc.patch text/x-patch 2.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-03-22 13:07:05 Re: checkpoint patches
Previous Message Etsuro Fujita 2012-03-22 09:41:11 Re: Proposal: Create index on foreign table