dbTalk Databases Forums  

[BUGS] pgtcl large object fix

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] pgtcl large object fix in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mahlon Stacy
 
Posts: n/a

Default [BUGS] pgtcl large object fix - 08-06-2003 , 04:38 PM






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);
---
Quote:
bufObj = Tcl_NewByteArrayObj(buf, nbytes);
1310c1310
< buf = Tcl_GetStringFromObj(objv[3], &nbytes);
---
Quote:
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
-------------------------------------------------------------

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org


Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] pgtcl large object fix - 08-06-2003 , 05:06 PM






Mahlon Stacy <mcs (AT) mayo (DOT) edu> writes:
Quote:
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

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html


Reply With Quote
  #3  
Old   
Reinhard Max
 
Posts: n/a

Default Re: [BUGS] pgtcl large object fix - 08-07-2003 , 05:17 AM



On Wed, 6 Aug 2003 at 18:02, Tom Lane wrote:

Quote:
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


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.