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

From Alvaro Herrera
Subject Re: Separate psql commands from arguments
Date
Msg-id 20080410134848.GD6610@alvh.no-ip.org
Whole thread Raw
In response to Re: Separate psql commands from arguments  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
Gregory Stark escribió:

> Ah but I would use it. In particular the query I found myself writing *all*
> the time over and over again in Oracle was:
> 
> select count(*),n from (select count(*) as n from <tab> group by <col>) group by n
> 
> I can type it out now from finger-memory without even thinking about it. I
> would have killed for a macro facility like this where I could just do
> 
> \query dist users city

If we separated the namespace with something that involved a bit less
typing, would you use it?  Say

\-dist users city

(Or some other char instead of hyphen)

The point is that you don't mix it with other \ commands, and as soon as
you put \- you can already press TAB to get a list of "aliases".  So it
_is_ useful both for interactive use and script use.

"\query dist" is good for scripts but bad for interactive: too much
extra typing.  Whereas "\dist" is only relatively good for interactive
(no good support for tab completion), and not any better for scripting.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Andrew Chernow
Date:
Subject: Re: [PATCHES] libpq type system 0.9a
Next
From: Stefan Kaltenbrunner
Date:
Subject: Re: Commit fest queue