diff options
Diffstat (limited to 'src/backend/commands/dbcommands.c')
-rw-r--r-- | src/backend/commands/dbcommands.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c index f7f765d9d7a..88b01fd91e9 100644 --- a/src/backend/commands/dbcommands.c +++ b/src/backend/commands/dbcommands.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.79 2001/08/26 16:55:59 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.80 2001/09/06 04:57:28 ishii Exp $ * *------------------------------------------------------------------------- */ @@ -36,6 +36,10 @@ #include "utils/fmgroids.h" #include "utils/syscache.h" +#ifdef MULTIBYTE +#include "mb/pg_wchar.h" /* encoding check */ +#endif + /* non-export function prototypes */ static bool get_db_info(const char *name, Oid *dbIdP, int4 *ownerIdP, @@ -142,6 +146,13 @@ createdb(const char *dbname, const char *dbpath, if (encoding < 0) encoding = src_encoding; +#ifdef MULTIBYTE + /* Some encodings are client only */ + if (!PG_VALID_BE_ENCODING( encoding )) + elog(ERROR, "CREATE DATABASE: invalid backend encoding"); +#else + Assert(encoding == 0); /* zero is PG_SQL_ASCII */ +#endif /* * Preassign OID for pg_database tuple, so that we can compute db * path. |