Running postgres 10, the following code returns 0 rows:
drop table if exists foo;
create table foo(t text);
with x as (
insert into foo values ('t') returning 't' as t)
select foo.* from foo join x on foo.t = x.t;
I would expect it to return 1 row. Can someone explain what is going on?
select * from x