Steven Bedrick

Inspecting pl/pgSQL functions from PSQL

« Back to notes

Creating pl/pgSQL functions is easy: CREATE FUNCTION.... Inspecting those functions six months later, after you’ve forgotten what’s in them? Turns out that that’s easy too. To inspect the SQL behind a function named, say, foo, use \df+, like so:

dbname=# \df+ foo

This will print out, among other things, foo’s source code.

« Back to notes