Hi,


> The question is that since this enhances the UPDATE syntax, what changes
and
> where all they need to be made with respect to the documentation?

Documentation is the very least of your worries.  What exactly is your
implementation plan?  If this were a simple or narrow fix it would
have been done already.



The implementation that I have planned is pretty similar to the way "INSERT
INTO ... SELECT" has been implemented.

Along with the grammar changes in gram.y, the changes are localized in the
transformUpdateStmt code path. The SELECT clause ends up becoming a subquery
to the update query with the target column expressions transformed properly
to include the subquery expressions. Does this sound ok?

I have tried some update-subselect variations and they seem to work. For
example the case in the src/test/regress/sql/update.sql, which used to fail
till now, seems to work:

UPDATE update_test SET (a,b) = (select a,b FROM update_test where c = 'foo')
 WHERE a = 10;

Will try testing out some other variations too.

Regards,
Nikhils
--
EnterpriseDB               http://www.enterprisedb.com

Reply via email to