Re: Can you please let me know?

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Gaurav K Srivastav <gauravgkp(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Can you please let me know?
Date: 2010-04-14 13:16:52
Message-ID: k2r162867791004140616i90764d2aid4e2e512e4f240ba@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general

2010/4/14 Gaurav K Srivastav <gauravgkp(at)gmail(dot)com>:
> Hi Sir,
>
> Suppose I created a function getage(id character varying).
>
> Now Is there any query in postgreSQL that I can retreive the name of all
> user difned/system function in the database schema.
> like "select VIEW_TYPE_OWNER, VIEW_TYPE, OID_TEXT from user_views" will list
> all views in oracle.
> or
> select object_name,CREATED,OBJECT_TYPE from user_objects;
>
> so that I can get the name of all objects created in a database schema.

>
> If yes Please help me out or is there any tutorial online please give me URL
> for the same.

SELECT n.nspname as "Schema",
p.proname as "Name",
pg_catalog.pg_get_function_result(p.oid) as "Result data type",
pg_catalog.pg_get_function_arguments(p.oid) as "Argument data types",
CASE
WHEN p.proisagg THEN 'agg'
WHEN p.proiswindow THEN 'window'
WHEN p.prorettype = 'pg_catalog.trigger'::pg_catalog.regtype THEN 'trigger'
ELSE 'normal'
END as "Type"
FROM pg_catalog.pg_proc p
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace
WHERE n.nspname ~ '^(public)$' -- << put here your schema
ORDER BY 1, 2, 4;

http://www.postgresql.org/docs/8.4/static/catalog-pg-proc.html

Regards
Pavel Stehule
>
>
> --
> Thanks & Regards
> Gaurav K Srivastav

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Kevin Grittner 2010-04-14 13:45:18 Re: Can you please let me know?
Previous Message Gaurav K Srivastav 2010-04-14 13:02:15 Can you please let me know?

Browse pgsql-general by date

  From Date Subject
Next Message A. Kretschmer 2010-04-14 13:19:15 Re: Error in Trigger function. How to correct?
Previous Message Andre Lopes 2010-04-14 13:03:15 Error in Trigger function. How to correct?