diff options
author | Tatsuo Ishii | 2001-03-27 05:47:13 +0000 |
---|---|---|
committer | Tatsuo Ishii | 2001-03-27 05:47:13 +0000 |
commit | c252c972f6bdfa342552e146413cb26ec589af8f (patch) | |
tree | 472424059bf9eab90007fb189954a36852a255af | |
parent | 12ceb111822f0cf393a359c2aa6f38c15d7e2961 (diff) |
Add checking for valid database encoding.
-rw-r--r-- | src/bin/initdb/initdb.sh | 6 | ||||
-rw-r--r-- | src/bin/scripts/createdb | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/bin/initdb/initdb.sh b/src/bin/initdb/initdb.sh index 1653987f739..68bde7c523f 100644 --- a/src/bin/initdb/initdb.sh +++ b/src/bin/initdb/initdb.sh @@ -23,7 +23,7 @@ # Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group # Portions Copyright (c) 1994, Regents of the University of California # -# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.122 2001/03/13 21:37:15 petere Exp $ +# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.123 2001/03/27 05:45:50 ishii Exp $ # #------------------------------------------------------------------------- @@ -311,6 +311,10 @@ then then echo "$CMDNAME: $MULTIBYTE is not a valid encoding name" 1>&2 exit 1 + elif [ $MULTIBYTEID -gt 31 ] + then + echo "$CMDNAME: $MULTIBYTE cannot be used as a database encoding" 1>&2 + exit 1 fi fi diff --git a/src/bin/scripts/createdb b/src/bin/scripts/createdb index 4a695a1590f..fbb39e00666 100644 --- a/src/bin/scripts/createdb +++ b/src/bin/scripts/createdb @@ -12,7 +12,7 @@ # # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.14 2001/02/18 17:53:54 tgl Exp $ +# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.15 2001/03/27 05:47:13 ishii Exp $ # #------------------------------------------------------------------------- @@ -145,6 +145,10 @@ then then echo "$CMDNAME: \"$MB\" is not a valid encoding name" 1>&2 exit 1 + elif [ $mbcode -gt 31 ] + then + echo "$CMDNAME: $MB cannot be used as a database encoding" 1>&2 + exit 1 fi fi |