aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/pg_backup_db.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-05-29 01:38:56 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-05-29 01:38:56 +0000
commit49bf04ba8cd3390dd4abbc7e10242f60f67c1f93 (patch)
tree1fc3a92aa69e918669dba5ff4d0732bc2d2477a0 /src/bin/pg_dump/pg_backup_db.c
parentdc20063e43d6bbc97381c03b7651c5bbafea7f35 (diff)
downloadpostgresql-49bf04ba8cd3390dd4abbc7e10242f60f67c1f93.tar.gz
postgresql-49bf04ba8cd3390dd4abbc7e10242f60f67c1f93.zip
Fix some more not-schema-aware queries in pg_dump. Also fix some places
that would do the wrong thing with BLOB OIDs exceeding 2G.
Diffstat (limited to 'src/bin/pg_dump/pg_backup_db.c')
-rw-r--r--src/bin/pg_dump/pg_backup_db.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/bin/pg_dump/pg_backup_db.c b/src/bin/pg_dump/pg_backup_db.c
index eb7bcafbc30..fd0c8bd920a 100644
--- a/src/bin/pg_dump/pg_backup_db.c
+++ b/src/bin/pg_dump/pg_backup_db.c
@@ -5,7 +5,7 @@
* Implements the basic DB functions used by the archiver.
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.32 2002/05/10 22:36:26 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.33 2002/05/29 01:38:56 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -729,7 +729,7 @@ FixupBlobRefs(ArchiveHandle *AH, TocEntry *te)
appendPQExpBuffer(tblQry,
"SELECT a.attname FROM "
"pg_catalog.pg_attribute a, pg_catalog.pg_type t "
- "WHERE a.attnum > 0 AND a.attrelid = '%s'::regclass "
+ "WHERE a.attnum > 0 AND a.attrelid = '%s'::pg_catalog.regclass "
"AND a.atttypid = t.oid AND t.typname in ('oid', 'lo')",
tblName->data);
@@ -799,7 +799,7 @@ CreateBlobXrefTable(ArchiveHandle *AH)
ahlog(AH, 1, "creating table for large object cross-references\n");
- appendPQExpBuffer(qry, "Create Temporary Table %s(oldOid oid, newOid oid);", BLOB_XREF_TABLE);
+ appendPQExpBuffer(qry, "Create Temporary Table %s(oldOid pg_catalog.oid, newOid pg_catalog.oid);", BLOB_XREF_TABLE);
ExecuteSqlCommand(AH, qry, "could not create large object cross-reference table", true);
@@ -812,11 +812,13 @@ CreateBlobXrefTable(ArchiveHandle *AH)
}
void
-InsertBlobXref(ArchiveHandle *AH, int old, int new)
+InsertBlobXref(ArchiveHandle *AH, Oid old, Oid new)
{
PQExpBuffer qry = createPQExpBuffer();
- appendPQExpBuffer(qry, "Insert Into %s(oldOid, newOid) Values (%d, %d);", BLOB_XREF_TABLE, old, new);
+ appendPQExpBuffer(qry,
+ "Insert Into %s(oldOid, newOid) Values ('%u', '%u');",
+ BLOB_XREF_TABLE, old, new);
ExecuteSqlCommand(AH, qry, "could not create large object cross-reference entry", true);