Lists: | pgsql-bugs |
---|
From: | Mahlon Stacy <mcs(at)mayo(dot)edu> |
---|---|
To: | "'pgsql-bugs(at)postgresql(dot)org'" <pgsql-bugs(at)postgresql(dot)org> |
Subject: | pgtcl large object fix |
Date: | 2003-08-06 18:31:15 |
Message-ID: | 4B08D99CFA03D04EAF34E1A28C4D159C2E96AF@pocono.mayo.edu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-bugs |
Newer versions of TCL implement ByteArray objects which are
the best fit for Postgresql Large Object functions. The change
is simple. Here's a diff on the 7.4 source file and a fixed version:
diff pgtclCmds.c pgtclCmds.c.fixed
1218c1218
< bufObj = Tcl_NewStringObj(buf, nbytes);
---
> bufObj = Tcl_NewByteArrayObj(buf, nbytes);
1310c1310
< buf = Tcl_GetStringFromObj(objv[3], &nbytes);
---
> buf = Tcl_GetByteArrayFromObj(objv[3], &nbytes);
By making this change, TCL users (like me) can store and retrieve
binary objects in the database, like images. And, strings will
still work fine, too.
-Mahlon Stacy
-------------------------------------------------------------
Mahlon Stacy Internet: mcs(at)mayo(dot)edu
Mayo Foundation (507) 284-4558
Medical Science Bldg 1-43 FAX (507) 284-1632
Rochester, MN 55905
-------------------------------------------------------------
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Mahlon Stacy <mcs(at)mayo(dot)edu> |
Cc: | "'pgsql-bugs(at)postgresql(dot)org'" <pgsql-bugs(at)postgresql(dot)org> |
Subject: | Re: pgtcl large object fix |
Date: | 2003-08-06 22:02:52 |
Message-ID: | 9293.1060207372@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-bugs |
Mahlon Stacy <mcs(at)mayo(dot)edu> writes:
> Newer versions of TCL implement ByteArray objects which are
> the best fit for Postgresql Large Object functions.
How newer is "newer"? That is, what compatibility problems might we
create if we make this change?
regards, tom lane
From: | Reinhard Max <max(at)suse(dot)de> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Mahlon Stacy <mcs(at)mayo(dot)edu>, "'pgsql-bugs(at)postgresql(dot)org'" <pgsql-bugs(at)postgresql(dot)org> |
Subject: | Re: pgtcl large object fix |
Date: | 2003-08-07 10:10:44 |
Message-ID: | Pine.LNX.4.44.0308071203480.31993-100000@wotan.suse.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-bugs |
On Wed, 6 Aug 2003 at 18:02, Tom Lane wrote:
> Mahlon Stacy <mcs(at)mayo(dot)edu> writes:
> > Newer versions of TCL implement ByteArray objects which are
> > the best fit for Postgresql Large Object functions.
>
> How newer is "newer"? That is, what compatibility problems might we
> create if we make this change?
ByteArrays were introduced in Tcl 8.1 (March 1999) along with the
change to use UTF-8 as internal string encoding.
cu
Reinhard