From 6e8596a146c9b16f2c053ea8c6e361a114c0b65c Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Sat, 2 Sep 2006 20:34:47 +0000 Subject: Add UPDATE tab SET ROW (col, ...) = (val, ...) for updating multiple columns Susanne Ebrecht --- doc/src/sgml/ref/update.sgml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/update.sgml b/doc/src/sgml/ref/update.sgml index 5d1265e945f..7b5d17a1fc8 100644 --- a/doc/src/sgml/ref/update.sgml +++ b/doc/src/sgml/ref/update.sgml @@ -1,5 +1,5 @@ @@ -21,7 +21,8 @@ PostgreSQL documentation UPDATE [ ONLY ] table [ [ AS ] alias ] - SET column = { expression | DEFAULT } [, ...] + [ SET column = { expression | DEFAULT } [, ...] | + SET ( column [, ...] ) = ( { expression | DEFAULT } [, ...] ) [, ...] ] [ FROM fromlist ] [ WHERE condition ] [ RETURNING * | output_expression [ AS output_name ] [, ...] ] @@ -250,6 +251,10 @@ UPDATE films SET kind = 'Dramatic' WHERE kind = 'Drama'; UPDATE weather SET temp_lo = temp_lo+1, temp_hi = temp_lo+15, prcp = DEFAULT WHERE city = 'San Francisco' AND date = '2003-07-03'; + + +UPDATE weather SET (temp_lo, temp_hi, prcp) = (temp_lo+1, temp_lo+15, DEFAULT) + WHERE city = 'San Francisco' AND date = '2003-07-03'; -- cgit v1.2.3