psql pager, and searching for function arguments

From: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: psql pager, and searching for function arguments
Date: 2012-06-27 01:02:14
Message-ID: CAK3UJRFcOufwcF_-+-+cSE4M0crbfgZH=jyiz0DW8gbbiBfG=A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

The tip beneath \df on psql's documentation page[0] advises the user:

| Tip: To look up functions taking arguments or returning values
| of a specific type, use your pager's search capability to scroll
| through the \df output.

(This tip was put in[1] as an alternative to having a real 'show me
all functions taking this datatype' command in psql.)

Well, OK, but I don't know how to tell for sure which pager is in use
when the PAGER environment variable is unset, as it seems to be by
default on my machines. And assuming I guess correctly ('less', it
appears), or am willing to specify a particular pager, is this tip
really usable for searching function arguments? I can see how to do
something terribly crude, by setting a particular 'grep' command to
temporarily act as a pager:

test=# \setenv PAGER 'grep internal'
test=# \df
public | unaccent_init | internal | internal
| normal
public | unaccent_lexize | internal | internal,
internal, internal, internal | normal
test=# \setenv PAGER

but is there an easier way to "use your pager's search capability" I'm
missing, for some reasonable pager? The /pattern command for 'less'
isn't quite what I want, as it doesn't discard non-matching output.

Josh

[0] http://www.postgresql.org/docs/current/static/app-psql.html
[1] http://archives.postgresql.org/pgsql-hackers/2004-03/msg01290.php

Browse pgsql-general by date

  From Date Subject
Next Message Cody Cutrer 2012-06-27 04:04:50 Initing a new replica
Previous Message Steve Crawford 2012-06-26 17:27:09 Re: Minimal streaming replication