Re: [HACKERS] Table aliases in delete statements?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Keith Parks <emkxp01(at)mtcc(dot)demon(dot)co(dot)uk>
Cc: hackers(at)postgreSQL(dot)org, geek+(at)cmu(dot)edu
Subject: Re: [HACKERS] Table aliases in delete statements?
Date: 1999-12-09 03:20:14
Message-ID: 199912090320.WAA03916@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> >Unless your query is going to be long enough to run into query length
> >limits, aliases are not your friends. Standard SQL they may be, but
> >aliases always end up obscuring queries to those who come along after
> >you.
>
> The problem is that it's difficult to refer to the same table twice
> in a single query without using aliases.
>
> The trap I fell into was thinking I had to alias both references to
> the table.
>
> I'd be interested in seeing alternative solutions to the duplicate
> removal problem.

Yes, that is tricky in that there is an aliased version and a non-alias
version of the same table.

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 1999-12-09 03:57:00 Re: [HACKERS] Parallel regress tests (was Re: FOREIGN KEY andshift/reduce)
Previous Message Bruce Momjian 1999-12-09 03:03:00 Re: [HACKERS] Re: [BUGS] uniqueness not always correct