Why can't you define a table alias on an update?

From: nolan(at)celery(dot)tssi(dot)com
To: pgsql-general(at)postgresql(dot)org (pgsql general list)
Subject: Why can't you define a table alias on an update?
Date: 2003-06-15 22:08:50
Message-ID: 20030615220850.24943.qmail@celery.tssi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

This is the query I posted a performance question on, but I have a
SQL standard question about it too:

update missing_ids
set mtransts = a.mtransts,
mtranmemtp = a.mtranmemtp
from memtran as a
where a.mtranmemid = missing_ids.mtranmemid
and a.mtranseq = missing_ids.mtranseq

Why can't you define an alias on the primary table in an update query?

That would make the where clause in the above a bit easier to write
and read, since both the primary table and the table it is being updated
from have the same column names.
--
Mike Nolan

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ernest E Vogelsinger 2003-06-15 22:13:45 RE : full featured alter table?
Previous Message nolan 2003-06-15 22:05:32 Optimizer failure on update w/integer column