1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-23 14:01:44 +03:00

Update psql for some features of new FE/BE protocol. There is a

client-side AUTOCOMMIT mode now: '\set AUTOCOMMIT off' supports
SQL-spec commit behavior.  Get rid of LO_TRANSACTION hack --- the
LO operations just work now, using libpq's ability to track the
transaction status.  Add a VERBOSE variable to control verboseness
of error message display, and add a %T prompt-string code to show
current transaction-block status.  Superuser state display in the
prompt string correctly follows SET SESSION AUTHORIZATION commands.
Control-C works to get out of COPY IN state.
This commit is contained in:
Tom Lane
2003-06-28 00:12:40 +00:00
parent ea20397b79
commit f9ebf36970
14 changed files with 476 additions and 463 deletions

View File

@ -3,7 +3,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
* $Header: /cvsroot/pgsql/src/bin/psql/copy.c,v 1.29 2003/03/20 06:00:12 momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/copy.c,v 1.30 2003/06/28 00:12:40 tgl Exp $
*/
#include "postgres_fe.h"
#include "copy.h"
@ -32,8 +32,6 @@
#define S_ISDIR(mode) __S_ISTYPE((mode), S_IFDIR)
#endif
bool copy_in_state;
/*
* parse_slash_copy
* -- parses \copy command line
@ -395,7 +393,7 @@ do_copy(const char *args)
return false;
}
result = PSQLexec(query.data, false);
result = PSQLexec(query.data, true);
termPQExpBuffer(&query);
switch (PQresultStatus(result))
@ -506,10 +504,6 @@ handleCopyIn(PGconn *conn, FILE *copystream, const char *prompt)
int ret;
unsigned int linecount = 0;
#ifdef USE_ASSERT_CHECKING
assert(copy_in_state);
#endif
if (prompt) /* disable prompt if not interactive */
{
if (!isatty(fileno(copystream)))
@ -563,7 +557,6 @@ handleCopyIn(PGconn *conn, FILE *copystream, const char *prompt)
linecount++;
}
ret = !PQendcopy(conn);
copy_in_state = false;
pset.lineno += linecount;
return ret;
}