summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1998-08-24 01:14:24 +0000
committerBruce Momjian <bruce@momjian.us>1998-08-24 01:14:24 +0000
commitc0b01461db59a472f5817a8c6e99091b8a48ffc5 (patch)
tree8ea77fde00c4a8da22920d9d0aa7f8b8a77e67e0 /src/bin
parent9438fe5d091162136e96991da391a559e078aa23 (diff)
downloadpostgresql-c0b01461db59a472f5817a8c6e99091b8a48ffc5.tar.gz
o note that now pg_database has a new attribuite "encoding" even
if MULTIBYTE is not enabled. So be sure to run initdb. o these patches are made against the latest source tree (after Bruce's massive patch, I think) BTW, I noticed that after running regression, the oid field of pg_type seems disappeared. regression=> select oid from pg_type; ERROR: attribute 'oid' not found this happens after the constraints test. This occures with/without my patches. strange... o pg_database_mb.h, pg_class_mb.h, pg_attribute_mb.h are no longer used, and shoud be removed. o GetDatabaseInfo() in utils/misc/database.c removed (actually in #ifdef 0). seems nobody uses. t-ishii@sra.co.jp
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/initdb/initdb.sh9
-rw-r--r--src/bin/pg_dump/pg_dumpall11
2 files changed, 12 insertions, 8 deletions
diff --git a/src/bin/initdb/initdb.sh b/src/bin/initdb/initdb.sh
index 96b83a713d..df645dcf17 100644
--- a/src/bin/initdb/initdb.sh
+++ b/src/bin/initdb/initdb.sh
@@ -26,7 +26,7 @@
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.52 1998/08/22 05:19:23 momjian Exp $
+# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.53 1998/08/24 01:14:04 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -37,6 +37,7 @@
# ----------------
CMDNAME=`basename $0`
+MULTIBYTEID=0
MULTIBYTE=__MULTIBYTE__
if [ -n "$MULTIBYTE" ];then
@@ -374,11 +375,7 @@ if [ $template_only -eq 0 ]; then
echo "Adding template1 database to pg_database..."
echo "open pg_database" > /tmp/create.$$
- if [ -z "$MULTIBYTE" ];then
- echo "insert (template1 $POSTGRES_SUPERUID template1)" >> /tmp/create.$$
- else
- echo "insert (template1 $POSTGRES_SUPERUID $MULTIBYTEID template1)" >> /tmp/create.$$
- fi
+ echo "insert (template1 $POSTGRES_SUPERUID $MULTIBYTEID template1)" >> /tmp/create.$$
#echo "show" >> /tmp/create.$$
echo "close pg_database" >> /tmp/create.$$
diff --git a/src/bin/pg_dump/pg_dumpall b/src/bin/pg_dump/pg_dumpall
index 48e313afec..78344324cf 100644
--- a/src/bin/pg_dump/pg_dumpall
+++ b/src/bin/pg_dump/pg_dumpall
@@ -48,7 +48,7 @@ drop table tmp_pg_shadow;
END
echo "${BS}."
psql -l -A -q -t| tr '|' ' ' | grep -v '^template1 ' | \
-while read DATABASE DBUSERID DATAPATH
+while read DATABASE DBUSERID ENCODING DATAPATH
do
POSTGRES_USER="`echo \" \
select usename \
@@ -56,7 +56,14 @@ do
where usesysid = $DBUSERID; \" | \
psql -A -q -t template1`"
echo "${BS}connect template1 $POSTGRES_USER"
- echo "create database $DATABASE;"
+
+ if createdb -help|grep encoding >/dev/null
+ then
+ echo "create database with encoding='`pg_encoding $ENCODING`' $DATABASE;"
+ else
+ echo "create database $DATABASE;"
+ fi
+
echo "${BS}connect $DATABASE $POSTGRES_USER"
pg_dump ${1+"$@"} $DATABASE
if [ "$?" -ne 0 ]