Re: [PATCH] psql \n shortcut for set search_path =

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Fetter <david@fetter.org>
Cc: Josh Kupershmidt <schmiddy@gmail.com>, "Colin 't Hart" <colin@sharpheart.org>, pgsql-hackers@postgresql.org
Date: 2012-07-10T16:44:22Z
Lists: pgsql-hackers
David Fetter <david@fetter.org> writes:
> On Tue, Jul 10, 2012 at 12:00:06PM -0400, Tom Lane wrote:
>> ISTM there was some discussion awhile back about user-definable
>> typing shortcuts in psql.

> In some sense, we already have them:

Good point:

regression=# show search_path ;
  search_path   
----------------
 "$user",public
(1 row)

regression=# \set n 'set search_path ='
regression=# :n foo;
SET
regression=# show search_path ;
 search_path 
-------------
 foo
(1 row)

So maybe what's needed here is a documentation example showing how you
can use a \set in ~/.psqlrc to provide this sort of functionality.

			regards, tom lane