Re: [PATCHES] psql command aliases support

2008-05-17 Thread Tom Lane
Bernd Helmle <[EMAIL PROTECTED]> writes: > please find attached a patch which implements psql command aliases. They > work the same way as on bash, zsh and others, for example: I'm still not convinced that we want this sort of feature at all. I quote from the current bash manual page: ALIASES

Re: [PATCHES] psql command aliases support

2008-04-03 Thread daveg
On Thu, Apr 03, 2008 at 01:19:21PM -0400, Tom Lane wrote: > Gregory Stark <[EMAIL PROTECTED]> writes: > > I think you have to find a syntax where the current commands continue to > > mean > > exactly what they always meant and where typos can't result in an entirely > > different kind of behaviour

Re: [PATCHES] psql command aliases support

2008-04-03 Thread Tom Lane
Gregory Stark <[EMAIL PROTECTED]> writes: > I think you have to find a syntax where the current commands continue to mean > exactly what they always meant and where typos can't result in an entirely > different kind of behaviour. Yeah, the fundamental difference between the backslash command situ

Re: [PATCHES] psql command aliases support

2008-04-03 Thread Gregory Stark
"Bernd Helmle" <[EMAIL PROTECTED]> writes: > --On Donnerstag, April 03, 2008 14:36:59 +0100 Gregory Stark > <[EMAIL PROTECTED]> wrote: > >>> \o foo instead of \i foo -- check your keyboard layout >> >> The point is here you've typed a different command entirely. >> Unsurprisingly it's going to do

Re: [PATCHES] psql command aliases support

2008-04-03 Thread Bernd Helmle
--On Donnerstag, April 03, 2008 14:36:59 +0100 Gregory Stark <[EMAIL PROTECTED]> wrote: \o foo instead of \i foo -- check your keyboard layout The point is here you've typed a different command entirely. Unsurprisingly it's going to do something different. Uh well, you surely don't know tha

Re: [PATCHES] psql command aliases support

2008-04-03 Thread Bernd Helmle
--On Freitag, April 04, 2008 01:11:51 +1100 Brendan Jurd <[EMAIL PROTECTED]> wrote: What is the virtue of allowing such a syntax in the first place? I can't think of any other context where it's okay to issue a command together with arguments without some kind of delimiter, for the obvious rea

Re: [PATCHES] psql command aliases support

2008-04-03 Thread Peter Eisentraut
Am Donnerstag, 3. April 2008 schrieb Brendan Jurd: > psql allows you to omit the space between the command and argument? > Does anybody else find that weird? > What is the virtue of allowing such a syntax in the first place? Combatability with hysterial practice. -- Sent via pgsql-patches mailin

Re: [PATCHES] psql command aliases support

2008-04-03 Thread Brendan Jurd
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > Am Donnerstag, 3. April 2008 schrieb Gregory Stark: > > > #= \oldd > > > > #= \old > > #= select 'where is all my output going?' > > #= select 'what happened to my ldd file?' > psql allows you to omit the space between the command and argument?

Re: [PATCHES] psql command aliases support

2008-04-03 Thread Peter Eisentraut
Am Donnerstag, 3. April 2008 schrieb Gregory Stark: > \old means something *today*. In the proposed syntax by creating the alias > you're changing what it means. Yes. There are two complementary responses to that: 1. That's an intentional, useful feature of aliases. 2. If you don't like it, don'

Re: [PATCHES] psql command aliases support

2008-04-03 Thread Gregory Stark
"Peter Eisentraut" <[EMAIL PROTECTED]> writes: > This is a valid concern, but it is orthogonal to the alias feature. You have > the same problem already if you mistype > > \oo instead of \o > \ofoo instead of \obar Not really. In these cases you know what \o is going to do, you've just typo'd t

Re: [PATCHES] psql command aliases support

2008-04-03 Thread Peter Eisentraut
Am Donnerstag, 3. April 2008 schrieb Gregory Stark: > To be more explicit what I meant was someone doing > > #= \alias old select version(); > ... > #= \oldd > > #= \old > #= select 'where is all my output going?' > #= select 'what happened to my ldd file?' This is a valid concern, but it is orth

Re: [PATCHES] psql command aliases support

2008-04-03 Thread Gregory Stark
"Bernd Helmle" <[EMAIL PROTECTED]> writes: >> 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 complet

Re: [PATCHES] psql command aliases support

2008-04-03 Thread Bernd Helmle
--On Donnerstag, April 03, 2008 03:13:47 +0100 Gregory Stark <[EMAIL PROTECTED]> 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,

Re: [PATCHES] psql command aliases support

2008-04-02 Thread Gregory Stark
"Peter Eisentraut" <[EMAIL PROTECTED]> writes: > Am Dienstag, 1. April 2008 schrieb Tom Lane: >> Do we really want such a thing? > > Yes! > >> The space of backslash command names >> is so densely populated already that it's hard to imagine creating >> aliases without conflicting with existing (o

Re: [PATCHES] psql command aliases support

2008-04-01 Thread Bernd Helmle
--On Dienstag, April 01, 2008 11:39:59 -0400 Tom Lane <[EMAIL PROTECTED]> wrote: Do we really want such a thing? Well, i use aliases everytime and everywhere they got implemented and i found it quite useful to _extend_ existing behavior (integrating additional functionality in an easy way)

Re: [PATCHES] psql command aliases support

2008-04-01 Thread Peter Eisentraut
Am Dienstag, 1. April 2008 schrieb Tom Lane: > Do we really want such a thing? Yes! > The space of backslash command names > is so densely populated already that it's hard to imagine creating > aliases without conflicting with existing (or future) command names > --- as indeed your example does.

Re: [PATCHES] psql command aliases support

2008-04-01 Thread Tom Lane
Bernd Helmle <[EMAIL PROTECTED]> writes: > please find attached a patch which implements psql command aliases. They > work the same way as on bash, zsh and others, for example: > #= \alias d \dt+ > #= \d Do we really want such a thing? The space of backslash command names is so densely populate

[PATCHES] psql command aliases support

2008-04-01 Thread Bernd Helmle
Folks, please find attached a patch which implements psql command aliases. They work the same way as on bash, zsh and others, for example: #= \alias d \dt+ #= \d List of relations Schema | Name | Type | Owner | Description +--+---+---+- public | fo