Re: CURRENT CVS: MULTIBYTE: CANT CONNECT....

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
Cc: pgsql-hackers <pgsql-hackers(at)postgreSQL(dot)org>, pgsql-patches <pgsql-patches(at)postgreSQL(dot)org>
Subject: Re: CURRENT CVS: MULTIBYTE: CANT CONNECT....
Date: 2001-09-08 14:30:23
Message-ID: 200109081430.f88EUNt29228@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers pgsql-patches


Patch applied. Thanks.

> > On Sat, Sep 08, 2001 at 10:29:38AM +0200, Karel Zak wrote:
> > > On Fri, Sep 07, 2001 at 09:06:18PM -0500, Larry Rosenman wrote:
> > > > I finally got all the way through a compile set:
> > > >
> > > > 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.
>
> Forget it! A default client encoding must be set by actual database encoding...
> Please apply the small attached patch that solve it better.
>
> I check and test it with attached patch and it works correct:
>
> test=# SHOW CLIENT_ENCODING;
> NOTICE: Current client encoding is SQL_ASCII
> SHOW VARIABLE
> test=# SHOW SERVER_ENCODING;
> NOTICE: Current server encoding is SQL_ASCII
> SHOW VARIABLE
> test=# CREATE DATABASE l2 WITH ENCODING='ISO-8859-2';
> CREATE DATABASE
> test=# \c l2
> You are now connected to database l2.
> l2=# \l
> List of databases
> Name | Owner | Encoding
> -----------+----------+-----------
> l2 | zakkr | LATIN2
> template0 | postgres | SQL_ASCII
> template1 | postgres | SQL_ASCII
> test | postgres | SQL_ASCII
> (4 rows)
>
> l2=# SHOW SERVER_ENCODING;
> NOTICE: Current server encoding is LATIN2
> SHOW VARIABLE
> l2=# SHOW CLIENT_ENCODING;
> NOTICE: Current client encoding is LATIN2
> SHOW VARIABLE
> l2=#
>
> Larry, wait when Bruce apply this small change and try previous
> examples.
>
> Karel
>
> --
> Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
> http://home.zf.jcu.cz/~zakkr/
>
> C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz

[ Attachment, skipping... ]

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tatsuo Ishii 2001-09-08 14:51:24 Re: [PATCHES] CURRENT CVS: MULTIBYTE: CANT CONNECT....
Previous Message Karel Zak 2001-09-08 10:50:47 Re: CURRENT CVS: MULTIBYTE: CANT CONNECT....

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2001-09-08 14:51:24 Re: [PATCHES] CURRENT CVS: MULTIBYTE: CANT CONNECT....
Previous Message Karel Zak 2001-09-08 10:50:47 Re: CURRENT CVS: MULTIBYTE: CANT CONNECT....

Browse pgsql-patches by date

  From Date Subject
Next Message Tatsuo Ishii 2001-09-08 14:51:24 Re: [PATCHES] CURRENT CVS: MULTIBYTE: CANT CONNECT....
Previous Message Bruce Momjian 2001-09-08 14:28:47 Re: NLS for psql (Russian), continuation...