Skip site navigation (1) Skip section navigation (2)

pgsql: Have \copy go through SendQuery

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Have \copy go through SendQuery
Date: 2012-01-25 21:23:50
Message-ID: E1RqAJq-0007jZ-GS@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
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

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/08146775acd8bfe0fcc509c71857abb928697171

Modified Files
--------------
src/bin/psql/command.c                   |   15 --
src/bin/psql/common.c                    |  205 ++++++++++++++++++++++--------
src/bin/psql/copy.c                      |  111 ++++++++--------
src/test/regress/expected/copyselect.out |   31 ++++-
src/test/regress/sql/copyselect.sql      |   14 ++
5 files changed, 250 insertions(+), 126 deletions(-)

pgsql-committers by date

Next:From: Robert HaasDate: 2012-01-26 01:42:01
Subject: pgsql: Instrument index-only scans to count heap fetches performed.
Previous:From: Robert HaasDate: 2012-01-25 20:31:17
Subject: pgsql: Make CheckIndexCompatible simpler and more bullet-proof.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group