Re: Python and 8.0 beta - Mailing list pgsql-general

From Gaetano Mendola
Subject Re: Python and 8.0 beta
Date
Msg-id 412B2433.6040305@bigfoot.com
Whole thread Raw
In response to Re: Python and 8.0 beta  (Clodoaldo Pinto Neto <clodoaldo_pinto@yahoo.com.br>)
List pgsql-general
Clodoaldo Pinto Neto wrote:

 >>Are there any python drivers that work with the version 8 beta?
 >>
 >>The version seven ones didn't.
 >
 >
 > This script is working with version 7.4.2, FC2, python 2.3.3
 >
 > [SNIP]

May you test the following script and let me know which error you are encountering:


#!/usr/bin/python

import pgdb

if ( __name__ == "__main__") :
         connection = pgdb.connect(
                         user = 'user',
                         password = 'password',
                         host = '127.0.0.1',
                         database = 'database')

         if ( connection == None):
                 raise "Could Not Connect"

         cursor = connection.cursor()
         cursor.execute ( 'select version()' )
         result = cursor.fetchall()
         cursor.close()

         while ( type(result) is type([]) ):
                 result = result[ 0 ]

         print result



this is working correctly on my 8.0beta1 installation

Regards
Gaetano Mendola











pgsql-general by date:

Previous
From: Gaetano Mendola
Date:
Subject: Re: Connection to a PG 8.0 Beta 1 win32 server
Next
From: Tom Lane
Date:
Subject: Re: pg_dump in stand alone backend