preventing encoding conversion while starting up

Поиск
Список
Период
Сортировка
От Tatsuo Ishii
Тема preventing encoding conversion while starting up
Дата
Msg-id 20020718.135554.116350785.t-ishii@sra.co.jp
обсуждение исходный текст
Ответы Re: preventing encoding conversion while starting up  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: preventing encoding conversion while starting up  (Hannu Krosing <hannu@tm.ee>)
Список pgsql-hackers
I have faced a problem with encoding conversion while the database is
starting up. If postmaster accepts a connection request while in the
state, it issues a fatal message "The database system is starting
up". Then the encoding conversion system tries to convert the message
to client encoding if neccessary (e.g. PGCLIENTENCODING is set for
postmaster process). Then it calles recomputeNamespacePath() which
calls GetUserId(), it ends up with an assersion error (see below).

To prevent this, I would like to add a public function to postmaster.c
to know we are in the database starting up phase:

CAC_state BackendState()

Comments?
--
Tatsuo Ishii

#0  0x40103841 in __kill () from /lib/libc.so.6
#1  0x40103594 in raise (sig=6) at ../sysdeps/posix/raise.c:27
#2  0x40104c81 in abort () at ../sysdeps/generic/abort.c:88
#3  0x0817932b in Letext () at excabort.c:27
#4  0x08179292 in ExcUnCaught (excP=0x821813c, detail=0, data=0x0,    message=0x820dd40 "!(((bool) ((CurrentUserId) !=
((Oid)0))))")   at exc.c:168
 
#5  0x081792d9 in ExcRaise (excP=0x821813c, detail=0, data=0x0,    message=0x820dd40 "!(((bool) ((CurrentUserId) !=
((Oid)0))))")   at exc.c:185
 
#6  0x08177fa2 in ExceptionalCondition (   conditionName=0x820dd40 "!(((bool) ((CurrentUserId) != ((Oid) 0))))",
exceptionP=0x821813c,detail=0x0, fileName=0x820dcc0 "miscinit.c",    lineNumber=502) at assert.c:70
 
#7  0x0817c8b2 in GetUserId () at miscinit.c:502
#8  0x080a2726 in recomputeNamespacePath () at namespace.c:1301
#9  0x080a26e8 in FindDefaultConversionProc (for_encoding=0, to_encoding=4)   at namespace.c:1280
#10 0x0818930e in pg_do_encoding_conversion (   src=0xbfffe510 "FATAL:  The database system is starting up\n", len=43,
 src_encoding=0, dest_encoding=4) at mbutils.c:108
 
#11 0x081896a3 in pg_server_to_client (   s=0xbfffe510 "FATAL:  The database system is starting up\n", len=43)   at
mbutils.c:243
#12 0x080f2d76 in pq_sendstring (buf=0xbfffe474,    str=0xbfffe510 "FATAL:  The database system is starting up\n")   at
pqformat.c:162
#13 0x08178c16 in send_message_to_frontend (type=20,    msg=0xbfffe510 "FATAL:  The database system is starting up\n")
at elog.c:750
 
#14 0x08178562 in elog (lev=21,    fmt=0x81ecc60 "The database system is starting up") at elog.c:427
#15 0x0811755f in ProcessStartupPacket (port=0x826f4e0, SSLdone=0)   at postmaster.c:1176
#16 0x0811838a in DoBackend (port=0x826f4e0) at postmaster.c:2115
#17 0x08117f6f in BackendStartup (port=0x826f4e0) at postmaster.c:1863
#18 0x081171dc in ServerLoop () at postmaster.c:972
#19 0x08116d46 in PostmasterMain (argc=4, argv=0x8254bf0) at postmaster.c:754
#20 0x080f33ff in main (argc=4, argv=0xbffff1a4) at main.c:204
#21 0x400f1fff in __libc_start_main (main=0x80f3230 <main>, argc=4,    ubp_av=0xbffff1a4, init=0x8069b30 <_init>,
fini=0x818a4e0<_fini>,    rtld_fini=0x4000c420 <_dl_fini>, stack_end=0xbffff19c)   at
../sysdeps/generic/libc-start.c:129



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: Re: DROP COLUMN
Следующее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: Bright ideas required for drop column...