1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-12 02:37:31 +03:00

Improve pg_dump and psql to use libpq's newer COPY support routines,

instead of the old deprecated ones.
Volkan Yazici, with some editorializing by moi.
This commit is contained in:
Tom Lane
2006-03-03 23:38:30 +00:00
parent 0b1b010c12
commit decdaf3592
4 changed files with 145 additions and 134 deletions

View File

@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.112 2006/02/12 03:30:21 tgl Exp $
* $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.113 2006/03/03 23:38:30 tgl Exp $
*/
#include "postgres_fe.h"
#include "common.h"
@@ -685,7 +685,10 @@ AcceptResult(const PGresult *result, const char *query)
break;
case PGRES_COPY_OUT:
/* keep cancel connection for copy out state */
/*
* Keep cancel connection active during copy out state.
* The matching ResetCancelConn() is in handleCopyOut.
*/
SetCancelConn();
break;
@@ -702,6 +705,7 @@ AcceptResult(const PGresult *result, const char *query)
psql_error("%s", error);
ReportSyntaxErrorPosition(result, query);
CheckConnection();
}
@@ -720,6 +724,9 @@ AcceptResult(const PGresult *result, const char *query)
* is true; nothing special is done when start_xact is false. Typically,
* start_xact = false is used for SELECTs and explicit BEGIN/COMMIT commands.
*
* Caller is responsible for handling the ensuing processing if a COPY
* command is sent.
*
* Note: we don't bother to check PQclientEncoding; it is assumed that no
* caller uses this path to issue "SET CLIENT_ENCODING".
*/