I wrote:
3)    WITH t1 AS
    (UPDATE foo SET bar=bar+1 RETURNING *),
    t2 AS
    (UPDATE baz SET bat=bat+1 RETURNING *)
    VALUES (true);

This isn't probably the most common situation either, but I think it's
worth looking at; the user wants to update two different tables, but
ignore the RETURNING data completely.  On IRC, this has been requested
multiple times.  Even if we wouldn't agree that this feature is useful,
it pretty much follows the semantics of example #1.

A bit off topic, but IMHO if we allow this case, we could allow
INSERT/UPDATE/DELETE without a RETURNING clause if the CTE isn't
referenced, so you could write this as:

WITH t1 AS
(UPDATE foo SET bar=bar+1),
t2 AS
(UPDATE baz SET bar=bar+1)
VALUES(true);


Regards,
Marko Tiikkaja


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

Reply via email to