*** pg_dump.c.orig Mon Apr 15 09:45:58 2002 --- pg_dump.c Tue Jun 25 00:23:53 2002 *************** *** 2006,2012 **** finfo[i].prorettype = strdup(PQgetvalue(res, i, i_prorettype)); finfo[i].retset = (strcmp(PQgetvalue(res, i, i_proretset), "t") == 0); finfo[i].nargs = atoi(PQgetvalue(res, i, i_pronargs)); ! finfo[i].lang = atoi(PQgetvalue(res, i, i_prolang)); finfo[i].usename = strdup(PQgetvalue(res, i, i_usename)); finfo[i].iscachable = (strcmp(PQgetvalue(res, i, i_iscachable), "t") == 0); finfo[i].isstrict = (strcmp(PQgetvalue(res, i, i_isstrict), "t") == 0); --- 2006,2012 ---- finfo[i].prorettype = strdup(PQgetvalue(res, i, i_prorettype)); finfo[i].retset = (strcmp(PQgetvalue(res, i, i_proretset), "t") == 0); finfo[i].nargs = atoi(PQgetvalue(res, i, i_pronargs)); ! finfo[i].lang = atooid(PQgetvalue(res, i, i_prolang)); finfo[i].usename = strdup(PQgetvalue(res, i, i_usename)); finfo[i].iscachable = (strcmp(PQgetvalue(res, i, i_iscachable), "t") == 0); finfo[i].isstrict = (strcmp(PQgetvalue(res, i, i_isstrict), "t") == 0); *************** *** 2289,2295 **** resetPQExpBuffer(query); appendPQExpBuffer(query, ! "SELECT Oid FROM pg_index i WHERE i.indisprimary AND i.indrelid = %s ", tblinfo[i].oid); res2 = PQexec(g_conn, query->data); if (!res2 || PQresultStatus(res2) != PGRES_TUPLES_OK) --- 2289,2295 ---- resetPQExpBuffer(query); appendPQExpBuffer(query, ! "SELECT Oid FROM pg_index i WHERE i.indisprimary AND i.indrelid = oid(%s) ", tblinfo[i].oid); res2 = PQexec(g_conn, query->data); if (!res2 || PQresultStatus(res2) != PGRES_TUPLES_OK) *************** *** 2328,2340 **** appendPQExpBuffer(query, " SELECT c.relname " " FROM pg_index i, pg_class c " ! " WHERE i.indrelid = %s" " AND i.indisprimary " " AND c.oid = i.indexrelid" " UNION ALL " " SELECT NULL " " FROM pg_index i " ! " WHERE i.indrelid = %s" " AND i.indisprimary " " And NOT Exists(Select * From pg_class c Where c.oid = i.indexrelid)", tblinfo[i].oid, tblinfo[i].oid); --- 2328,2340 ---- appendPQExpBuffer(query, " SELECT c.relname " " FROM pg_index i, pg_class c " ! " WHERE i.indrelid = oid(%s)" " AND i.indisprimary " " AND c.oid = i.indexrelid" " UNION ALL " " SELECT NULL " " FROM pg_index i " ! " WHERE i.indrelid = oid(%s)" " AND i.indisprimary " " And NOT Exists(Select * From pg_class c Where c.oid = i.indexrelid)", tblinfo[i].oid, tblinfo[i].oid); *************** *** 2343,2349 **** appendPQExpBuffer(query, "SELECT c.relname " "FROM pg_index i LEFT OUTER JOIN pg_class c ON c.oid = i.indexrelid " ! "WHERE i.indrelid = %s" "AND i.indisprimary ", tblinfo[i].oid); } --- 2343,2349 ---- appendPQExpBuffer(query, "SELECT c.relname " "FROM pg_index i LEFT OUTER JOIN pg_class c ON c.oid = i.indexrelid " ! "WHERE i.indrelid = oid(%s)" "AND i.indisprimary ", tblinfo[i].oid); } *************** *** 3035,3040 **** --- 3035,3041 ---- query = createPQExpBuffer(); appendPQExpBuffer(query, "SELECT description FROM pg_description WHERE objoid = "); appendPQExpBuffer(query, oid); + appendPQExpBuffer(query, "::oid"); /*** Execute query ***/ *************** *** 3394,3400 **** /* becomeUser(fout, finfo[i].usename); */ ! sprintf(query, "SELECT lanname FROM pg_language WHERE oid = %u", finfo[i].lang); res = PQexec(g_conn, query); if (!res || --- 3395,3401 ---- /* becomeUser(fout, finfo[i].usename); */ ! sprintf(query, "SELECT lanname FROM pg_language WHERE oid = oid(%u)", finfo[i].lang); res = PQexec(g_conn, query); if (!res ||