function delete problems

Поиск
Список
Период
Сортировка
Искать

function delete problems

От:
Rory Campbell-Lange <rory@campbell-lange.net>
Дата:
I have made some functions which I wish to remove or remake. These are
'returns opaque' functions that are used for triggers.

I cannot remove them using the drop function  command.

obf=> drop function trgpeoplehidden;
ERROR:  parser: parse error at or near ";"

Quoting the function name doesn't seem to help.

What is the best ways of listing, deleting and  updating functions?

(Also, is there a way of seeing what function a trigger on a table
calls? I've tried \d ).

Thanks for any help
Rory
-- 
Rory Campbell-Lange 


Re: function delete problems

От:
Manfred Koizar <mkoi-pg@aon.at>
Дата:
On Tue, 18 Jun 2002 10:14:26 +0100, Rory Campbell-Lange  wrote:
>I have made some functions which I wish to remove or remake. These are
>'returns opaque' functions that are used for triggers.
>
>I cannot remove them using the drop function  command.
>
>obf=> drop function trgpeoplehidden;
>ERROR:  parser: parse error at or near ";"

fred=# \h drop function
Command:     DROP FUNCTION
Description: Removes a user-defined C function
Syntax:
DROP FUNCTION name ( [ type [, ...] ] )
                   ^                  ^
                    Don't omit these!

fred=# drop function bla;
ERROR:  parser: parse error at or near ";"
fred=# drop function bla();
ERROR:  RemoveFunction: function 'bla()' does not exist

.. which is correct.

Servus
 Manfred

Re: function delete problems

От:
Josh Berkus <josh@agliodbs.com>
Дата:

Rory,

Warning: You're about to feel really dumb.  Don't worry, it's happened to me, 
too.

> I cannot remove them using the drop function  command.
> 
> obf=> drop function trgpeoplehidden;
> ERROR:  parser: parse error at or near ";"

That's
DROP FUNCTION trgpeoplehidden();
the parens are mandatory.

You also need to drop the trigger, manually ... dropping the function does not 
automatically drop the trigger, though it does break the trigger.

-- 
-Josh Berkus

FAQ