SQLite Forum

Use of RETURNING clause as a subquery
Login
The following in PostgreSQL only inserts a single row:

```
CREATE TABLE t1(a serial PRIMARY KEY);

WITH x AS (
    INSERT INTO t1 DEFAULT VALUES
    RETURNING a
  )
SELECT a
FROM x
UNION ALL SELECT a
FROM x;
```

If I recall correctly, SQLite "embeds" the WITH table as a subquery inside each use within the main statement. Would this result in the insertion of two rows?