Skip site navigation (1) Skip section navigation (2)

Re: Allow an alias for the target table in UPDATE/DELETE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Allow an alias for the target table in UPDATE/DELETE
Date: 2006-01-22 19:20:31
Message-ID: 19830.1137957631@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-patches
Neil Conway <neilc(at)samurai(dot)com> writes:
> Did you actually test this?

No, I was just looking at the y.output file to see what would happen.

> neilc=# update t1 set set a = 500 where set.a > 1000;
> UPDATE 0
> (Using essentially the patch you posted.)

[ scratches head... ]  That shouldn't have worked.  I'll have to look
again.

> Well, if necessary we can just use an alternate production for the
> DELETE case, as there is no SET ambiguity to worry about.

Yeah, I thought of that too and rejected it as being too much trouble
for too small a case.  I'm really considerably more worried about the
question of whether attaching a precedence to SET might cause trouble
later.  But it's only a hypothetical problem at this point.

> So I'm inclined to favor #2.

OK, motion carries.  I'll check what's happening in the case above
and commit if there's not something wrong.

			regards, tom lane

In response to

pgsql-patches by date

Next:From: Alexey SlynkoDate: 2006-01-22 19:57:27
Subject: TODO item: locale per database patch (new iteration)
Previous:From: Neil ConwayDate: 2006-01-22 18:59:18
Subject: Re: Allow an alias for the target table in UPDATE/DELETE

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group