[HACKERS] wrong hint message for ALTER FOREIGN TABLE

2011-04-25 Thread Shigeru Hanada
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: postgres=# CREATE FOREIGN TABLE foo () SERVER

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

2011-04-25 Thread Thom Brown
On 25 April 2011 10:06, Shigeru Hanada han...@metrosystems.co.jp 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

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

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

2011-04-25 Thread Tom Lane
Shigeru Hanada han...@metrosystems.co.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

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 t...@sss.pgh.pa.us wrote: Shigeru Hanada han...@metrosystems.co.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

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

2011-04-25 Thread Tom Lane
Robert Haas robertmh...@gmail.com 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,

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 t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com 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:              

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

2011-04-25 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Mon, Apr 25, 2011 at 7:03 PM, Tom Lane t...@sss.pgh.pa.us 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