Re: Shouldn't non-MULTIBYTE backend refuse to start in MB database?
От | Tatsuo Ishii |
---|---|
Тема | Re: Shouldn't non-MULTIBYTE backend refuse to start in MB database? |
Дата | |
Msg-id | 20010215104244G.t-ishii@sra.co.jp обсуждение исходный текст |
Ответ на | Shouldn't non-MULTIBYTE backend refuse to start in MB database? (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-hackers |
> We now have defenses against running a non-LOCALE-enabled backend in a > database that was created in non-C locale. Shouldn't we likewise > prevent a non-MULTIBYTE-enabled backend from running in a database with > a multibyte encoding that's not SQL_ASCII? Or am I missing a reason why > that is safe? > > I propose the following addition to ReverifyMyDatabase in postinit.c: > > #ifdef MULTIBYTE > SetDatabaseEncoding(dbform->encoding); > + #else > + if (dbform->encoding != SQL_ASCII) > + elog(FATAL, "some suitable error message"); > #endif > > Comments? Running a non-MULTIBYTE-enabled backend on a database with a multibyte encoding other than SQL_ASCII should be safe as long as: 1) read only access 2) the encodings are actually single byte encodings If mutibyte encoding database is updated by a non-MULTIBYTE-enabled backend, there might be a chance that data could corrupted since the backend does not handle mutibyte strings correctly. So I think you suggestion is a improvement. -- Tatsuo Ishii
В списке pgsql-hackers по дате отправления: