Re: [PATCHES] CURRENT CVS: MULTIBYTE: CANT CONNECT....

From: Larry Rosenman <ler(at)lerctr(dot)org>
To: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
Cc: zakkr(at)zf(dot)jcu(dot)cz, pgman(at)candle(dot)pha(dot)pa(dot)us, pgsql-hackers(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: [PATCHES] CURRENT CVS: MULTIBYTE: CANT CONNECT....
Date: 2001-09-08 15:13:49
Message-ID: 20010908101349.A25157@lerami.lerctr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers pgsql-patches

* Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp> [010908 10:02]:
> > > > > CC=cc CXX=CC ./configure --prefix=/usr/local/pgsql --enable-syslog \
> > > > > --with-CXX --with-perl --enable-multibyte --enable-cassert \
> > > > > --with-includes=/usr/local/include --with-libs=/usr/local/lib \
> > > > > --enable-debug \
> > > > > --with-tcl --with-tclconfig=/usr/local/lib \
> > > > > --with-tkconfig=/usr/local/lib --enable-locale
> > > > > and when I try to connect to an existing DB, loaded from a pg_dump
> > > > > from the previous 7.2devel sources, I get:
> > > > > TRAP: Failed Assertion("!(ClientEncoding):", File: "mbutils.c", Line:
> > > > > 314)
> > > > > !(ClientEncoding) (0) [No such file or directory]
> > > >
> > > > Interesting. I don't know why, but someting don't call
> > > > pg_set_client_encoding() before usage encoding routines (maybe
> > > > libpq don't set client encoding if it's default SQL_ASCII, but
> > > > I'm almost sure that I check this case).
> > > >
> > > > A simple and robus solution is in the begin of mbutils.c set default
> > > > ClientEncoding to SQL_ASCII (like default DatabaseEncoding). Bruce, can
> > > > you change it? It's one line change. Again thanks.
>
> Karel,
>
> The bug Larry reported seems for such a case of connecting non
> existent database. The backend tries to send the error message to the
> frontend using pg_server_to_client WITHOUT getting an encoding info
> from the database. To fix this Larry's patch or you stat in the
> previous mail are sufficient. I will commit the fix.
I use password authentication, and that seems to be what tripped it.

The applied patch works for me.

Thanks, Gentlemen.

LER

>
> > Forget it! A default client encoding must be set by actual database encoding...
>
> Why? set_default_client_encoding does the job anyway.
> --
> Tatsuo Ishii
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler(at)lerctr(dot)org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tatsuo Ishii 2001-09-08 23:25:49 Re: [PATCHES] CURRENT CVS: MULTIBYTE: CANT CONNECT....
Previous Message Bruce Momjian 2001-09-08 15:07:21 Re: [PATCHES] CURRENT CVS: MULTIBYTE: CANT CONNECT....

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthew T. O'Connor 2001-09-08 16:21:58 Re: Abort state on duplicated PKey in transactions
Previous Message Bruce Momjian 2001-09-08 15:07:21 Re: [PATCHES] CURRENT CVS: MULTIBYTE: CANT CONNECT....

Browse pgsql-patches by date

  From Date Subject
Next Message Marc Balmer 2001-09-08 16:29:49 Am I subscribed?
Previous Message Bruce Momjian 2001-09-08 15:07:21 Re: [PATCHES] CURRENT CVS: MULTIBYTE: CANT CONNECT....