Commit 65e00518 authored by Peter Eisentraut's avatar Peter Eisentraut

another round of user interface cleanups

removed pg_id
fixed a few bugs in the scripts
parent ea1f6e00
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/createlang.sgml,v 1.3 1999/12/05 20:02:42 momjian Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/createlang.sgml,v 1.4 2000/01/19 20:08:22 petere Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -114,16 +114,6 @@ createlang [ <replaceable class="parameter">connection options</replaceable> ] - ...@@ -114,16 +114,6 @@ createlang [ <replaceable class="parameter">connection options</replaceable> ] -
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term>-e, --echo</term>
<listitem>
<para>
Echo the commands that <application>createlang</application> generates
and sends to the backend.
</para>
</listitem>
</varlistentry>
</variablelist> </variablelist>
</para> </para>
</refsect2> </refsect2>
...@@ -142,9 +132,6 @@ createlang [ <replaceable class="parameter">connection options</replaceable> ] - ...@@ -142,9 +132,6 @@ createlang [ <replaceable class="parameter">connection options</replaceable> ] -
for details. Check also under <xref linkend="APP-PSQL" endterm="APP-PSQL-title"> for details. Check also under <xref linkend="APP-PSQL" endterm="APP-PSQL-title">
for more possibilities. for more possibilities.
</para> </para>
<para>
No output is generated if <application>createlang</application> succeeds.
</para>
</refsect2> </refsect2>
</refsynopsisdiv> </refsynopsisdiv>
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/droplang.sgml,v 1.1 1999/12/05 20:04:39 momjian Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/droplang.sgml,v 1.2 2000/01/19 20:08:22 petere Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -114,16 +114,6 @@ droplang [ <replaceable class="parameter">connection options</replaceable> ] --l ...@@ -114,16 +114,6 @@ droplang [ <replaceable class="parameter">connection options</replaceable> ] --l
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term>-e, --echo</term>
<listitem>
<para>
Echo the commands that <application>droplang</application> generates
and sends to the backend.
</para>
</listitem>
</varlistentry>
</variablelist> </variablelist>
</para> </para>
</refsect2> </refsect2>
...@@ -142,9 +132,6 @@ droplang [ <replaceable class="parameter">connection options</replaceable> ] --l ...@@ -142,9 +132,6 @@ droplang [ <replaceable class="parameter">connection options</replaceable> ] --l
for details. Check also under <xref linkend="APP-PSQL" endterm="APP-PSQL-title"> for details. Check also under <xref linkend="APP-PSQL" endterm="APP-PSQL-title">
for more possibilities. for more possibilities.
</para> </para>
<para>
No output is generated if <application>droplang</application> succeeds.
</para>
</refsect2> </refsect2>
</refsynopsisdiv> </refsynopsisdiv>
......
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Makefile # Makefile
# Makefile for src/bin (utility programs) # Makefile for src/bin (client programs)
# #
# Copyright (c) 1994, Regents of the University of California # Copyright (c) 1994, Regents of the University of California
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/Makefile,v 1.23 2000/01/19 02:58:59 petere Exp $ # $Header: /cvsroot/pgsql/src/bin/Makefile,v 1.24 2000/01/19 20:08:23 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.80 2000/01/18 00:03:35 petere Exp $ # $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.81 2000/01/19 20:08:24 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -235,7 +235,7 @@ if [ "$usage" ]; then ...@@ -235,7 +235,7 @@ if [ "$usage" ]; then
echo " -d, --debug Generate lots of debugging output" echo " -d, --debug Generate lots of debugging output"
echo " -n, --noclean Do not clean up after errors" echo " -n, --noclean Do not clean up after errors"
echo echo
echo "Report bugs to <bugs@postgresql.org>." echo "Report bugs to <pgsql-bugs@postgresql.org>."
exit 0 exit 0
fi fi
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/initlocation.sh,v 1.4 2000/01/18 00:03:36 petere Exp $ # $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/initlocation.sh,v 1.5 2000/01/19 20:08:25 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -68,7 +68,7 @@ if [ "$usage" ]; then ...@@ -68,7 +68,7 @@ if [ "$usage" ]; then
echo "Usage:" echo "Usage:"
echo " $CMDNAME <location>" echo " $CMDNAME <location>"
echo "" echo ""
echo "Report bugs to <bugs@postgresql.org>." echo "Report bugs to <pgsql-bugs@postgresql.org>."
exit 0 exit 0
fi fi
......
#!/bin/sh #!/bin/sh
# #
# $Header: /cvsroot/pgsql/src/bin/ipcclean/Attic/ipcclean.sh,v 1.3 2000/01/18 00:03:36 petere Exp $ # $Header: /cvsroot/pgsql/src/bin/ipcclean/Attic/ipcclean.sh,v 1.4 2000/01/19 20:08:27 petere Exp $
# #
CMDNAME=`basename $0` CMDNAME=`basename $0`
...@@ -13,7 +13,7 @@ if [ "$1" = '-?' -o "$1" = "--help" ]; then ...@@ -13,7 +13,7 @@ if [ "$1" = '-?' -o "$1" = "--help" ]; then
echo echo
echo "Note: Since the utilities underlying this script are very different" echo "Note: Since the utilities underlying this script are very different"
echo "from platform to platform, chances are that it might not work on" echo "from platform to platform, chances are that it might not work on"
echo "yours. If that is the case, please write to <bugs@postgresql.org>" echo "yours. If that is the case, please write to <pgsql-bugs@postgresql.org>"
echo "so that your platform can be supported in the future." echo "so that your platform can be supported in the future."
exit 0 exit 0
fi fi
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.136 2000/01/19 02:58:59 petere Exp $ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.137 2000/01/19 20:08:30 petere Exp $
* *
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb * Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
* *
...@@ -167,7 +167,7 @@ help(const char *progname) ...@@ -167,7 +167,7 @@ help(const char *progname)
); );
#endif #endif
puts("If no database name is not supplied, then the PGDATABASE environment\nvariable value is used.\n"); puts("If no database name is not supplied, then the PGDATABASE environment\nvariable value is used.\n");
puts("Report bugs to <bugs@postgresql.org>."); puts("Report bugs to <pgsql-bugs@postgresql.org>.");
} }
......
#-------------------------------------------------------------------------
#
# Makefile.inc--
# Makefile for bin/pg_id
#
# Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/Makefile,v 1.12 1999/01/17 06:19:10 momjian Exp $
#
#-------------------------------------------------------------------------
SRCDIR= ../..
include ../../Makefile.global
OBJS= pg_id.o
#
# And where libpq goes, so goes the authentication stuff...
#
ifdef KRBVERS
LDFLAGS+= $(KRBLIBS)
CFLAGS+= $(KRBFLAGS)
endif
all: pg_id
pg_id: $(OBJS) $(LIBPQDIR)/libpq.a
$(CC) -o pg_id -L$(LIBPQDIR) $(OBJS) -lpq $(LDFLAGS)
$(LIBPQDIR)/libpq.a:
$(MAKE) -C $(LIBPQDIR) libpq.a
install: pg_id
$(INSTALL) $(INSTL_EXE_OPTS) pg_id$(X) $(BINDIR)/pg_id$(X)
depend dep:
$(CC) -MM $(CFLAGS) *.c >depend
clean:
rm -f pg_id$(X) $(OBJS)
ifeq (depend,$(wildcard depend))
include depend
endif
/*-------------------------------------------------------------------------
*
* pg_id.c
* Print the user ID for the login name passed as argument,
* or the real user ID of the caller if no argument. If the
* login name doesn't exist, print "NOUSER" and exit 1.
*
* Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/pg_id.c,v 1.9 1999/07/19 02:27:09 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <pwd.h>
#include "postgres.h"
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif
int
main(int argc, char **argv)
{
struct passwd *pw;
int ch;
extern int optind;
while ((ch = getopt(argc, argv, "")) != EOF)
switch (ch)
{
case '?':
default:
fprintf(stderr, "usage: pg_id [login]\n");
exit(1);
}
argc -= optind;
argv += optind;
if (argc > 0)
{
if (argc > 1)
{
fprintf(stderr, "usage: pg_id [login]\n");
exit(1);
}
if ((pw = getpwnam(argv[0])) == NULL)
{
printf("NOUSER\n");
exit(1);
}
printf("%ld\n", (long) pw->pw_uid);
}
else
printf("%ld\n", (long) getuid());
exit(0);
}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright 2000 by PostgreSQL Global Development Team * Copyright 2000 by PostgreSQL Global Development Team
* *
* $Header: /cvsroot/pgsql/src/bin/psql/common.c,v 1.9 2000/01/18 23:30:23 petere Exp $ * $Header: /cvsroot/pgsql/src/bin/psql/common.c,v 1.10 2000/01/19 20:08:33 petere Exp $
*/ */
#include <c.h> #include <c.h>
#include "common.h" #include "common.h"
...@@ -146,7 +146,7 @@ psql_error(const char *fmt, ...) ...@@ -146,7 +146,7 @@ psql_error(const char *fmt, ...)
fflush(pset.queryFout); fflush(pset.queryFout);
if (pset.inputfile) if (pset.inputfile)
fprintf(stderr, "%s:%u: ", pset.inputfile ? pset.inputfile : pset.progname, pset.lineno); fprintf(stderr, "%s:%s:%u: ", pset.progname, pset.inputfile, pset.lineno);
va_start(ap, fmt); va_start(ap, fmt);
vfprintf(stderr, fmt, ap); vfprintf(stderr, fmt, ap);
va_end(ap); va_end(ap);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright 2000 by PostgreSQL Global Development Team * Copyright 2000 by PostgreSQL Global Development Team
* *
* $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.11 2000/01/18 23:30:23 petere Exp $ * $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.12 2000/01/19 20:08:34 petere Exp $
*/ */
#include <c.h> #include <c.h>
#include "help.h" #include "help.h"
...@@ -129,7 +129,7 @@ usage(void) ...@@ -129,7 +129,7 @@ usage(void)
puts( "(for SQL commands) from within psql, or consult the psql section in"); puts( "(for SQL commands) from within psql, or consult the psql section in");
puts( "the PostgreSQL manual, which accompanies the distribution and is also"); puts( "the PostgreSQL manual, which accompanies the distribution and is also");
puts( "available at <http://www.postgresql.org>."); puts( "available at <http://www.postgresql.org>.");
puts( "Report bugs to <bugs@postgresql.org>."); puts( "Report bugs to <pgsql-bugs@postgresql.org>.");
#ifndef WIN32 #ifndef WIN32
if (pw) if (pw)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright 2000 by PostgreSQL Global Development Team * Copyright 2000 by PostgreSQL Global Development Team
* *
* $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.16 2000/01/18 23:30:24 petere Exp $ * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.17 2000/01/19 20:08:34 petere Exp $
*/ */
#include <c.h> #include <c.h>
...@@ -205,10 +205,18 @@ main(int argc, char **argv) ...@@ -205,10 +205,18 @@ main(int argc, char **argv)
successResult = process_file(options.action_string) ? 0 : 1; successResult = process_file(options.action_string) ? 0 : 1;
/* process slash command if one was given to -c */ /* process slash command if one was given to -c */
else if (options.action == ACT_SINGLE_SLASH) else if (options.action == ACT_SINGLE_SLASH)
{
if (GetVariable(pset.vars, "ECHO") && strcmp(GetVariable(pset.vars, "ECHO"), "full")==0)
puts(options.action_string);
successResult = HandleSlashCmds(options.action_string, NULL, NULL) != CMD_ERROR ? 0 : 1; successResult = HandleSlashCmds(options.action_string, NULL, NULL) != CMD_ERROR ? 0 : 1;
}
/* If the query given to -c was a normal one, send it */ /* If the query given to -c was a normal one, send it */
else if (options.action == ACT_SINGLE_QUERY) else if (options.action == ACT_SINGLE_QUERY)
{
if (GetVariable(pset.vars, "ECHO") && strcmp(GetVariable(pset.vars, "ECHO"), "full")==0)
puts(options.action_string);
successResult = SendQuery( options.action_string) ? 0 : 1; successResult = SendQuery( options.action_string) ? 0 : 1;
}
/* or otherwise enter interactive main loop */ /* or otherwise enter interactive main loop */
else else
{ {
......
...@@ -11,11 +11,12 @@ ...@@ -11,11 +11,12 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.6 2000/01/12 19:36:36 petere Exp $ # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.7 2000/01/19 20:08:35 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
CMDNAME=`basename $0` CMDNAME=`basename $0`
PATHNAME=`echo $0 | sed "s,$CMDNAME\$,,"`
MB= MB=
PSQLOPT= PSQLOPT=
...@@ -49,15 +50,12 @@ do ...@@ -49,15 +50,12 @@ do
--port=*) --port=*)
PSQLOPT="$PSQLOPT -p "`echo $1 | sed 's/^--port=//'` PSQLOPT="$PSQLOPT -p "`echo $1 | sed 's/^--port=//'`
;; ;;
--user|--username|-U) --username|-U)
PSQLOPT="$PSQLOPT -U '$2'" PSQLOPT="$PSQLOPT -U $2"
shift;; shift;;
-U*) -U*)
PSQLOPT="$PSQLOPT $1" PSQLOPT="$PSQLOPT $1"
;; ;;
--user=*)
PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--user=//'`
;;
--username=*) --username=*)
PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--username=//'` PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--username=//'`
;; ;;
...@@ -90,7 +88,7 @@ do ...@@ -90,7 +88,7 @@ do
MB=`echo $1 | sed 's/^--encoding=//'` MB=`echo $1 | sed 's/^--encoding=//'`
;; ;;
-*) -*)
echo "$CMDNAME: unrecognized option: $1" echo "$CMDNAME: invalid option: $1"
echo "Try -? for help." echo "Try -? for help."
exit 1 exit 1
;; ;;
...@@ -106,16 +104,22 @@ do ...@@ -106,16 +104,22 @@ do
done done
if [ "$usage" ]; then if [ "$usage" ]; then
echo "Usage: $CMDNAME [options] dbname [description]" echo "$CMDNAME creates a PostgreSQL database."
echo "" echo
echo "Usage:"
echo " $CMDNAME [options] dbname [description]"
echo
echo "Options:"
echo " -D, --location=PATH Alternative place to store the database" echo " -D, --location=PATH Alternative place to store the database"
echo " -E, --encoding=ENCODING Multibyte encoding for the database" echo " -E, --encoding=ENCODING Multibyte encoding for the database"
echo " -h, --host=HOSTNAME Database server host" echo " -h, --host=HOSTNAME Database server host"
echo " -p, --port=PORT Database server port" echo " -p, --port=PORT Database server port"
echo " -U, --username=USERNAME Username to connect as" echo " -U, --username=USERNAME Username to connect as"
echo " -W, --password Prompt for password" echo " -W, --password Prompt for password"
#??? echo " -e, --echo " echo " -e, --echo Show the query being sent to the backend"
echo " -q, --quiet Don't write any messages" echo " -q, --quiet Don't write any messages"
echo
echo "Report bugs to <pgsql-bugs@postgresql.org>."
exit 0 exit 0
fi fi
...@@ -146,7 +150,7 @@ withstring= ...@@ -146,7 +150,7 @@ withstring=
[ "$MB" ] && withstring="$withstring ENCODING = '$MB'" [ "$MB" ] && withstring="$withstring ENCODING = '$MB'"
[ "$withstring" ] && withstring=" WITH$withstring" [ "$withstring" ] && withstring=" WITH$withstring"
psql $PSQLOPT -d template1 -c "CREATE DATABASE \"$dbname\"$withstring" ${PATHNAME}psql $PSQLOPT -d template1 -c "CREATE DATABASE \"$dbname\"$withstring"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "$CMDNAME: database creation failed" echo "$CMDNAME: database creation failed"
exit 1 exit 1
...@@ -157,7 +161,7 @@ fi ...@@ -157,7 +161,7 @@ fi
dbcomment=`echo $dbcomment | sed "s/'/\\\\\'/g"` dbcomment=`echo $dbcomment | sed "s/'/\\\\\'/g"`
psql $PSQLOPT -d template1 -c "COMMENT ON DATABASE \"$dbname\" IS '$dbcomment'" ${PATHNAME}psql $PSQLOPT -d template1 -c "COMMENT ON DATABASE \"$dbname\" IS '$dbcomment'"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "$CMDNAME: comment creation failed (database was created)" echo "$CMDNAME: comment creation failed (database was created)"
exit 1 exit 1
......
...@@ -8,16 +8,16 @@ ...@@ -8,16 +8,16 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.5 2000/01/12 19:36:36 petere Exp $ # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.6 2000/01/19 20:08:35 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
CMDNAME=`basename $0` CMDNAME=`basename $0`
PATHNAME=`echo $0 | sed "s,$CMDNAME\$,,"`
PSQLOPT= PSQLOPT=
dbname= dbname=
langname= langname=
echo=
list= list=
# Check for echo -n vs echo \c # Check for echo -n vs echo \c
...@@ -65,25 +65,19 @@ do ...@@ -65,25 +65,19 @@ do
--port=*) --port=*)
PSQLOPT="$PSQLOPT -p "`echo $1 | sed 's/^--port=//'` PSQLOPT="$PSQLOPT -p "`echo $1 | sed 's/^--port=//'`
;; ;;
--user|--username|-U) --username|-U)
PSQLOPT="$PSQLOPT -U '$2'" PSQLOPT="$PSQLOPT -U $2"
shift;; shift;;
-U*) -U*)
PSQLOPT="$PSQLOPT $1" PSQLOPT="$PSQLOPT $1"
;; ;;
--user=*)
PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--user=//'`
;;
--username=*) --username=*)
PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--username=//'` PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--username=//'`
;; ;;
--password|-W) --password|-W)
PSQLOPT="$PSQLOPT -W" PSQLOPT="$PSQLOPT -W"
;; ;;
--echo|-e) --dbname|-d)
echo=t
;;
--dbname|--database|-d)
dbname="$2" dbname="$2"
shift;; shift;;
-d*) -d*)
...@@ -92,9 +86,6 @@ do ...@@ -92,9 +86,6 @@ do
--dbname=*) --dbname=*)
dbname=`echo $1 | sed 's/^--dbname=//'` dbname=`echo $1 | sed 's/^--dbname=//'`
;; ;;
--database=*)
dbname=`echo $1 | sed 's/^--database=//'`
;;
# misc options # misc options
--pglib|-L) --pglib|-L)
PGLIB="$2" PGLIB="$2"
...@@ -107,7 +98,7 @@ do ...@@ -107,7 +98,7 @@ do
;; ;;
-*) -*)
echo "$CMDNAME: unrecognized option: $1" echo "$CMDNAME: invalid option: $1"
echo "Try -? for help." echo "Try -? for help."
exit 1 exit 1
;; ;;
...@@ -123,25 +114,24 @@ do ...@@ -123,25 +114,24 @@ do
done done
if [ "$usage" ]; then if [ "$usage" ]; then
echo "" echo "$CMDNAME installs a procedural language into a PostgreSQL database."
echo "Usage: $CMDNAME [options] [langname [dbname]]" echo
echo "" echo "Usage:"
echo " $CMDNAME [options] [langname [dbname]]"
echo
echo "Options:"
echo " -h, --host=HOSTNAME Database server host" echo " -h, --host=HOSTNAME Database server host"
echo " -p, --port=PORT Database server port" echo " -p, --port=PORT Database server port"
echo " -U, --username=USERNAME Username to connect as" echo " -U, --username=USERNAME Username to connect as"
echo " -W, --password Prompt for password" echo " -W, --password Prompt for password"
echo " -d, --dbname=DBNAME Database to install language in" echo " -d, --dbname=DBNAME Database to install language in"
echo " -e, --echo Create some output about what is happening"
echo " -L, --pglib=PGLIB Find language interpreter in directory PGLIB" echo " -L, --pglib=PGLIB Find language interpreter in directory PGLIB"
echo " -l, --list Show a list of currently installed languages" echo " -l, --list Show a list of currently installed languages"
echo
echo "Report bugs to <pgsql-bugs@postgresql.org>."
exit 0 exit 0
fi fi
if [ "$list" ]; then
psql $PSQLOPT -d "$dbname" -c "SELECT lanname, lanpltrusted, lancompiler FROM pg_language WHERE lanispl = 't'"
exit $?
fi
# ---------- # ----------
# Check that we have a database # Check that we have a database
...@@ -153,6 +143,15 @@ if [ -z "$dbname" ]; then ...@@ -153,6 +143,15 @@ if [ -z "$dbname" ]; then
fi fi
# ----------
# List option
# ----------
if [ "$list" ]; then
${PATHNAME}psql $PSQLOPT -d "$dbname" -P 'title=Procedural languages' -c "SELECT lanname as \"Name\", lanpltrusted as \"Trusted?\", lancompiler as \"Compiler\" FROM pg_language WHERE lanispl = 't'"
exit $?
fi
# ---------- # ----------
# Check that we have PGLIB # Check that we have PGLIB
# ---------- # ----------
...@@ -210,13 +209,7 @@ if [ ! -f $PGLIB/${langname}__DLSUFFIX__ ]; then ...@@ -210,13 +209,7 @@ if [ ! -f $PGLIB/${langname}__DLSUFFIX__ ]; then
fi fi
if [ "$echo" ]; then PSQL="${PATHNAME}psql -A -t -q $PSQLOPT -d $dbname -c"
PSQLOPT="$PSQLOPT -e"
else
PSQLOPT="$PSQLOPT -q"
fi
PSQL="psql -A -t $PSQLOPT -d $dbname -c"
# ---------- # ----------
# Make sure the language isn't already installed # Make sure the language isn't already installed
...@@ -254,4 +247,5 @@ if [ $? -ne 0 ]; then ...@@ -254,4 +247,5 @@ if [ $? -ne 0 ]; then
exit 1 exit 1
fi fi
echo "Ok"
exit 0 exit 0
...@@ -8,13 +8,14 @@ ...@@ -8,13 +8,14 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.7 2000/01/19 02:59:01 petere Exp $ # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.8 2000/01/19 20:08:36 petere Exp $
# #
# Note - this should NOT be setuid. # Note - this should NOT be setuid.
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
CMDNAME=`basename $0` CMDNAME=`basename $0`
PATHNAME=`echo $0 | sed "s,$CMDNAME\$,,"`
NewUser= NewUser=
SysID= SysID=
...@@ -64,15 +65,12 @@ do ...@@ -64,15 +65,12 @@ do
;; ;;
# Note: These two specify the user to connect as (like in psql), # Note: These two specify the user to connect as (like in psql),
# not the user you're creating. # not the user you're creating.
--user|--username|-U) --username|-U)
PSQLOPT="$PSQLOPT -U '$2'" PSQLOPT="$PSQLOPT -U $2"
shift;; shift;;
-U*) -U*)
PSQLOPT="$PSQLOPT $1" PSQLOPT="$PSQLOPT $1"
;; ;;
--user=*)
PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--user=//'`
;;
--username=*) --username=*)
PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--username=//'` PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--username=//'`
;; ;;
...@@ -111,7 +109,7 @@ do ...@@ -111,7 +109,7 @@ do
PwPrompt=t PwPrompt=t
;; ;;
-*) -*)
echo "$CMDNAME: unrecognized option: $1" echo "$CMDNAME: invalid option: $1"
echo "Try -? for help." echo "Try -? for help."
exit 1 exit 1
;; ;;
...@@ -123,8 +121,12 @@ do ...@@ -123,8 +121,12 @@ do
done done
if [ "$usage" ]; then if [ "$usage" ]; then
echo "Usage: $CMDNAME [options] [username]" echo "$CMDNAME creates a new PostgreSQL user."
echo "" echo
echo "Usage:"
echo " $CMDNAME [options] [username]"
echo
echo "Options:"
echo " -d, --createdb User can create new databases" echo " -d, --createdb User can create new databases"
echo " -D, --no-createdb User cannot create databases" echo " -D, --no-createdb User cannot create databases"
echo " -a, --adduser User can add new users" echo " -a, --adduser User can add new users"
...@@ -135,8 +137,10 @@ if [ "$usage" ]; then ...@@ -135,8 +137,10 @@ if [ "$usage" ]; then
echo " -p, --port=PORT Database server port" echo " -p, --port=PORT Database server port"
echo " -U, --username=USERNAME Username to connect as (not the one to create)" echo " -U, --username=USERNAME Username to connect as (not the one to create)"
echo " -W, --password Prompt for password to connect" echo " -W, --password Prompt for password to connect"
#??? echo " -e, --echo " echo " -e, --echo Show the query being sent to the backend"
echo " -q, --quiet Don't write any messages" echo " -q, --quiet Don't write any messages"
echo
echo "Report bugs to <pgsql-bugs@postgresql.org>."
exit 0 exit 0
fi fi
...@@ -219,7 +223,7 @@ SUBQUERY= ...@@ -219,7 +223,7 @@ SUBQUERY=
[ "$CanAddUser" = t ] && QUERY="$QUERY CREATEUSER" [ "$CanAddUser" = t ] && QUERY="$QUERY CREATEUSER"
[ "$CanAddUser" = f ] && QUERY="$QUERY NOCREATEUSER" [ "$CanAddUser" = f ] && QUERY="$QUERY NOCREATEUSER"
psql $PSQLOPT -d template1 -c "$QUERY" ${PATHNAME}psql -c "$QUERY" -d template1 $PSQLOPT
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "$CMDNAME: creation of user \"$NewUser\" failed" echo "$CMDNAME: creation of user \"$NewUser\" failed"
exit 1 exit 1
......
...@@ -10,11 +10,12 @@ ...@@ -10,11 +10,12 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropdb,v 1.5 2000/01/12 19:36:36 petere Exp $ # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropdb,v 1.6 2000/01/19 20:08:36 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
CMDNAME=`basename $0` CMDNAME=`basename $0`
PATHNAME=`echo $0 | sed "s,$CMDNAME\$,,"`
PSQLOPT= PSQLOPT=
dbname= dbname=
...@@ -58,15 +59,12 @@ do ...@@ -58,15 +59,12 @@ do
--port=*) --port=*)
PSQLOPT="$PSQLOPT -p "`echo $1 | sed 's/^--port=//'` PSQLOPT="$PSQLOPT -p "`echo $1 | sed 's/^--port=//'`
;; ;;
--user|--username|-U) --username|-U)
PSQLOPT="$PSQLOPT -U '$2'" PSQLOPT="$PSQLOPT -U $2"
shift;; shift;;
-U*) -U*)
PSQLOPT="$PSQLOPT $1" PSQLOPT="$PSQLOPT $1"
;; ;;
--user=*)
PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--user=//'`
;;
--username=*) --username=*)
PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--username=//'` PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--username=//'`
;; ;;
...@@ -84,7 +82,8 @@ do ...@@ -84,7 +82,8 @@ do
forcedel=f forcedel=f
;; ;;
-*) -*)
echo "$CMDNAME: Unrecognized option: $1. Try -? for help." echo "$CMDNAME: invalid option: $1"
echo "Try -? for help."
exit 1 exit 1
;; ;;
*) *)
...@@ -96,15 +95,21 @@ done ...@@ -96,15 +95,21 @@ done
if [ "$usage" ]; then if [ "$usage" ]; then
echo "Usage: $CMDNAME [options] dbname" echo "$CMDNAME removes a PostgreSQL database."
echo "" echo
echo "Usage:"
echo " $CMDNAME [options] dbname"
echo
echo "Options:"
echo " -h, --host=HOSTNAME Database server host" echo " -h, --host=HOSTNAME Database server host"
echo " -p, --port=PORT Database server port" echo " -p, --port=PORT Database server port"
echo " -U, --username=USERNAME Username to connect as" echo " -U, --username=USERNAME Username to connect as"
echo " -W, --password Prompt for password" echo " -W, --password Prompt for password"
echo " -i, --interactive Prompt before deleting anything" echo " -i, --interactive Prompt before deleting anything"
#??? echo " -e, --echo " echo " -e, --echo Show the query being sent to the backend"
echo " -q, --quiet Don't write any messages" echo " -q, --quiet Don't write any messages"
echo
echo "Report bugs to <pgsql-bugs@postgresql.org>."
exit 0 exit 0
fi fi
...@@ -127,7 +132,7 @@ fi ...@@ -127,7 +132,7 @@ fi
dbname=`echo $dbname | sed 's/\"/\\\"/g'` dbname=`echo $dbname | sed 's/\"/\\\"/g'`
psql $PSQLOPT -d template1 -c "DROP DATABASE \"$dbname\"" ${PATHNAME}psql $PSQLOPT -d template1 -c "DROP DATABASE \"$dbname\""
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "$CMDNAME: database removal failed" echo "$CMDNAME: database removal failed"
exit 1 exit 1
......
...@@ -8,11 +8,12 @@ ...@@ -8,11 +8,12 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/droplang,v 1.5 2000/01/12 19:36:36 petere Exp $ # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/droplang,v 1.6 2000/01/19 20:08:36 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
CMDNAME=`basename $0` CMDNAME=`basename $0`
PATHNAME=`echo $0 | sed "s,$CMDNAME\$,,"`
PSQLOPT= PSQLOPT=
dbname= dbname=
...@@ -64,25 +65,19 @@ do ...@@ -64,25 +65,19 @@ do
--port=*) --port=*)
PSQLOPT="$PSQLOPT -p "`echo $1 | sed 's/^--port=//'` PSQLOPT="$PSQLOPT -p "`echo $1 | sed 's/^--port=//'`
;; ;;
--user|--username|-U) --username|-U)
PSQLOPT="$PSQLOPT -U '$2'" PSQLOPT="$PSQLOPT -U $2"
shift;; shift;;
-U*) -U*)
PSQLOPT="$PSQLOPT $1" PSQLOPT="$PSQLOPT $1"
;; ;;
--user=*)
PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--user=//'`
;;
--username=*) --username=*)
PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--username=//'` PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--username=//'`
;; ;;
--password|-W) --password|-W)
PSQLOPT="$PSQLOPT -W" PSQLOPT="$PSQLOPT -W"
;; ;;
--echo|-e) --dbname|-d)
echo=t
;;
--dbname|--database|-d)
dbname="$2" dbname="$2"
shift;; shift;;
-d*) -d*)
...@@ -91,12 +86,9 @@ do ...@@ -91,12 +86,9 @@ do
--dbname=*) --dbname=*)
dbname=`echo $1 | sed 's/^--dbname=//'` dbname=`echo $1 | sed 's/^--dbname=//'`
;; ;;
--database=*)
dbname=`echo $1 | sed 's/^--database=//'`
;;
-*) -*)
echo "$CMDNAME: unrecognized option: $1" echo "$CMDNAME: invalid option: $1"
echo "Try -? for help." echo "Try -? for help."
exit 1 exit 1
;; ;;
...@@ -113,22 +105,26 @@ done ...@@ -113,22 +105,26 @@ done
if [ "$usage" ]; then if [ "$usage" ]; then
echo "" echo "$CMDNAME removes a procedural language from a database."
echo "Usage: $CMDNAME [options] [langname [dbname]]" echo
echo "" echo "Usage:"
echo " $CMDNAME [options] [langname [dbname]]"
echo
echo "Options:"
echo " -h, --host=HOSTNAME Database server host" echo " -h, --host=HOSTNAME Database server host"
echo " -p, --port=PORT Database server port" echo " -p, --port=PORT Database server port"
echo " -U, --username=USERNAME Username to connect as" echo " -U, --username=USERNAME Username to connect as"
echo " -W, --password Prompt for password" echo " -W, --password Prompt for password"
echo " -d, --dbname=DBNAME Database to remove language from" echo " -d, --dbname=DBNAME Database to remove language from"
echo " -e, --echo Create some output about what is happening"
echo " -l, --list Show a list of currently installed languages" echo " -l, --list Show a list of currently installed languages"
echo
echo "Report bugs to <pgsql-bugs@postgresql.org>."
exit 0 exit 0
fi fi
if [ "$list" ]; then if [ "$list" ]; then
psql $PSQLOPT -d "$dbname" -c "SELECT lanname, lanpltrusted, lancompiler FROM pg_language WHERE lanispl = 't'" ${PATHNAME}psql $PSQLOPT -d "$dbname" -P 'title=Procedural languages' -c "SELECT lanname as \"Name\", lanpltrusted as \"Trusted?\", lancompiler as \"Compiler\" FROM pg_language WHERE lanispl = 't'"
exit $? exit $?
fi fi
...@@ -171,13 +167,7 @@ case "$langname" in ...@@ -171,13 +167,7 @@ case "$langname" in
esac esac
if [ "$echo" ]; then PSQL="${PATHNAME}psql -A -t -q $PSQLOPT -d $dbname -c"
PSQLOPT="$PSQLOPT -e"
else
PSQLOPT="$PSQLOPT -q"
fi
PSQL="psql -A -t $PSQLOPT -d $dbname -c"
# ---------- # ----------
...@@ -222,4 +212,5 @@ if [ $? -ne 0 ]; then ...@@ -222,4 +212,5 @@ if [ $? -ne 0 ]; then
exit 1 exit 1
fi fi
echo "Ok"
exit 0 exit 0
...@@ -8,13 +8,15 @@ ...@@ -8,13 +8,15 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropuser,v 1.5 2000/01/12 19:36:36 petere Exp $ # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropuser,v 1.6 2000/01/19 20:08:36 petere Exp $
# #
# Note - this should NOT be setuid. # Note - this should NOT be setuid.
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
CMDNAME=`basename $0` CMDNAME=`basename $0`
PATHNAME=`echo $0 | sed "s,$CMDNAME\$,,"`
PSQLOPT= PSQLOPT=
forcedel=t forcedel=t
DelUser= DelUser=
...@@ -59,15 +61,12 @@ do ...@@ -59,15 +61,12 @@ do
;; ;;
# Note: These two specify the user to connect as (like in psql), # Note: These two specify the user to connect as (like in psql),
# not the user you're dropping. # not the user you're dropping.
--user|--username|-U) --username|-U)
PSQLOPT="$PSQLOPT -U '$2'" PSQLOPT="$PSQLOPT -U $2"
shift;; shift;;
-U*) -U*)
PSQLOPT="$PSQLOPT $1" PSQLOPT="$PSQLOPT $1"
;; ;;
--user=*)
PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--user=//'`
;;
--username=*) --username=*)
PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--username=//'` PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--username=//'`
;; ;;
...@@ -85,7 +84,8 @@ do ...@@ -85,7 +84,8 @@ do
forcedel=f forcedel=f
;; ;;
-*) -*)
echo "$CMDNAME: Unrecognized option: $1. Try -? for help." echo "$CMDNAME: invalid option: $1"
echo "Try -? for help."
exit 1 exit 1
;; ;;
*) *)
...@@ -97,16 +97,21 @@ done ...@@ -97,16 +97,21 @@ done
if [ "$usage" ]; then if [ "$usage" ]; then
echo "" echo "$CMDNAME removes a PostgreSQL user."
echo "Usage: $CMDNAME [options] [username]" echo
echo "" echo "Usage:"
echo " $CMDNAME [options] [username]"
echo
echo "Options:"
echo " -h, --host=HOSTNAME Database server host" echo " -h, --host=HOSTNAME Database server host"
echo " -p, --port=PORT Database server port" echo " -p, --port=PORT Database server port"
echo " -U, --username=USERNAME Username to connect as (not the one to drop)" echo " -U, --username=USERNAME Username to connect as (not the one to drop)"
echo " -W, --password Prompt for password to connect" echo " -W, --password Prompt for password to connect"
echo " -i, --interactive Prompt before deleting anything" echo " -i, --interactive Prompt before deleting anything"
#??? echo " -e, --echo " echo " -e, --echo Show the query being sent to the backend"
echo " -q, --quiet Don't write any messages" echo " -q, --quiet Don't write any messages"
echo
echo "Report bugs to <pgsql-bugs@postgresql.org>."
exit 0 exit 0
fi fi
...@@ -120,7 +125,7 @@ fi ...@@ -120,7 +125,7 @@ fi
if [ "$forcedel" = f ]; then if [ "$forcedel" = f ]; then
echo "User \"$DelUser\" and any owned databases will be permanently deleted." echo "User \"$DelUser\" will be permanently deleted."
$ECHO_N "Are you sure? (y/n) "$ECHO_C $ECHO_N "Are you sure? (y/n) "$ECHO_C
read REPLY read REPLY
...@@ -131,7 +136,7 @@ fi ...@@ -131,7 +136,7 @@ fi
DelUser=`echo $DelUser | sed 's/\"/\\\"/g'` DelUser=`echo $DelUser | sed 's/\"/\\\"/g'`
psql $PSQLOPT -d template1 -c "DROP USER \"$DelUser\"" ${PATHNAME}psql $PSQLOPT -d template1 -c "DROP USER \"$DelUser\""
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "$CMDNAME: deletion of user \"$DelUser\" failed" echo "$CMDNAME: deletion of user \"$DelUser\" failed"
......
...@@ -11,11 +11,12 @@ ...@@ -11,11 +11,12 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/vacuumdb,v 1.8 2000/01/12 19:36:36 petere Exp $ # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/vacuumdb,v 1.9 2000/01/19 20:08:36 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
CMDNAME=`basename $0` CMDNAME=`basename $0`
PATHNAME=`echo $0 | sed "s,$CMDNAME\$,,"`
PSQLOPT= PSQLOPT=
verbose= verbose=
...@@ -23,6 +24,7 @@ analyze= ...@@ -23,6 +24,7 @@ analyze=
table= table=
dbname= dbname=
alldb= alldb=
quiet=0
while [ $# -gt 0 ] while [ $# -gt 0 ]
do do
...@@ -50,15 +52,12 @@ do ...@@ -50,15 +52,12 @@ do
--port=*) --port=*)
PSQLOPT="$PSQLOPT -p "`echo $1 | sed 's/^--port=//'` PSQLOPT="$PSQLOPT -p "`echo $1 | sed 's/^--port=//'`
;; ;;
--user|--username|-U) --username|-U)
PSQLOPT="$PSQLOPT -U '$2'" PSQLOPT="$PSQLOPT -U $2"
shift;; shift;;
-U*) -U*)
PSQLOPT="$PSQLOPT $1" PSQLOPT="$PSQLOPT $1"
;; ;;
--user=*)
PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--user=//'`
;;
--username=*) --username=*)
PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--username=//'` PSQLOPT="$PSQLOPT -U "`echo $1 | sed 's/^--username=//'`
;; ;;
...@@ -66,12 +65,13 @@ do ...@@ -66,12 +65,13 @@ do
PSQLOPT="$PSQLOPT -W" PSQLOPT="$PSQLOPT -W"
;; ;;
--echo|-e) --echo|-e)
PSQLOPT="$PSQLOPT -e" ECHOOPT="-e"
;; ;;
--quiet|-q) --quiet|-q)
PSQLOPT="$PSQLOPT -o /dev/null" ECHOOPT="$ECHOOPT -o /dev/null"
quiet=1
;; ;;
--dbname|--database|-d) --dbname|-d)
dbname="$2" dbname="$2"
shift;; shift;;
-d*) -d*)
...@@ -80,12 +80,9 @@ do ...@@ -80,12 +80,9 @@ do
--dbname=*) --dbname=*)
dbname=`echo $1 | sed 's/^--dbname=//'` dbname=`echo $1 | sed 's/^--dbname=//'`
;; ;;
--database=*)
dbname=`echo $1 | sed 's/^--database=//'`
;;
# options converted into SQL command # options converted into SQL command
--analyze|-z) --analyze|-z)
analyze="ANALYZE " analyze="ANALYZE"
;; ;;
--all|-a) --all|-a)
alldb=Y alldb=Y
...@@ -100,11 +97,11 @@ do ...@@ -100,11 +97,11 @@ do
table=`echo $1 | sed 's/^--table=//'` table=`echo $1 | sed 's/^--table=//'`
;; ;;
--verbose|-v) --verbose|-v)
verbose="VERBOSE " verbose="VERBOSE"
;; ;;
-*) -*)
echo "$CMDNAME: unrecognized option: $1" echo "$CMDNAME: invalid option: $1"
echo "Try -? for help." echo "Try -? for help."
exit 1 exit 1
;; ;;
...@@ -116,8 +113,12 @@ do ...@@ -116,8 +113,12 @@ do
done done
if [ "$usage" ]; then if [ "$usage" ]; then
echo "Usage: $CMDNAME [options] [dbname]" echo "$CMDNAME cleans and analyzes a PostgreSQL database."
echo "" echo
echo "Usage:"
echo " $CMDNAME [options] [dbname]"
echo
echo "Options:"
echo " -h, --host=HOSTNAME Database server host" echo " -h, --host=HOSTNAME Database server host"
echo " -p, --port=PORT Database server port" echo " -p, --port=PORT Database server port"
echo " -U, --username=USERNAME Username to connect as" echo " -U, --username=USERNAME Username to connect as"
...@@ -127,8 +128,10 @@ if [ "$usage" ]; then ...@@ -127,8 +128,10 @@ if [ "$usage" ]; then
echo " -z, --analyze Update optimizer hints" echo " -z, --analyze Update optimizer hints"
echo " -t, --table='TABLE[(columns)]' Vacuum specific table only" echo " -t, --table='TABLE[(columns)]' Vacuum specific table only"
echo " -v, --verbose Write a lot of output" echo " -v, --verbose Write a lot of output"
#??? echo " -e, --echo " echo " -e, --echo Show the command being sent to the backend"
echo " -q, --quiet Don't write any output" echo " -q, --quiet Don't write any output"
echo
echo "Report bugs to <pgsql-bugs@postgresql.org>."
exit 0 exit 0
fi fi
...@@ -137,10 +140,9 @@ if [ "$alldb" ]; then ...@@ -137,10 +140,9 @@ if [ "$alldb" ]; then
echo "$CMDNAME: cannot vacuum all databases and a specific one at the same time" echo "$CMDNAME: cannot vacuum all databases and a specific one at the same time"
exit 1 exit 1
fi fi
dbname="`psql $PSQLOPT -q -t -A -d template1 -c 'SELECT datname FROM pg_database'`" dbname=`${PATHNAME}psql $PSQLOPT -q -t -A -d template1 -c 'SELECT datname FROM pg_database'`
fi
if [ -z "$dbname" ]; then elif [ -z "$dbname" ]; then
echo "$CMDNAME: missing required argument database name" echo "$CMDNAME: missing required argument database name"
echo "Try -? for help." echo "Try -? for help."
exit 1 exit 1
...@@ -148,7 +150,8 @@ fi ...@@ -148,7 +150,8 @@ fi
for db in $dbname for db in $dbname
do do
psql $PSQLOPT -c "vacuum $verbose $analyze $table" -d $dbname [ "$alldb" -a "$quiet" -ne 1 ] && echo "Vacuuming $db"
${PATHNAME}psql $PSQLOPT $ECHOOPT -c "VACUUM $verbose $analyze $table" -d $db
done done
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
......
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