Re: [PATCH] psql \n shortcut for set search_path = - Mailing list pgsql-hackers

From Colin 't Hart
Subject Re: [PATCH] psql \n shortcut for set search_path =
Date
Msg-id CAMon-aQthOOmOOkURxYY0n5dLQRTQn9kLOZVFQxNi6MZ_Xmv2A@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] psql \n shortcut for set search_path =  (David Fetter <david@fetter.org>)
List pgsql-hackers


On 10 July 2012 18:24, David Fetter <david@fetter.org> wrote:
On Tue, Jul 10, 2012 at 12:00:06PM -0400, Tom Lane wrote:
> Josh Kupershmidt <schmiddy@gmail.com> writes:
> > On Tue, Jul 10, 2012 at 2:09 AM, Colin 't Hart <colin@sharpheart.org> wrote:
> >> Attached please find a trivial patch for psql which adds a \n
> >> meta command as a shortcut for typing set search_path =.
>
> > I think the use-case is a bit narrow: saving a few characters
> > typing on a command not everyone uses very often (I don't), at the
> > expense of adding yet another command to remember.
>
> Another point here is that we are running low on single-letter
> backslash command names in psql.  I'm not sure that "SET
> SEARCH_PATH" is so useful as to justify using up one of the ones
> that are left.
>
> ISTM there was some discussion awhile back about user-definable
> typing shortcuts in psql.

In some sense, we already have them:

\set FOO 'SELECT * FROM pg_stat_activity;'
...
:FOO

Was there more to it?

Can I pass a parameter to ":FOO" ?

Cheers,

Colin

pgsql-hackers by date:

Previous
From: "Colin 't Hart"
Date:
Subject: Re: [PATCH] psql \n shortcut for set search_path =
Next
From: Tom Lane
Date:
Subject: Re: BlockNumber initialized to InvalidBuffer?