0

I have been deploying many functions into different databases in different servers in PostgreSQL.

I would like to have a script that would show me a list of functions in the current database including their create and modify date.

I did some research but it did not get me much, that lead to this question.

enter image description here

Another basic question is how to find out what is the postgreSQL version?

1 Answer 1

1

I would like to have a script that would show me a list of functions in the current database

Something like:

SELECT n.nspname as schema_name,
       p.proname as name,
       pg_get_function_result(p.oid) as result_type,
       pg_get_function_arguments(p.oid) as parameters
       CASE p.prokind
         WHEN 'a' THEN 'aggregate function'
         WHEN 'w' THEN 'window function'
         WHEN 'p' THEN 'procedure'
         ELSE 'function'
       END as type
FROM pg_proc p
   LEFT JOIN pg_namespace n ON n.oid = p.pronamespace
WHERE n.nspname not in ('pg_catalog', 'information_schema');

including their create and modify date.

That's not possible. Postgres does not store this information

Another basic question is how to find out what is the postgreSQL version?

select version();
1
  • thanks a lot, just the create and modify date was what I needed most of all, as I wanted to know the list of functions I have modified today, in each server. Dec 29, 2022 at 16:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.