Re: psql command aliases support
От | Bernd Helmle |
---|---|
Тема | Re: psql command aliases support |
Дата | |
Msg-id | F010E6C68F874ADBBD259210@imhotep.credativ.de обсуждение исходный текст |
Ответ на | Re: psql command aliases support (Gregory Stark <stark@enterprisedb.com>) |
Ответы |
Re: psql command aliases support
|
Список | pgsql-patches |
--On Donnerstag, April 03, 2008 03:13:47 +0100 Gregory Stark <stark@enterprisedb.com> wrote: > I think you're crazy to think shells are more likely to have conflicts. > Shells require a whole token match, not just the first letter. > > In other words, any alias *starting with* the letters c, d, e, f, g, h, i, > o, s, w, z would be a conflict. Just for maximum confusion the list of > letters which cause conflicts when capitalized would be entirely > different. > > Picture a newbie typoing on their \old alias and trying to figure out > where all their data is going... Hopefully they weren't too attached to > whatever was in their "ldd" file yesterday. Of course, the patch doesn't work this way. Only complete tokens delivered by the parser are substituted, illustrated here with your example: #= \alias old SELECT version(); #= \old version --------------------------------------------------------------------------------------------------- PostgreSQL 8.4devel on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.2.3 (Debian 4.2.3-2) (1 row) #= \o foo #= \old #= zsh: suspended psql % cat foo version --------------------------------------------------------------------------------------------------- PostgreSQL 8.4devel on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.2.3 (Debian 4.2.3-2) (1 row) -- Thanks Bernd
В списке pgsql-patches по дате отправления: