*
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.228 2001/09/06 02:07:42 tgl Exp $
+ *   $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.229 2001/09/07 01:11:50 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
    else
        progname = strrchr(argv[0], '/') + 1;
 
-   /* Set defaulty options based on progname */
+   /* Set default options based on progname */
    if (strcmp(progname, "pg_backup") == 0)
    {
        format = "c";
  * OprInfo* structure
  *
  * numOprs is set to the number of operators read in
- *
- *
  */
 OprInfo    *
 getOperators(int *numOprs)
  * return them in the AggInfo* structure
  *
  * numAggs is set to the number of aggregates read in
- *
- *
  */
 AggInfo    *
 getAggregates(int *numAggs)
  * in the system catalogs return them in the TableInfo* structure
  *
  * numTables is set to the number of tables read in
- *
- *
  */
 TableInfo  *
 getTables(int *numTables, FuncInfo *finfo, int numFuncs)
 
            resetPQExpBuffer(query);
            appendPQExpBuffer(query,
-                             "SELECT indexrelid FROM pg_index i WHERE i.indisprimary AND i.indrelid = %s ",
+                             "SELECT indexrelid FROM pg_index i WHERE i.indisprimary AND i.indrelid = '%s'::oid ",
                              tblinfo[i].oid);
            res2 = PQexec(g_conn, query->data);
            if (!res2 || PQresultStatus(res2) != PGRES_TUPLES_OK)
            resetPQExpBuffer(query);
            appendPQExpBuffer(query,
                              "SELECT relname FROM pg_class "
-                             "WHERE oid = %s",
+                             "WHERE oid = '%s'::oid",
                              tblinfo[i].pkIndexOid);
 
            res2 = PQexec(g_conn, query->data);
  * from the system catalogs return them in the InhInfo* structure
  *
  * numInherits is set to the number of tables read in
- *
- *
  */
 InhInfo    *
 getInherits(int *numInherits)
    if (fout->remoteVersion >= 70200)
    {
        appendPQExpBuffer(query, "SELECT description FROM pg_description "
-                         "WHERE objoid = %s and classoid = "
+                         "WHERE objoid = '%s'::oid and classoid = "
                          "(SELECT oid FROM pg_class where relname = '%s') "
                          "and objsubid = %d",
                          oid, classname, subid);
    else
    {
        /* Note: this will fail to find attribute comments in pre-7.2... */
-       appendPQExpBuffer(query, "SELECT description FROM pg_description WHERE objoid = %s", oid);
+       appendPQExpBuffer(query, "SELECT description FROM pg_description WHERE objoid = '%s'::oid", oid);
    }
 
    /*** Execute query ***/
 
    /* becomeUser(fout, finfo[i].usename); */
 
-   sprintf(query, "SELECT lanname FROM pg_language WHERE oid = %u",
+   sprintf(query, "SELECT lanname FROM pg_language WHERE oid = '%u'::oid",
            finfo[i].lang);
    res = PQexec(g_conn, query);
    if (!res ||
                int numRows;
                PQExpBuffer pred = createPQExpBuffer();
                
-               appendPQExpBuffer(pred, "SELECT pg_get_expr(indpred,indrelid) as pred FROM pg_index WHERE indexrelid = %s",
+               appendPQExpBuffer(pred, "SELECT pg_get_expr(indpred,indrelid) as pred FROM pg_index WHERE indexrelid = '%s'::oid",
                                  indinfo[i].indexreloid);
                res = PQexec(g_conn, pred->data);
                if (!res || PQresultStatus(res) != PGRES_TUPLES_OK)