Files
turso/postgres/server
roboturso db964725a9 postgres: support CREATE TABLE AS and SELECT INTO
Translate PostgreSQL CREATE TABLE AS and its legacy SELECT ... INTO
spelling into Turso's CREATE TABLE ... AS SELECT so the pg frontend can
create tables from query results. WITH NO DATA creates the table from
the SELECT's shape without copying rows, IF NOT EXISTS is honored, and
INTO in nested or compound positions is rejected rather than silently
dropped. The server reports completion as `SELECT n` like PostgreSQL,
except WITH NO DATA which keeps the plain CREATE TABLE AS tag.

Explicit column lists on CTAS are rejected because the engine derives
column names from the SELECT and cannot override them.

Tests: postgres/conformance/pg-sqltests/table.sqltest covers CTAS and
SELECT INTO behavior; postgres/cli/tests/tursopg.rs covers the wire
command tags; postgres/tests/integration covers the rejection paths
where Turso intentionally diverges from PostgreSQL.

Co-authored-by: theFestest <theFestest@users.noreply.github.com>
2026-07-26 21:58:00 +03:00
..
2026-07-16 12:40:03 +03:00