diff --git a/features/import-export.mdx b/features/import-export.mdx index 58ae708..d3eab08 100644 --- a/features/import-export.mdx +++ b/features/import-export.mdx @@ -318,6 +318,8 @@ When the preview cannot read the file in the chosen encoding, the dialog switche The import runs on the connection's own session, and afterwards puts back the session settings a dump changes: on MySQL and MariaDB the SQL mode, time zone, character set, `autocommit` and the foreign key and unique checks; on PostgreSQL the ones `pg_dump` sets, `search_path` among them. A file that stopped early with `autocommit` off while a transaction is still open keeps `autocommit` off, so commit or roll back that transaction yourself. +On PostgreSQL with **Wrap in transaction** on, `INSERT`, `UPDATE`, `DELETE`, `CREATE`, `ALTER`, `DROP`, `COMMENT`, `GRANT`, `REVOKE` and `TRUNCATE` statements go to the server together, up to 200 statements or 4 MiB at a time, so a dump over a slow link waits one round trip per batch instead of one per statement. A failure still stops at its own line, and nothing after it runs. Every other statement, and any statement holding a backslash, runs on its own. When a statement sent with others changes `standard_conforming_strings`, through a function that calls `set_config`, the import stops at the next statement it had already read, because that statement may end somewhere else under the new setting. Import that file with **Wrap in transaction** off. + On SQL Server a file that holds a `GO` line runs a batch at a time, cut at its `GO` lines the way `sqlcmd` cuts it, so every count and failure here is a batch rather than a statement. A file with no `GO` line runs a statement at a time. See [Scripts and batches](/databases/mssql#scripts-and-batches). On PostgreSQL, CockroachDB and KingbaseES the rows after a `COPY ... FROM STDIN`, the form `pg_dump` writes table rows in by default, load through the server's copy protocol inside the import's transaction, read from the file as they are sent. They run up to the line holding only `\.`, which is not sent, and never run as SQL. Text and CSV rows load. Binary rows cannot come from a file, so that `COPY` fails with no rows sent. The line under the progress bar counts the rows sent. **Stop** ends the `COPY` at once, with none of its rows loaded, and stops the import as a failed statement would: no **Stop Import?** question, and the import's own transaction rolls back. A transaction you opened yourself is left failed, so roll it back. On Redshift and PGlite, which cannot take rows this way, the file stops at the `COPY` before sending it, and the error names its line: dump it again with `pg_dump --inserts`. The `\restrict` and `\unrestrict` lines a current `pg_dump` writes run nothing. On MySQL and MariaDB a `DELIMITER` line is read as the `mysql` client reads it: only as the first thing on its line, before any statement text.