Обсуждение: libpgtcl and encoding

Поиск
Список
Период
Сортировка

libpgtcl and encoding

От
Sandro Dentella
Дата:
While trying to connect to a db w/ SQL_ASCII encoding, from tcl I get:  "ERROR:  Conversion between UNICODE and
SQL_ASCIIis not supported"
 
this happens after an upgrade from 7.1 to 7.2 on a debian woody, connecting  to a database on a RedHat 7.1 w/
postgreSQL7.1.
 

What I cannot understand is that while 

1. trying to connect to other db (SQL_ASCII encoding) on my box (debian)  everithing works (so I would think "my
libpgtcl*can* connect to  SQL_ASCII db),
 

2. if I dump the db and reload it w/ UNICODE encoding I can connect to it

3. from psql I can connect to RedHat SQL_ASCII db from debian woody and SHOW  CLIENT_ENCODING shows it is SQL_ASCII

How can I force libpgtcl to get SQL_ASCII encoding or be sensitive to
PGCLIENTENCODING environment variable? or how else should I solve the
problem?



Thanks in advance
sandro
*:-)


[ I don't know how to get compile option, I couldn't find an option to look
for] 




-- 
Sandro Dentella  *:-)
e-mail: sandro.dentella@tin.it 
http://www.tksql.org                    TkSQL Home page - My GPL work


Re: libpgtcl and encoding

От
Tom Lane
Дата:
Sandro Dentella <sandro.dentella@tin.it> writes:
> While trying to connect to a db w/ SQL_ASCII encoding, from tcl I get:
>    "ERROR:  Conversion between UNICODE and SQL_ASCII is not supported"
> this happens after an upgrade from 7.1 to 7.2 on a debian woody, connecting
>    to a database on a RedHat 7.1 w/ postgreSQL 7.1.

Was the 7.1 installation built with --enable-unicode-conversion ?
        regards, tom lane


Re: libpgtcl and encoding

От
Sandro Dentella
Дата:
On Tue, Jun 11, 2002 at 12:48:08PM -0400, Tom Lane wrote:
> Sandro Dentella <sandro.dentella@tin.it> writes:
> > On Sun, Jun 09, 2002 at 11:43:22AM -0400, Tom Lane wrote:
> >> Was the 7.1 installation built with --enable-unicode-conversion ?
> 
> > I francly don't remember. Is there a way to understand it from the binaries?
> 
> pg_config --configure

This is the output on the machine where tha database that I *cannot* connect
to (if the encoding is SQL_ASCII, no problem if UNICODE)
--with-tcl --bindir /usr/bin/ --with-tclconfig=/opt/tcltk/lib --without-tk


This is the output on the machine (debian woody) where libpgtcl is:

--with-template=linux --prefix=/usr/lib/postgresql  --enable-unicode-conversion  --with-includes=/usr/include/tcl8.3
--includedir=/usr/include/postgresql --with-python --with-openssl --with-gnu-ld --disable-rpath --enable-odbc
--with-unixodbc--with-CXX --enable-recode --with-tcl --with-perl  --with-pam --enable-multibyte --enable-debug
--enable-syslog --enable-locale --with-tclconfig=/usr/lib/tcl8.3  --with-tkconfig=/usr/lib/tk8.3 --with-maxbackends=64
--with-pgport=5432

> > and again: is there a way to start a connection w/ libpgtcl forcing a
> > particular encoding like wuold be w/ PGCLIENTENCODING environment variable?
> 
> libpgtcl uses libpq, so it should respond to PGCLIENTENCODING.

Should...  here is what happens:

[sandro@bluff] sandro $ export PGCLIENTENCODING=SQL_ASCII
[sandro@bluff] sandro $ tclsh
% load libpgtcl.so
% set p [pg_connect -conninfo "host=my_host dbname=danze \ user=sandro password=xxx"]

Connection to database failed
ERROR:  Conversion between UNICODE and SQL_ASCII is not supported



regards

sandro
*:-)

-- 
Sandro Dentella  *:-)
e-mail: sandro.dentella@tin.it 
http://www.tksql.org                    TkSQL Home page - My GPL work


Re: libpgtcl and encoding

От
Tom Lane
Дата:
Sandro Dentella <sandro.dentella@tin.it> writes:
> This is the output on the machine where tha database that I *cannot* connect
> to (if the encoding is SQL_ASCII, no problem if UNICODE)
> --with-tcl --bindir /usr/bin/ --with-tclconfig=/opt/tcltk/lib --without-tk

Well, there's your problem: no multibyte support at all on the server.
Recent releases of libpgtcl can only talk to multibyte-enabled servers
because of Tcl's decision to be internally Unicode-only.  You'll need
both --enable-multibyte and --enable-unicode-conversion at the server.
        regards, tom lane