Separate psql commands from arguments (was: psql command aliases support)

Поиск
Список
Период
Сортировка
От Brendan Jurd
Тема Separate psql commands from arguments (was: psql command aliases support)
Дата
Msg-id 37ed240d0804031104j15f5f7b2i41a66bad4369bf69@mail.gmail.com
обсуждение исходный текст
Ответы Re: Separate psql commands from arguments (was: psql command aliases support)  (Bernd Helmle <mailings@oopsware.de>)
Re: Separate psql commands from arguments  (Gregory Stark <stark@enterprisedb.com>)
Список pgsql-hackers
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Moving to -hackers ...

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: http://getfiregpg.org

iD8DBQFH9RwN5YBsbHkuyV0RAr9ZAKD+XwNYYw3ugsTvowvKImOlKMZzPQCfTHkQ
u9jLkEIAWI/0MbNzzxBt0ok=
=So1n
-----END PGP SIGNATURE-----

On Fri, Apr 4, 2008 at 4:19 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>  Yeah, the fundamental difference between the backslash command situation
>  and aliases in shells and suchlike is that, because we've historically
>  allowed no space between command name and argument, it's not that easy
>  to tell what string ought to be compared against alias names.
>
>  I think that an alias facility would only be acceptably safe if we
>  disallowed that syntax (ie, start to *require* a space between command
>  and args).  Are we ready to do that?
>

As far as i know, this behaviour isn't documented anywhere.  In fact,
the manual denies its existence:
   "The format of a psql command is the backslash, followed
immediately by a command verb, then any arguments. The arguments are
separated from the command verb and each other by any number of
whitespace characters."

(unless you interpret "any number" to include zero, but that's quite a
stretch in this context)

For what it's worth, I've been using Postgres actively for about five
years, and I've not once suspected that it was possible to omit the
space between a psql command and its argument.

The idea of writing the command and its arguments in one word is so
completely bizarre to me that I can't imagine anyone even trying it
casually to see if it works.  Although it is likely that some people
have stumbled upon it accidentally via typos, it's hard to imagine
them wanting to use it in any kind of pratical application.

+1 for dropping this quirk.  And, if there are no objections (or other
takers), I volunteer to write a patch.

Regards,
BJ


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Gregory Stark
Дата:
Сообщение: Locale, Collation, ICU patch
Следующее
От: Sam Mason
Дата:
Сообщение: Re: [GENERAL] SHA1 on postgres 8.3