diff options
author | Philip Warner <pjw@rhyme.com.au> | 2001-01-12 04:32:07 +0000 |
---|---|---|
committer | Philip Warner <pjw@rhyme.com.au> | 2001-01-12 04:32:07 +0000 |
commit | 06ef1ef2ec8f51df700a230909c46a25f587f94d (patch) | |
tree | 1acfe459515dab82b58e7dc2d1bfef3599259e4b /src/bin/pg_dump/pg_backup_db.c | |
parent | 565639cde0787f32e20e0b51591a7ad0a07c2aff (diff) |
- Check ntuples == 1 for various SELECT statements.
- Fix handling of --tables=* (multiple tables never worked properly, AFAICT)
- strdup() the current user in DB routines
- Check results of IO routines more carefully.
- Check results of PQ routines more carefully.
Have not fixed index output yet.
Diffstat (limited to 'src/bin/pg_dump/pg_backup_db.c')
-rw-r--r-- | src/bin/pg_dump/pg_backup_db.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/bin/pg_dump/pg_backup_db.c b/src/bin/pg_dump/pg_backup_db.c index d84e25e3094..763d94fa80a 100644 --- a/src/bin/pg_dump/pg_backup_db.c +++ b/src/bin/pg_dump/pg_backup_db.c @@ -1,5 +1,14 @@ /*------------------------------------------------------------------------- * + * pg_backup_db.c + * + * Implements the basic DB functions used by the archiver. + * + * IDENTIFICATION + * + * Modifications - 04-Jan-2001 - pjw@rhyme.com.au + * + * - Check results of PQ routines more carefully. * *------------------------------------------------------------------------- */ @@ -449,14 +458,17 @@ int ExecuteSqlCommandBuf(ArchiveHandle* AH, void *qryv, int bufLen) /* fprintf(stderr, "Sending '%s' via COPY (at end = %d)\n\n", AH->pgCopyBuf->data, isEnd); */ - PQputline(AH->connection, AH->pgCopyBuf->data); + if (PQputline(AH->connection, AH->pgCopyBuf->data) != 0) + die_horribly(AH, "%s: error returned by PQputline\n", progname); resetPQExpBuffer(AH->pgCopyBuf); /* fprintf(stderr, "Buffer is '%s'\n", AH->pgCopyBuf->data); */ if(isEnd) { - PQendcopy(AH->connection); + if (PQendcopy(AH->connection) != 0) + die_horribly(AH, "%s: error returned by PQendcopy\n", progname); + AH->pgCopyIn = 0; break; } |