Re: (repost) pgtcl: restore 8.0 compatibility for large obj fix

From: ljb <ljb220(at)mindspring(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: Re: (repost) pgtcl: restore 8.0 compatibility for large obj fix
Date: 2003-11-07 00:57:39
Message-ID: boeqm2$2l10$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

tgl(at)sss(dot)pgh(dot)pa(dot)us wrote:
> ljb <ljb220(at)mindspring(dot)com> writes:
>> +#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 1 || TCL_MAJOR_VERSION > 8
>> + bufObj = Tcl_NewByteArrayObj(buf, nbytes);
>> +#else
>> bufObj = Tcl_NewStringObj(buf, nbytes);
>> +#endif
>
> Hmm. We could certainly do it like that, but does this actually fix the
> problem for Tcl 8.0.*? Or will the unwanted character set translation
> happen anyway in that version? I don't see any value in letting the
> code compile against 8.0.* if the behavior will be wrong ...

What I wrote was:

>> I don't think Tcl 8.0.x will have the problem with binary data, as the
>> trouble started with internationalization at 8.1.

Meaning: Tcl 8.0 added "binary strings", and handled binary data in String
objects. Tcl 8.1 internationalized those strings to make them store UTF-8,
and introduced ByteArray objects to hold binary data. So the original code
should work fine in Tcl 8.0, and the changes are only needed at 8.1 and up.
I'm guessing, though, so I'll go dust off a copy of Tcl 8.0.x and try it.

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2003-11-07 01:56:26 Re: (repost) pgtcl: restore 8.0 compatibility for large obj fix
Previous Message Gaetano Mendola 2003-11-06 10:49:36 Re: equal() perf tweak