diff options
author | Marc G. Fournier <scrappy@hub.org> | 1998-07-26 04:31:41 +0000 |
---|---|---|
committer | Marc G. Fournier <scrappy@hub.org> | 1998-07-26 04:31:41 +0000 |
commit | 5979d7384179a41390c1ed122c6cc60d30287e2a (patch) | |
tree | 5c45522ec5301eefd17f5439c216f9e628b60d3f /src/backend/utils/misc/database.c | |
parent | 74b30a3a1f96eb58e7cca0a92fb00bce7e825fbe (diff) | |
download | postgresql-5979d7384179a41390c1ed122c6cc60d30287e2a.tar.gz postgresql-5979d7384179a41390c1ed122c6cc60d30287e2a.zip |
From: t-ishii@sra.co.jp
As Bruce mentioned, this is due to the conflict among changes we made.
Included patches should fix the problem(I changed all MB to
MULTIBYTE). Please let me know if you have further problem.
P.S. I did not include pathces to configure and gram.c to save the
file size(configure.in and gram.y modified).
Diffstat (limited to 'src/backend/utils/misc/database.c')
-rw-r--r-- | src/backend/utils/misc/database.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/backend/utils/misc/database.c b/src/backend/utils/misc/database.c index 6a106b9ad12..69d67e5e1a4 100644 --- a/src/backend/utils/misc/database.c +++ b/src/backend/utils/misc/database.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.12 1998/07/24 03:31:59 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.13 1998/07/26 04:31:07 scrappy Exp $ * *------------------------------------------------------------------------- */ @@ -22,7 +22,7 @@ #include "access/heapam.h" #include "access/xact.h" #include "catalog/catname.h" -#ifdef MB +#ifdef MULTIBYTE #include "catalog/pg_database_mb.h" #include "mb/pg_wchar.h" #else @@ -184,7 +184,7 @@ ExpandDatabasePath(char *dbpath) * -------------------------------- */ void -#ifdef MB +#ifdef MULTIBYTE GetRawDatabaseInfo(char *name, Oid *owner, Oid *db_id, char *path, int *encoding) #else GetRawDatabaseInfo(char *name, Oid *owner, Oid *db_id, char *path) @@ -275,14 +275,23 @@ GetRawDatabaseInfo(char *name, Oid *owner, Oid *db_id, char *path) * means of getting at sys cat attrs. */ tup_db = (Form_pg_database) GETSTRUCT(tup); - +#ifdef MULTIBYTE + /* get encoding from template database. + This is the "default for default" for + create database command. + */ + if (strcmp("template1",tup_db->datname.data) == 0) + { + SetTemplateEncoding(tup_db->encoding); + } +#endif if (strcmp(name, tup_db->datname.data) == 0) { *db_id = tup->t_oid; strncpy(path, VARDATA(&(tup_db->datpath)), (VARSIZE(&(tup_db->datpath)) - VARHDRSZ)); *(path + VARSIZE(&(tup_db->datpath)) - VARHDRSZ) = '\0'; -#ifdef MB +#ifdef MULTIBYTE *encoding = tup_db->encoding; #endif goto done; |