[Tutor] Operational Error. --HELP
bob gailer
bgailer at gmail.com
Tue Mar 31 20:50:29 CEST 2009
bijoy franco wrote:
>
> Hi,
>
> Python throws OperationalError while trying to do any database
operations. I am using pgdb module.
>
> Code:
>
> import pgdb
>
> __metaclass__=type
>
> class addbook:
>
>
conn=pgdb.connect(dsn='localhost:secondbooks',user='postgres',password='postgres1')
> curs=conn.cursor()
>
> def addBook(self):
>
> infunction_curs=self.curs
> infunction_curs.execute('SELECT * FROM table_book')
>
>
> error code:
>
> File "/usr/lib/python2.5/site-packages/pgdb.py", line 197, in executemany
> raise OperationalError, "internal error in '%s': %s" % (sql,err)
> pg.OperationalError: internal error in 'SELECT * FROM table_book':
error return without exception set
>
> i am not able to do any database operations apart from opening
Conection and assaigning cursor object.
>
> how do i solve this. pls help
1 - please post in plain text - I reformatted it so I could read it.
2 - please post the rest of the code and the rest of the traceback so we
can see where addbook is instantiated and where addBook is called. It is
impossible for me to diagnose this without that information.
3 - have you verified in some other way that SELECT * FROM table_book is
acceptable to postgresql?
4 - please reply to the list
>
> Thanks in advance
>
> Bijoy
>
Welcome in retrospect.
More information about the Tutor
mailing list