Thread: BUG #3592: alter function rename to doesn't work

BUG #3592: alter function rename to doesn't work

From
"Ow"
Date:
The following bug has been logged online:

Bug reference:      3592
Logged by:          Ow
Email address:      nikeow@yahoo.com
PostgreSQL version: 8.2.4
Operating system:   Linux (gentoo)
Description:        alter function rename to doesn't work
Details:

=> create or replace function dbo.test(AA text) returns varchar(4) as
-> $$
$> BEGIN
$>    return AA;
$> END;
$> $$ language plpgsql;
CREATE FUNCTION

=> select dbo.test('text');
 test
------
 text
(1 row)

=> alter function dbo.test(text) rename to dbo.test_rename;
ERROR:  syntax error at or near "."
LINE 1: alter function dbo.test(text) rename to dbo.test_rename;
                                                   ^

Re: BUG #3592: alter function rename to doesn't work

From
Devrim GÜNDÜZ
Date:
Hi,

On Sun, 2007-09-02 at 03:45 +0000, Ow wrote:
>
> => alter function dbo.test(text) rename to dbo.test_rename;
> ERROR:  syntax error at or near "."
> LINE 1: alter function dbo.test(text) rename to dbo.test_rename;

AFAIK, the correct syntax is:

ALTER FUNCTION dbo.test(text) RENAME TO test_rename;

You should not specify schema name in the function. The new function
will be created in the same schema that the original function is
created.

Regards,
--
Devrim GÜNDÜZ
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: plPHP, ODBCng - http://www.commandprompt.com/



Re: BUG #3592: alter function rename to doesn't work

From
Tom Lane
Date:
"Ow" <nikeow@yahoo.com> writes:
> => alter function dbo.test(text) rename to dbo.test_rename;
> ERROR:  syntax error at or near "."
> LINE 1: alter function dbo.test(text) rename to dbo.test_rename;
>                                                    ^

This is not correct syntax --- leave off the second "dbo.".

            regards, tom lane