with foo as ( insert ... values ... returning * ), bar as ( insert ... select ... from foo returning * ) select ... from foo, bar, baz ...