Re: PyGreSQL bug

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Andrew Johnson <ajohnson(at)lynn(dot)ci-n(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: PyGreSQL bug
Date: 2002-04-23 17:31:20
Message-ID: 200204231731.g3NHVKE19117@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Discription of patch for python.

---------------------------------------------------------------------------

Andrew Johnson wrote:
> On Wed, Apr 17, 2002 at 10:12:10PM -0400, Bruce Momjian wrote:
> >
> > No one has replied, so I worked up a patch that I will apply in a few
> > days. Let me know if you don't like it.
>
> Hmm... problem I have with that is it changes the interface, and might
> break existing code. Only other option is to use ordered, rather than named
> parameters in the _pg.connect call.
>
>
> > Index: src/interfaces/python/pgdb.py
> > ===================================================================
> > RCS file: /cvsroot/pgsql/src/interfaces/python/pgdb.py,v
> > retrieving revision 1.10
> > diff -c -r1.10 pgdb.py
> > *** src/interfaces/python/pgdb.py 19 Mar 2002 02:47:57 -0000 1.10
> > --- src/interfaces/python/pgdb.py 18 Apr 2002 02:10:20 -0000
> > ***************
> > *** 337,343 ****
> > ### module interface
> >
> > # connects to a database
> > ! def connect(dsn = None, user = None, password = None, host = None, database = None):
> > # first get params from DSN
> > dbport = -1
> > dbhost = ""
> > --- 337,343 ----
> > ### module interface
> >
> > # connects to a database
> > ! def connect(dsn = None, user = None, password = None, xhost = None, database = None):
> > # first get params from DSN
> > dbport = -1
> > dbhost = ""
> > ***************
> > *** 364,372 ****
> > dbpasswd = password
> > if database != None:
> > dbbase = database
> > ! if host != None:
> > try:
> > ! params = string.split(host, ":")
> > dbhost = params[0]
> > dbport = int(params[1])
> > except:
> > --- 364,372 ----
> > dbpasswd = password
> > if database != None:
> > dbbase = database
> > ! if xhost != None:
> > try:
> > ! params = string.split(xhost, ":")
> > dbhost = params[0]
> > dbport = int(params[1])
> > except:
>
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-04-23 17:46:09 Re: My talk at Linuxtag
Previous Message Bruce Momjian 2002-04-23 17:29:20 Re: new food for the contrib/ directory