Commit a1157deb authored by Bruce Momjian's avatar Bruce Momjian

Added fcvt() prot for bsdi.

Made PQsetdb() and PQfnumber() case-insensitive.
Removed attempt to set table ownership via pg_dumpall.
parent 98609261
...@@ -13,6 +13,14 @@ ...@@ -13,6 +13,14 @@
#ifndef PORT_PROTOS_H #ifndef PORT_PROTOS_H
#define 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 "fmgr.h" /* for func_ptr */
#include "utils/dynamic_loader.h" #include "utils/dynamic_loader.h"
......
...@@ -12,12 +12,11 @@ then ...@@ -12,12 +12,11 @@ then
else else
BS='\\' # System V BS='\\' # System V
fi fi
psql -l -A -q -t|cut -d"|" -f1-2 | tr '|' ' ' | grep -v '^template1 ' | \ psql -l -A -q -t| tr '|' ' ' | grep -v '^template1 ' | \
while read DATABASE USER while read DATABASE USERID USER
do do
echo "${BS}connect template1" echo "${BS}connect template1"
echo "create database $DATABASE;" echo "create database $DATABASE;"
echo "update pg_database set datdba = $USER where datname = '$DATABASE';"
echo "${BS}connect $DATABASE" echo "${BS}connect $DATABASE"
pg_dump "$@" $DATABASE pg_dump "$@" $DATABASE
done done
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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,6 +303,7 @@ PQsetdb(const char *pghost, const char* pgport, const char* pgoptions, const cha ...@@ -303,6 +303,7 @@ PQsetdb(const char *pghost, const char* pgport, const char* pgoptions, const cha
/* An error message from some service we call. */ /* An error message from some service we call. */
bool error; bool error;
/* We encountered an error that prevents successful completion */ /* We encountered an error that prevents successful completion */
int i;
conn = (PGconn*)malloc(sizeof(PGconn)); conn = (PGconn*)malloc(sizeof(PGconn));
...@@ -375,6 +376,9 @@ PQsetdb(const char *pghost, const char* pgport, const char* pgoptions, const cha ...@@ -375,6 +376,9 @@ PQsetdb(const char *pghost, const char* pgport, const char* pgoptions, const cha
((tmp = getenv("PGDATABASE")))) { ((tmp = getenv("PGDATABASE")))) {
conn->dbName = strdup(tmp); conn->dbName = strdup(tmp);
} else conn->dbName = strdup(conn->pguser); } 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; } else conn->dbName = NULL;
if (error) conn->status = CONNECTION_BAD; if (error) conn->status = CONNECTION_BAD;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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) ...@@ -1471,7 +1471,7 @@ PQfnumber(PGresult *res, const char* field_name)
return -1; return -1;
for (i=0;i<res->numAttributes;i++) { 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 i;
} }
return -1; return -1;
...@@ -1629,4 +1629,4 @@ PQgetisnull(PGresult *res, int tup_num, int field_num) ...@@ -1629,4 +1629,4 @@ PQgetisnull(PGresult *res, int tup_num, int field_num)
return 1; return 1;
else else
return 0; return 0;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment