Here are the usual suspects and versions

1. Ubuntu Edgy 6.10 (Linux Distribution)
2. Python 2.5 Final
3. PostgreSQL 8.1.4
4. SQLAlchemy 0.2.8-1 or 3.3
5. python-psycopg2 version 2.0.5.1-1.


I am having a serious lockup problem. The summary is I am following the
tutorial to the letter. When it comes to "Selecting", I keep
experiencing a lock-up upon trying to drop the table at the end of my
script. the problem lock-up on my machine is 100% reproducible in
examples 01 and 02.


# Following the SQLAlchemy tutorial to the letter (-fetchall())!
# -- 01.
s = users_table.select()           # create SELECT ClauseElement object
r = s.execute()                    # necessary evil to make executable?
print r.fetchone()                 # successfully fetch the first row
users_table.drop(checkfirst=True)  # table never gets dropped!!!


# I've narrowed it down to s.execute()!
# -- 02.
s = users_table.select()           # create SELECT ClauseElement object
r = s.execute()                    # necessary evil to make executable?
users_table.drop(checkfirst=True)  # table never gets dropped!!!


# Modifying the above into the following doesn't cause a freeze...
# -- 03.
s = users_table.select()           # create SELECT ClauseElement object
print s.execute().fetchone()       # successfully fetch the first row
users_table.drop(checkfirst=True)  # table drops just fine!


I am not sure if this can shed some light on the subject *but* if I
take example 01 and add a fetchall() method after fetchone() (e.g.
04.), the table will drop in the end. The table dropping also works if
I replace the fetchone() method with fetchall() (e.g. 05.). It also
works if I emulate fetchone() with fetchall()[0] (e.g. 06.).


# Following the SQLAlchemy tutorial to the letter (+fetchall())!
# -- 04.
s = users_table.select()           # create SELECT ClauseElement object
r = s.execute()                    # necessary evil to make executable?
print r.fetchone()                 # successfully fetch the first row
print r.fetchall()                 # successfully fetch all rows
users_table.drop(checkfirst=True)  # table drops just fine!


# Following the SQLAlchemy tutorial to the letter (-fetchone())!
# -- 05.
s = users_table.select()           # create SELECT ClauseElement object
r = s.execute()                    # necessary evil to make executable?
print r.fetchall()                 # successfully fetch all rows
users_table.drop(checkfirst=True)  # table drops just fine!


# imitating fetchone() with fetchall[0] works too!
# -- 06.
s = users_table.select()           # create SELECT ClauseElement object
r = s.execute()                    # necessary evil to make executable?
print r.fetchall()[0]              # successfully fetch all rows
users_table.drop(checkfirst=True)  # table drops just fine!


In the end, the problem is with examples 01 and 02. At the bare
minimum, 02, the smallest example is where I feel the problem lies.
Maybe I am just bugging out or doing something wrong but examples 01
and 02 will never let me drop the table in the end. Could someone
please advise on what the problem is. I would really appreciate the
help here. Thank you!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to