Re: Add Missing From?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jan Wieck <JanWieck(at)Yahoo(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Add Missing From?
Date: 2004-08-10 17:23:20
Message-ID: 200408101723.i7AHNKx11852@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Tom Lane wrote:
> >> * Allow an alias to be provided for the target table in UPDATE/DELETE
> >>
> >> This is not SQL-spec but many DBMSs allow it.
>
> > I don't think we would ever do the above item.
>
> Why not? You can hardly argue that "it's not SQL spec" while
> simultaneously putting in a much larger extension to the spec.
>
> > I see no purpose to
> > allowing the UPDATE/DELETE table to have an alias
>
> Brevity. If you are really updating AVeryLongSchemaName.AVeryLongTableName
> then you would reasonably want to have an alias for that. In the pure
> SQL-spec syntax it's not so important because there's seldom a need to
> name the table again within the query. But in a self-join situation you
> would be forced to name the target table within the query, and then a
> shorter alias would be both easier to type and less prone to confusion.
> (Even in pure SQL, you may need to name the table again for references
> within subqueries that have duplicate column names.)

Yea, I guess for a long table that also needed an alias you would have
to specify the long name every time you reference the table. However,
we haven't had anyone ask for that capability, even for UPDATE which
does already have that limitation. Seems like a new TODO item but I am
not sure anyone wants it.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-08-10 17:25:18 Re: Add Missing From?
Previous Message Tom Lane 2004-08-10 17:16:58 Re: Add Missing From?