Where is my function?

The pg_proc special catalog table stores information about every routine (including functions and procedures) defined in the system. It also includes an entry for each overloaded version. There are some fields that can be used to introspect the function definitions:

  • proname is the name of the function
  • prosrc is the implementation of the function, which is anything specified as the block code after the AS clause
  • prokind is set to f for a function and to p for a procedure
  • proargnames and proargtypes represent an internal representation of the argument list
  • prorettype and proretset indicate the return type and whether the function returns a scalar or a result set
  • provolatile assumes a value of v for VOLATILE, s for STABLE ...

Get PostgreSQL 11 Server Side Programming Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.