Waiting for 8.4 – remove system objects from \dX

On 6th of January Bruce Momjian committed patch by Greg Sabino Mulane, which fixes one of a very long standing annoyances in PostgreSQL – removes system objects from \dX commands in psql.

Commit message:

This makes all the \dX commands (most importantly to most: \df) work
like \dt does, in that it requires a \dXS to see system items.

Example with \df is the most appropriate, as it usually contains a lot of items.

I've been many times in position when I couldn't remember name of function that I wrote, and loaded to database some time ago. Of course I could check documentation, but it would be cool just to get it's name from \df.

But – until 8.3, \df shows all function. Including system, built-in ones. Effect: 1893 functions in my test database.

Of course I could add “public." to \df:

# \df public.

But it's definitely not intuitive – given the way \d and \dt works.

Now, with this new patch, \df will show only user-added function:

# \df
                                            List of functions
 Schema | Name | Result data type |                          Argument data types
--------+------+------------------+-----------------------------------------------------------------------
 public | test | SETOF record     | from_i integer, to_i integer, OUT numerical integer, OUT textual text
(1 row)

To get previous effect of \df you just add S – like this:

# \dfS
...
(1914 rows)

Same thing works with tables (of course), aggregates, domains, conversions, indexes, sequences, operators, types and views. Cool 🙂

2 thoughts on “Waiting for 8.4 – remove system objects from \dX”

Comments are closed.