Have \copy go through SendQuery

Alvaro Herrera <alvherre@alvh.no-ip.org>

Commit: 08146775acd8bfe0fcc509c71857abb928697171
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2012-01-25T21:22:00Z
Releases: 9.2.0
Have \copy go through SendQuery

This enables a bunch of features, notably ON_ERROR_ROLLBACK.  It also
makes COPY failure (either in the server or psql) as a whole behave more
sanely in psql.

Additionally, having more commands in the same command line as COPY
works better (though since psql splits lines at semicolons, this doesn't
matter much unless you're using -c).

Also tighten a couple of switches on PQresultStatus() to add
PGRES_COPY_BOTH support and stop assuming that unknown statuses received
are errors; have those print diagnostics where warranted.

Author: Noah Misch

Files

PathChange+/−
src/bin/psql/command.c modified +0 −15
src/bin/psql/common.c modified +152 −53
src/bin/psql/copy.c modified +55 −56
src/test/regress/expected/copyselect.out modified +29 −2
src/test/regress/sql/copyselect.sql modified +14 −0