diff --git a/src/backend/port/bsdi/port-protos.h b/src/backend/port/bsdi/port-protos.h
index 91e2e088136a2fed5faedea100563da44ae2a856..9d21bb151158e4989e76c515eab7555cf8713955 100644
--- a/src/backend/port/bsdi/port-protos.h
+++ b/src/backend/port/bsdi/port-protos.h
@@ -13,6 +13,14 @@
 #ifndef PORT_PROTOS_H
 #define PORT_PROTOS_H
 
+/*
+ * Externals in libc that need prototypes (or at least declarations)
+ */
+
+extern char *ecvt(double, int, int*, int*);
+extern char *fcvt(double, int, int*, int*);
+
+
 #include "fmgr.h"			/* for func_ptr */
 #include "utils/dynamic_loader.h"
 
diff --git a/src/bin/pg_dump/pg_dumpall b/src/bin/pg_dump/pg_dumpall
index 2cf83c3be11380e668ff2ecd66a5cea820a55ed5..dc1d0d6d2d7a3f051e41e2a3095f957ba4f9da6d 100644
--- a/src/bin/pg_dump/pg_dumpall
+++ b/src/bin/pg_dump/pg_dumpall
@@ -12,12 +12,11 @@ then
 else
 	BS='\\'			# System V
 fi
-psql -l -A -q -t|cut -d"|" -f1-2 | tr '|' ' ' | grep -v '^template1 ' | \
-while read DATABASE USER
+psql -l -A -q -t| tr '|' ' ' | grep -v '^template1 ' | \
+while read DATABASE USERID USER
 do
 	echo "${BS}connect template1"
 	echo "create database $DATABASE;"
-	echo "update pg_database set datdba = $USER where datname = '$DATABASE';"
 	echo "${BS}connect $DATABASE"
 	pg_dump "$@" $DATABASE
 done
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index 5309a37b19afebb04e6810fe20c82a998bd9fe30..c19ed020160661ac17ab70ce8aa694bb5c0dc423 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.34 1997/05/13 01:46:00 momjian Exp $
+ *    $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.35 1997/05/20 03:38:49 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -303,7 +303,8 @@ PQsetdb(const char *pghost, const char* pgport, const char* pgoptions, const cha
     /* An error message from some service we call. */
   bool error;   
     /* We encountered an error that prevents successful completion */
-
+  int i;
+  
   conn = (PGconn*)malloc(sizeof(PGconn));
 
   if (conn == NULL) 
@@ -375,6 +376,9 @@ PQsetdb(const char *pghost, const char* pgport, const char* pgoptions, const cha
           ((tmp = getenv("PGDATABASE")))) {
         conn->dbName = strdup(tmp);
       } else conn->dbName = strdup(conn->pguser);
+      for(i = 0; conn->dbName[i]; i++)
+	if (isupper(conn->dbName[i]))
+	  conn->dbName[i] = tolower(conn->dbName[i]);
     } else conn->dbName = NULL;
 
     if (error) conn->status = CONNECTION_BAD;
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c
index 5e92e4a63d24cfa89217b3dca1de508dbdf07949..65197c2fe4f94f07f68d4948535b1c8603a3da7b 100644
--- a/src/interfaces/libpq/fe-exec.c
+++ b/src/interfaces/libpq/fe-exec.c
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.28 1997/01/24 17:47:33 scrappy Exp $
+ *    $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.29 1997/05/20 03:39:02 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1471,7 +1471,7 @@ PQfnumber(PGresult *res, const char* field_name)
     return  -1;
 
   for (i=0;i<res->numAttributes;i++) {
-    if ( strcmp(field_name, res->attDescs[i].name) == 0 )
+    if ( strcasecmp(field_name, res->attDescs[i].name) == 0 )
       return i;
   }
   return -1;
@@ -1629,4 +1629,4 @@ PQgetisnull(PGresult *res, int tup_num, int field_num)
         return 1;
     else
         return 0;
-  }
+}