Cannot SELECT from UPDATE RETURNING clause in postgres

前端 未结 7 1075
旧时难觅i
旧时难觅i 2020-12-03 10:36

I isolatet the problem from a much more complex query. Here the test scenario

DROP TABLE test; 
CREATE TABLE test (
  id integer,
  description varchar(100)
         


        
7条回答
  •  长情又很酷
    2020-12-03 11:42

    I'm addition from Ants Aasma, if select on same table, using:

    WITH updated AS (UPDATE test SET description = 'test' RETURNING id, description)
    SELECT * FROM updated;
    

提交回复
热议问题