Re: Strange phenomenon?

"Billy G. Allie" <[email protected]>
Newsgroups gmane.comp.python.db.pypgsql.user
Organization michigan!/usr/group
Message-ID <[email protected]>
Dick Kniep wrote:

>Hi List,
>
>The last 6 month I have been developing a system with Python, wxPython
>and pyPgSQL. I use Python 2.2.2, PostgreSQL 7.3.2 (the latest) and
>pyPgSQL 2.3
>
>Mostly, it works great. Thanks to all contributors.
>
>However, lately I saw a strange phenomenon. When I use the following
>select statement :
>
>Select last-value from tabellen_tab-id_seq;
>
>where tabellen_tab-id_seq is a Postgresql sequence, I get back a number
>followed by an 'L' so in this case the result was 
>[547L]. Obviously this fails in the rest of my code, because I expect an
>integer.
>
>I think it might have something to do with the fact that in PostgreSQL
>this is an 8 byte int, but I am not sure....
>  
>
This is strage.  The result of a serial8 field should be a BIGINT, which 
is handled as a PgInt8 type.
Does your system have native 8-byte int (long long) support.  If not the 
BIGINTs are supported
using Python's Long integer type (hence the L at the end of the number).

How is the long integer failing in the rest of your code?  Printing the 
value will not display the 'L'.
Using the str() function on the number will not place an 'L' in the 
resulting string.  The only time
the 'L' is display is in the result of using the repr() function on the 
number, so how is your code
failing? (If I know how it's failing I may be able to help fix it.)

-- 
___________________________________________________________________________
____       | Billy G. Allie    | Domain....: [email protected]
|  /|      | 7436 Hartwell     | MSN.......: [email protected]
|-/-|----- | Dearborn, MI 48126|
|/  |LLIE  | (313) 582-1540    |




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.