Re: Separate psql commands from arguments - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Separate psql commands from arguments
Date
Msg-id 9876.1207350979@sss.pgh.pa.us
Whole thread Raw
In response to Re: Separate psql commands from arguments  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
Gregory Stark <stark@enterprisedb.com> writes:
> "Brendan Jurd" <direvus@gmail.com> writes:
>> +1 for dropping this quirk.  And, if there are no objections (or other
>> takers), I volunteer to write a patch.

> Regardless of whether we go ahead with this (and I'm not fond of it primarily
> because I want \c& to "work"),

Perhaps the useful part of the old behavior could be kept by allowing
the command name to be terminated by punctuation as well as whitespace.
("Punctuation" being all nonletters except "+", since we already accept
"+" in command names --- or alternatively we could consider the "+" as
the first argument?)  Would that cover all the cases you are used to
using?

> I think we would still be better off keeping
> the aliases in a separate namespace from psql commands and having an explicit
> command for calling them.

+1.  As I already said, the psql command namespace is so dense that it's
going to be real hard to actually use aliases unless we separate them
somehow.

However, the invoking command has to be pretty dang short or typing it
will negate the point of having aliases.  Perhaps something like this:
if your alias is "foo" you invoke it as "\-foo ...".
        regards, tom lane


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Separate psql commands from arguments
Next
From: Aidan Van Dyk
Date:
Subject: Re: modules