aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/psql/help.c4
-rw-r--r--src/bin/psql/mainloop.c4
-rw-r--r--src/bin/scripts/createdb13
3 files changed, 12 insertions, 9 deletions
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index 261f1344203..fe1d76bc76c 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -3,7 +3,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.16 2000/02/07 23:10:06 petere Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.17 2000/02/10 20:08:56 petere Exp $
*/
#include <c.h>
#include "help.h"
@@ -54,7 +54,7 @@ usage(void)
if (!user)
{
#ifndef WIN32
- pw = getpwuid(getuid());
+ pw = getpwuid(geteuid());
if (pw)
user = pw->pw_name;
else
diff --git a/src/bin/psql/mainloop.c b/src/bin/psql/mainloop.c
index 325a6b5ed85..e16bf782f3b 100644
--- a/src/bin/psql/mainloop.c
+++ b/src/bin/psql/mainloop.c
@@ -3,7 +3,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/mainloop.c,v 1.17 2000/02/07 23:10:06 petere Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/mainloop.c,v 1.18 2000/02/10 20:08:56 petere Exp $
*/
#include <c.h>
#include "mainloop.h"
@@ -138,7 +138,7 @@ MainLoop(FILE *source)
/* Setting this will not have effect until next line. */
- die_on_error = GetVariableBool(pset.vars, "EXIT_ON_ERROR");
+ die_on_error = GetVariableBool(pset.vars, "ON_ERROR_STOP");
/*
* query_buf holds query already accumulated. line is the
diff --git a/src/bin/scripts/createdb b/src/bin/scripts/createdb
index 3fba2ae0e59..fd07e27292a 100644
--- a/src/bin/scripts/createdb
+++ b/src/bin/scripts/createdb
@@ -11,7 +11,7 @@
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.7 2000/01/19 20:08:35 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.8 2000/02/10 20:08:58 petere Exp $
#
#-------------------------------------------------------------------------
@@ -126,7 +126,7 @@ fi
if [ -n "$MB" ]
then
- mbcode=`pg_encoding "$MB"`
+ mbcode=`${PATHNAME}pg_encoding "$MB"`
if [ -z "$mbcode" ]
then
echo "$CMDNAME: \"$MB\" is not a valid encoding name"
@@ -135,9 +135,12 @@ then
fi
if [ -z "$dbname" ]; then
- echo "$CMDNAME: missing required argument database name"
- echo "Try -? for help."
- exit 1
+ if [ "$PGUSER" ]; then
+ dbname=$PGUSER
+ else
+ dbname=`${PATHNAME}pg_id -u -n`
+ fi
+ [ $? -ne 0 ] && exit 1
fi