* by PostgreSQL
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.308 2002/11/23 03:59:08 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.309 2002/11/29 16:38:42 momjian Exp $
*
*-------------------------------------------------------------------------
*/
"WHERE contypid = '%s'::pg_catalog.oid",
tinfo->oid);
+ PQclear(res);
res = PQexec(g_conn, chkquery->data);
if (!res ||
PQresultStatus(res) != PGRES_TUPLES_OK)
destroyPQExpBuffer(q);
destroyPQExpBuffer(delq);
destroyPQExpBuffer(query);
+ destroyPQExpBuffer(chkquery);
}
/*
* Portions Copyright (c) 1994, Regents of the University of California
*
*
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.10 2002/11/22 03:09:43 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.11 2002/11/29 16:38:42 momjian Exp $
*
*-------------------------------------------------------------------------
*/
for (i = 0; i < PQntuples(res); i++)
{
- PQExpBuffer buf = createPQExpBuffer();
+ PQExpBuffer buf;
char *dbname = PQgetvalue(res, i, 0);
char *dbowner = PQgetvalue(res, i, 1);
char *dbencoding = PQgetvalue(res, i, 2);
if (strcmp(dbname, "template1") == 0)
continue;
+ buf = createPQExpBuffer();
+
if (output_clean)
appendPQExpBuffer(buf, "DROP DATABASE %s\n;", fmtId(dbname));
exit(1);
}
}
+ PQclear(res);
return conn;
}