Skip site navigation (1) Skip section navigation (2)

Re: Python and 8.0 beta

From: Gaetano Mendola <mendola(at)bigfoot(dot)com>
To: Clodoaldo Pinto Neto <clodoaldo_pinto(at)yahoo(dot)com(dot)br>
Subject: Re: Python and 8.0 beta
Date: 2004-08-24 11:19:15
Message-ID: 412B2433.6040305@bigfoot.com (view raw or flat)
Thread:
Lists: 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











In response to

pgsql-general by date

Next:From: SecrétariatDate: 2004-08-24 11:53:38
Subject: Re: No connection to a PG 8.0 Beta 1 win32 server
Previous:From: Gaetano MendolaDate: 2004-08-24 11:13:40
Subject: Re: Connection to a PG 8.0 Beta 1 win32 server

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group