With Update From ... vs. Update ... From (With) - Mailing list pgsql-general

From David G. Johnston
Subject With Update From ... vs. Update ... From (With)
Date
Msg-id CAKFQuwZB32=5=W_y55B7oo1tA6JCZsv=Kd0Yo_V7q_HoPrX27w@mail.gmail.com
Whole thread Raw
Responses Re: With Update From ... vs. Update ... From (With)
List pgsql-general
Hello!

Is there any non-functional difference between these two forms of Update?

WITH name AS ( SELECT )
UPDATE tbl SET ...
FROM name
WHERE tbl.id = name.id

and

UPDATE tbl SET ...
FROM ( WITH qry AS ( SELECT ) SELECT * FROM qry ) AS name
WHERE tbl.id = name.id

They both better give the same results but does the backend treat them differently?

Does the answer to my question depend on the version of PostgreSQL?

Thanks!

David J.

pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Help with slow table update
Next
From: Jim Nasby
Date:
Subject: Re: recovery of a windows archive in linux