Thread: Re: Patch for pl/tcl Tcl_ExternalToUtf and Tcl_UtfToExternal

Re: Patch for pl/tcl Tcl_ExternalToUtf and Tcl_UtfToExternal

From
Reinhard Max
Date:
On Thu, 6 Sep 2001, Tom Lane wrote:

> Vsevolod Lobko <seva@sevasoft.kiev.ua> writes:
> > Can somebody add tcl version checking to configure.in so we can do
> > that all on configure stage?
>
> > ok, for now I do it at compile time, based on TCL_MAJOR_VERSION &
> > TCL_MINOR_VERSION
>
> I think a compile-time #if on TCL_MAJOR_VERSION is the right thing to
> do.  configure couldn't do any more than that for you, anyway.

TCL_MAJOR_VERSION is not enough, because the UTF internal
representation was introduced between 8.0 and 8.1.

A compile-time #if is OK for PL/Tcl, as it get's linked against a
specific version of libtcl anyway. But for PgTcl it needs to be
detected at runtime, because you don't know what version of Tcl in
gets pulled into.

> Also, a runtime test will not work since if you are on an older
> version, the calls to the UTF routines will fail to link.

The current proposal is to use PostgreSQL's UTF conversion routines
for PL/Tcl and UNICODE as client encoding for PgTcl so Tcl's UTF
routines will not be needed. See the previous mails from me and
Vsevolod for details.

cu
    Rinhard




Re: Patch for pl/tcl Tcl_ExternalToUtf and Tcl_UtfToExternal

From
Bruce Momjian
Date:
FYI, I can easily back out the recently applied UTF patch.  Just let me
know.


> On Thu, 6 Sep 2001, Tom Lane wrote:
>
> > Vsevolod Lobko <seva@sevasoft.kiev.ua> writes:
> > > Can somebody add tcl version checking to configure.in so we can do
> > > that all on configure stage?
> >
> > > ok, for now I do it at compile time, based on TCL_MAJOR_VERSION &
> > > TCL_MINOR_VERSION
> >
> > I think a compile-time #if on TCL_MAJOR_VERSION is the right thing to
> > do.  configure couldn't do any more than that for you, anyway.
>
> TCL_MAJOR_VERSION is not enough, because the UTF internal
> representation was introduced between 8.0 and 8.1.
>
> A compile-time #if is OK for PL/Tcl, as it get's linked against a
> specific version of libtcl anyway. But for PgTcl it needs to be
> detected at runtime, because you don't know what version of Tcl in
> gets pulled into.
>
> > Also, a runtime test will not work since if you are on an older
> > version, the calls to the UTF routines will fail to link.
>
> The current proposal is to use PostgreSQL's UTF conversion routines
> for PL/Tcl and UNICODE as client encoding for PgTcl so Tcl's UTF
> routines will not be needed. See the previous mails from me and
> Vsevolod for details.
>
> cu
>     Rinhard
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>

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

UTF-8 patch for PgTcl (was: Patch for pl/tcl ...)

From
Reinhard Max
Date:
Hi,

On Thu, 6 Sep 2001, Bruce Momjian wrote:

> FYI, I can easily back out the recently applied UTF patch.
> Just let me know.

I think Vsevolod is working on a new patch pl/tcl.

The attached patch should be sufficient to fix libpgtcl. It requires
PostgreSQL to support unicode-conversion, but retains binary
compatibility among Tcl versions.

However, it neither checks at compile time not at runtime, if support
for unicode-conversion does really exist and it doesn't prevent the
user from changing the client encoding after initialization. I think
there should be warnings about this somewhere in the documentation.

cu
    Reinhard

Attachment

Re: UTF-8 patch for PgTcl (was: Patch for pl/tcl ...)

From
Bruce Momjian
Date:
Your patch has been added to the PostgreSQL unapplied patches list at:

    http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

> Hi,
>
> On Thu, 6 Sep 2001, Bruce Momjian wrote:
>
> > FYI, I can easily back out the recently applied UTF patch.
> > Just let me know.
>
> I think Vsevolod is working on a new patch pl/tcl.
>
> The attached patch should be sufficient to fix libpgtcl. It requires
> PostgreSQL to support unicode-conversion, but retains binary
> compatibility among Tcl versions.
>
> However, it neither checks at compile time not at runtime, if support
> for unicode-conversion does really exist and it doesn't prevent the
> user from changing the client encoding after initialization. I think
> there should be warnings about this somewhere in the documentation.
>
> cu
>     Reinhard

Content-Description: pgtcl-utf8.patch

[ Attachment, skipping... ]

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

Re: UTF-8 patch for PgTcl (was: Patch for pl/tcl ...)

From
Bruce Momjian
Date:
Patch applied.  Thanks.

> Hi,
>
> On Thu, 6 Sep 2001, Bruce Momjian wrote:
>
> > FYI, I can easily back out the recently applied UTF patch.
> > Just let me know.
>
> I think Vsevolod is working on a new patch pl/tcl.
>
> The attached patch should be sufficient to fix libpgtcl. It requires
> PostgreSQL to support unicode-conversion, but retains binary
> compatibility among Tcl versions.
>
> However, it neither checks at compile time not at runtime, if support
> for unicode-conversion does really exist and it doesn't prevent the
> user from changing the client encoding after initialization. I think
> there should be warnings about this somewhere in the documentation.
>
> cu
>     Reinhard

Content-Description: pgtcl-utf8.patch

[ Attachment, skipping... ]

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