From: Billy G. A. <bil...@de...> - 2005-08-31 03:24:42
|
On Tue, 2005-08-30 at 16:44 +0000, Rod MacNeil wrote: > Hi All, > > I'm using pyPgSQL 2.4 postgres 7.4.7 on fedora core 3. > > I have a question about the data type returned in cursor.description when oid is included in the select. > > When I run a query like "select oid, field1,field2 from mytable where field2='x'". > > cursor.description says the oid column is type 'rowid' if there are result rows, but if there are no result rows it says the type is 'blob'. > > Is this a bug? > > Rod MacNeil Not really. It's caused by the fact that an OID can represent a rowid or a postgresql large object (i.e. blob). The only way to tell which one it is is to see if the value of the OID exists as a large object or not. Since there is no result (and hence not value) the lookup can't be made so a type of blob is assumed. -- ____ | Billy G. Allie | Domain....: Bil...@mu... | /| | 7436 Hartwell | MSN.......: B_G...@em... |-/-|----- | Dearborn, MI 48126| |/ |LLIE | (313) 582-1540 | |