Re: Separate psql commands from arguments

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Separate psql commands from arguments
Дата
Msg-id 20080410134848.GD6610@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: Separate psql commands from arguments  (Gregory Stark <stark@enterprisedb.com>)
Список 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 по дате отправления:

Предыдущее
От: Andrew Chernow
Дата:
Сообщение: Re: [PATCHES] libpq type system 0.9a
Следующее
От: Stefan Kaltenbrunner
Дата:
Сообщение: Re: Commit fest queue