<br>Hi,<br><br>Python throws OperationalError while trying to do any database operations. I am using pgdb module.<br><b><u><br></u></b><dl><dt><u><b>Code:</b></u></dt></dl><span style="color: rgb(102, 102, 102);">import pgdb</span><br style="color: rgb(102, 102, 102);">
<br style="color: rgb(102, 102, 102);"><span style="color: rgb(102, 102, 102);">
__metaclass__=type</span><br style="color: rgb(102, 102, 102);">
<br style="color: rgb(102, 102, 102);"><span style="color: rgb(102, 102, 102);">
class addbook:</span><br style="color: rgb(102, 102, 102);">
<br style="color: rgb(102, 102, 102);"><span style="color: rgb(102, 102, 102);">
conn=pgdb.connect(dsn='localhost:secondbooks',user='postgres',password='postgres1')</span><br style="color: rgb(102, 102, 102);"><span style="color: rgb(102, 102, 102);">
curs=conn.cursor()</span><br style="color: rgb(102, 102, 102);">
<br style="color: rgb(102, 102, 102);"><span style="color: rgb(102, 102, 102);">
def addBook(self):<code><font size="2"><br><br></font></code> <u>infunction_curs=self.curs</u></span><u><br style="color: rgb(102, 102, 102);"><span style="color: rgb(102, 102, 102);"></span></u><code style="color: rgb(102, 102, 102);"><font style="font-family: arial,helvetica,sans-serif;" size="2"> <u>infunction_curs.execute('SELECT * FROM table_book')<br>
<br><br></u></font></code><b><u>error code:</u></b> <br><br><code><font style="font-family: arial,helvetica,sans-serif;" size="2"><span style="color: rgb(102, 102, 102);">File "/usr/lib/python2.5/site-packages/pgdb.py", line 197, in executemany</span><br style="color: rgb(102, 102, 102);">
<span style="color: rgb(102, 102, 102);">raise OperationalError, "internal error in '%s': %s" % (sql,err)</span><br style="color: rgb(102, 102, 102);"><span style="color: rgb(102, 102, 102);">pg.OperationalError: internal error in 'SELECT * FROM table_book': error return without exception set</span></font></code><br>
<br>i am not able to do any database operations apart from opening Conection and assaigning cursor object.<br><br>how do i solve this. pls help<br><br>
Thanks in advance<br><font color="#888888"><br>Bijoy</font><br><br>