Re: wrong hint message for ALTER FOREIGN TABLE

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Shigeru Hanada <hanada(at)metrosystems(dot)co(dot)jp>, "pgsql-hackers >> PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: wrong hint message for ALTER FOREIGN TABLE
Date: 2011-04-25 21:08:16
Message-ID: BANLkTim5h2CRCvDeQMohxKiX3fLrcgAFRw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Apr 25, 2011 at 10:17 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Shigeru Hanada <hanada(at)metrosystems(dot)co(dot)jp> writes:
>> I noticed that ALTER FOREIGN TABLE RENAME TO emits a wrong hint message
>> if the object was not a foreign table.  ISTM that the hint message is
>> not necessary there. Attached patch removes the hint message.
>
> Surely it would be better to make the hint correct (ie, "Use ALTER TABLE")
> rather than just nuke it?

The sequence of steps that he posted wasn't actually right. See
subsequent emails on the thread. The patch seems trivially correct,
since this is obviously schizophrenic:

ereport(ERROR,
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
errmsg("\"%s\" is not a foreign table",
! RelationGetRelationName(targetrelation)),
! errhint("Use ALTER FOREIGN TABLE instead.")));

It's not a... so I should use a... erp.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2011-04-25 21:10:38 Re: Unfriendly handling of pg_hba SSL options with SSL off
Previous Message Joshua D. Drake 2011-04-25 20:58:01 Re: branching for 9.2devel