Re: [HACKERS] wrong hint message for ALTER FOREIGN TABLE

2011-04-25 Thread Tom Lane
Robert Haas writes: > On Mon, Apr 25, 2011 at 7:03 PM, Tom Lane wrote: >> As per the other thread today, this advice would usually be correct, >> so I think that not offering any advice at all would be a step down from >> that. > Well, currently ALTER TABLE will work even if the argument is a vi

Re: [HACKERS] wrong hint message for ALTER FOREIGN TABLE

2011-04-25 Thread Robert Haas
On Mon, Apr 25, 2011 at 7:03 PM, Tom Lane wrote: > Robert Haas writes: >> The sequence of steps that he posted wasn't actually right. > > Yes, I did read the thread. OK. >> The patch seems trivially correct, >> since this is obviously schizophrenic: > >>               ereport(ERROR, >>        

Re: [HACKERS] wrong hint message for ALTER FOREIGN TABLE

2011-04-25 Thread Tom Lane
Robert Haas writes: > The sequence of steps that he posted wasn't actually right. Yes, I did read the thread. > The patch seems trivially correct, > since this is obviously schizophrenic: > ereport(ERROR, > (errcode(ERRCODE_WRONG_OBJECT_TYPE), >

Re: [HACKERS] wrong hint message for ALTER FOREIGN TABLE

2011-04-25 Thread Robert Haas
On Mon, Apr 25, 2011 at 10:17 AM, Tom Lane wrote: > Shigeru Hanada 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. > > Surel

Re: [HACKERS] wrong hint message for ALTER FOREIGN TABLE

2011-04-25 Thread Tom Lane
Shigeru Hanada 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 A

Re: [HACKERS] wrong hint message for ALTER FOREIGN TABLE

2011-04-25 Thread Shigeru Hanada
(2011/04/25 19:34), Thom Brown wrote: Don't you mean that you created a regular table first, then tried to rename it as a foreign table? Your example here will be successful without the error. Oops, you are right. Right procedure to reproduce is: postgres=# CREATE TABLE foo(c1 int); CREATE TA

Re: [HACKERS] wrong hint message for ALTER FOREIGN TABLE

2011-04-25 Thread Thom Brown
On 25 April 2011 10:06, Shigeru Hanada wrote: > 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. > > Steps to reproduce the situation: > >