Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003
    Posts
    11

    Exclamation Unanswered: View user defined functions

    Hi. I would like to know how do I see the functions I've created ?

    For example:
    CREATE FUNCTION foo ( .... )
    CREATE FUNCTION goo ( .... )

    and then a query :

    SELECT ........ ;

    - foo
    - goo

    Thanks.
    Pablo Velasquez Rivas
    Computer Science Engineer - ITCR

  2. #2
    Join Date
    Aug 2003
    Posts
    32
    select prosrc from pg_proc where proname = 'foo';
    select prosrc from pg_proc where proname = 'goo';

  3. #3
    Join Date
    Dec 2003
    Posts
    11

    Exclamation

    Originally posted by stacey_richards
    select prosrc from pg_proc where proname = 'foo';
    select prosrc from pg_proc where proname = 'goo';
    Thanks, that is going to give me the source of the function.

    But, what I asked was the way to see the names of the functions that I've created.

    Regards,
    Pablo Velasquez Rivas
    Computer Science Engineer - ITCR

  4. #4
    Join Date
    Aug 2003
    Posts
    32
    I had a look some of the stored procedures in template1 and noticed that pronamespace was always 11. I created a temp database and added a few functions. I noticed that pronamespace was always 2200 for the functions that I created. Therefore:

    Code:
    select proname from pg_proc where pronamespace <> 11;
    seemed to do the trick.

    I'm not sure if there's an "official" way of getting the names of the user created functions, and I'm not sure if the above query will work in all cases, but it's a start, eh?

Posting Permissions

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