Skip to content

Instantly share code, notes, and snippets.

@mwotton
Created December 22, 2019 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwotton/a60412f0ad815d5ab7c20c3f52892847 to your computer and use it in GitHub Desktop.
Save mwotton/a60412f0ad815d5ab7c20c3f52892847 to your computer and use it in GitHub Desktop.
CREATE TABLE
INSERT 0 2
x
---
4
5
(2 rows)
x
---
4
5
(2 rows)
create table foo (x int not null);
insert into foo (x) values (3),(4);
with recursive updater as (
update foo
set x=x+1
where x<10
returning *
) select * from updater;
select * from foo;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment