Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2017
    Posts
    12

    Answered: Unable to drop function.

    Im learning postgresql, and I tried an example function I found on the web to add "1" to the function argument.
    Seems to work fine, but I can't get rid of it now...

    Code:
    postgres=> select increment(10);
     increment
    -----------
            11
    (1 row)
    
    postgres=> drop function increment();
    ERROR:  function increment() does not exist

  2. Best Answer
    Posted by shammat

    "Quote from the manual:
    Quote Originally Posted by The Manual
    The argument types to the function must be specified, since several different functions can exist with the same name and different argument lists
    So you need to use something like this:
    Code:
    drop function increment(int);
    (assuming the parameter is declared as an integer)"


  3. #2
    Join Date
    Nov 2003
    Posts
    2,988
    Provided Answers: 23
    Quote from the manual:
    Quote Originally Posted by The Manual
    The argument types to the function must be specified, since several different functions can exist with the same name and different argument lists
    So you need to use something like this:
    Code:
    drop function increment(int);
    (assuming the parameter is declared as an integer)
    I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags: http://www.dbforums.com/misc.php?do=bbcode#code

    Tips for good questions:

    http://tkyte.blogspot.de/2005/06/how...questions.html
    http://wiki.postgresql.org/wiki/SlowQueryQuestions
    http://catb.org/esr/faqs/smart-questions.html

  4. #3
    Join Date
    Jan 2017
    Posts
    12
    Thanks, forgot the overloading could affect the drop command also...

    drop function increment(int);
    DROP FUNCTION

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •