pgtcl large object fix - Mailing list pgsql-bugs

From Mahlon Stacy
Subject pgtcl large object fix
Date
Msg-id 4B08D99CFA03D04EAF34E1A28C4D159C2E96AF@pocono.mayo.edu
Whole thread Raw
Responses Re: pgtcl large object fix
List 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@mayo.edu
Mayo Foundation                (507) 284-4558
Medical Science Bldg 1-43      FAX (507) 284-1632
Rochester, MN 55905
-------------------------------------------------------------

pgsql-bugs by date:

Previous
From: Joseph Shraibman
Date:
Subject: pg 7.4beta1 doc bug: vacuum not updated
Next
From: Tom Lane
Date:
Subject: Re: pgtcl large object fix