Unix Technical Forum

Feature Request: additional extension to UPDATE

This is a discussion on Feature Request: additional extension to UPDATE within the Pgsql General forums, part of the PostgreSQL category; --> Regarding: row-wise update. In a previous thread: http://archives.postgresql.org/pgsql...8/msg00122.php it was mentioned that the "UPDATE ... SET ... FROM ... ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-29-2008, 09:59 AM
Richard Broersma
 
Posts: n/a
Default Feature Request: additional extension to UPDATE

Regarding: row-wise update.

In a previous thread:
http://archives.postgresql.org/pgsql...8/msg00122.php

it was mentioned that the "UPDATE ... SET ... FROM ... WHERE" syntax
is an extension. (an extension employed by many other db flavors.)
This creates a problems since each db flavor is left to their own
devices in how to implement it.

However the ANSI SQL syntax can be a real hassle when you have to a
lot of fields to update using (complicated) correlated sub-queries:

UPDATE Foo
SET a = ( SELECT newA FROM Bar WHERE foo.id = Bar.id ),
b = ( SELECT newB FROM Bar WHERE foo.id = Bar.id ),
c = ( SELECT newC FROM Bar WHERE foo.id = Bar.id ),
...
n = ( SELECT newN FROM Bar WHERE foo.id = Bar.id )
WHERE
Foo.id < 100;


Maybe a row-wise update could simplify this process and at the same
time produce results in with those defined by the SQL Standard.

UPDATE Foo
SET ( a, b, c, ..., n ) = ( SELECT newA, newB, newC, ..., newN
FROM Bar WHERE foo.id = Bar.id )
WHERE
Foo.id < 100;


Any thoughts on this?

--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads for: Feature Request: additional extension to UPDATE

Thread Thread Starter Forum Replies Last Post
IfModule symbol extension Backport request (PR: 29003) Edward Rudd Apache Development 2 08-15-2008 02:23 PM
Feature Request Jon Rootkits 2 07-02-2008 01:53 PM
Feature request Kevin Macdonald pgsql Interfaces Pgadmin Hackers 3 04-17-2008 07:43 PM
Feature request from irc... Christopher Kings-Lynne pgsql Hackers 2 04-11-2008 05:39 AM
Re: Feature request from irc... Denis Lussier pgsql Hackers 0 04-11-2008 05:39 AM


All times are GMT. The time now is 10:51 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com