Possible feature request

Started by Brian Hurtover 18 years ago2 messages
#1Brian Hurt
bhurt@janestcapital.com

I'm not sure if this is the right venue for this- if it isn't, I apologize.

But a feature that I'd like to see is the ability to put an 'as' alias
on the target of an update statement.

I find myself often writing statements like:
UPDATE
some_really_long_table_name
SET
col1 = some_value,
col2 = some_other_value
FROM
some_other_really_long_table_name AS table2
WHERE
some_really_long_table_name.col3 = table2.col3
AND some_really_long_table_name.col4 = table2.col4
;

What I'd like to write is:
UPDATE
some_really_long_table_name AS table1
SET
col1 = some_value,
col2 = some_other_value
FROM
some_other_really_long_table_name AS table2
WHERE
table1.col3 = table2.col3
AND table1.col4 = table2.col4
;

Is this possible? Not for 8.3, obviously, but maybe for 8.4?

Brian

#2Jaime Casanova
systemguards@gmail.com
In reply to: Brian Hurt (#1)
Re: Possible feature request

On 7/25/07, Brian Hurt <bhurt@janestcapital.com> wrote:

I'm not sure if this is the right venue for this- if it isn't, I apologize.

But a feature that I'd like to see is the ability to put an 'as' alias
on the target of an update statement.

you can do this since 8.2:

http://www.postgresql.org/docs/8.2/static/sql-update.html

--
regards,
Jaime Casanova

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
Richard Cook