[Zope-dev] Re: zPoPy oid issues

2000-12-27 Thread Casey Duncan

[EMAIL PROTECTED] wrote:
 
 Hi,
 
 The problem is inside postgresql ! They use OID type for LOB and for table'oid, PoPy 
(to simplify LOB handling) detect automagically LOB and returns them to the end user 
who can handle them easily.
 I study the postgresql sources on the CVS and they haven't resolv this problem.
 We have to write this in the BUGS file we plan to add soon in our release.
 
 If you have any proposals to resolv this BIG problem ?
 
 I'm sorry for this but postgresql types are very confused.
 
 Best regards.
 
So, if I understand correctly, oids are handled as large binary objects?
From what I see, oids are 6 bytes in length (using SELECT
length(oid)...) since they have a max value of 4 billion, that leads me
to believe that only 4 bytes are used as a numeric value. So, they are
really just a glorified int4 with 2 extra bytes tacked on for some
reason.

Anyhow, why exactly does this cause PoPy to crash? I can surely work
around this problem for now, but I can certainly see cases where
returning an oid would be an essential function, especially if you are
working on a generalized database tool.

I am certainly willing to help get this fixed. Any additional
information you (or anybody) has regarding this would be greatly
appreciated.

Thanks for your help.
-- 
| Casey Duncan
| Kaivo, Inc.
| [EMAIL PROTECTED]
`--

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] RE: SQL Alias leak....

2000-12-27 Thread Brian Lloyd

 Making the corresponding change in Results.py appears to have
 corrected the SQLAlias problem.  
 
 I'm not exactly sure why the SQLAlias solution is any better than
 doing it this way.  Seems less obfuscated to me.

The SQLAlias is better because otherwise Record allocates
3x the memory for each record (thinking that the aliased 
names are distinct fields).

In any case, Jim tracked this down to a subtle bug in 
ExtensionClass that is fixed for 2.2.5 b1 (which I'm 
uploading the zope.org now).


Brian Lloyd[EMAIL PROTECTED]
Software Engineer  540.371.6909  
Digital Creations  http://www.digicool.com 




___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] Re: zPoPy oid issues

2000-12-27 Thread Casey Duncan

Actually I found that the Postgres length function returns the string
length (i.e. number of digits) of a number, so my previous message was
wrong about the byte length of an oid. AFAIK they are 4 byte integers.

I have found a way to retrieve oids without crashing Python or Zope. You
must do an explicit type conversion to a 4 byte integer like so:

SELECT int4(oid) FROM foo;

This behaves in a much friendlier manner. I would still like to see the
problem resolved, as I find the fact that an innocuous SELECT query
could crash Zope a bit troubling.

-- 
| Casey Duncan
| Kaivo, Inc.
| [EMAIL PROTECTED]
`--

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )