pgdb.py is still wrong in Postgres 7.3.1 rpm

Started by Gaetano Mendolaover 23 years ago11 messagesbugs
Jump to latest
#1Gaetano Mendola
mendola@bigfoot.com

I already post the fact that the file pgdb.py distribuited with
Postgres 7.3 is wrong but was not already fixed in 7.3.1 !!!!

The class pgdbTypeCache is not working with the version 7.3.1
the method getdescr try to do the following select:

"SELECT typname, typprtlen, typlen FROM pg_type"

and the column typprtlen is not anymore available,
I suggested to rewrite that select in this way:

"SELECT typname, 4, typlen FROM pg_type"

and someone else suggested:

"SELECT typname, -1, typlen FROM pg_type"

why was not yet corrected ?

Ciao
Gaetano

#2Lamar Owen
lamar.owen@wgcr.org
In reply to: Gaetano Mendola (#1)
Re: [BUGS] pgdb.py is still wrong [not just] in Postgres 7.3.1 rpm

On Thursday 26 December 2002 07:15, Gaetano Mendola wrote:

I already post the fact that the file pgdb.py distribuited with
Postgres 7.3 is wrong but was not already fixed in 7.3.1 !!!!

why was not yet corrected ?

It is not an RPM specific problem, but your subject implies that it is.

Tom, Bruce: who has the python interface these days?
--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Lamar Owen (#2)
Re: [BUGS] pgdb.py is still wrong [not just] in Postgres 7.3.1 rpm

Lamar Owen <lamar.owen@wgcr.org> writes:

Tom, Bruce: who has the python interface these days?

D'Arcy still is the lead guy on it, I think. Looking at the CVS logs,
it seems this problem was fixed in CVS HEAD but not back-patched into
the 7.3 branch:

2002-12-04 07:23 darcy

* src/interfaces/python/pgdb.py: Remove typprtlen from getdescr()
as it is not available in 7.3. Return -1 for that field so that
existing programs don't break.

We should certainly back-patch this for 7.3.2. Not sure if any of the
other recent changes in interfaces/python should be back-patched.

regards, tom lane

#4Bruce Momjian
bruce@momjian.us
In reply to: Gaetano Mendola (#1)
Re: [ADMIN] pgdb.py is still wrong in Postgres 7.3.1 rpm

CC'ing D'Arcy.

Sorry, we really can't backpatch that unless D'Arcy does it. He
controls the python interface and applied the patch only to CVS head.

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

Gaetano Mendola wrote:

I already post the fact that the file pgdb.py distribuited with
Postgres 7.3 is wrong but was not already fixed in 7.3.1 !!!!

The class pgdbTypeCache is not working with the version 7.3.1
the method getdescr try to do the following select:

"SELECT typname, typprtlen, typlen FROM pg_type"

and the column typprtlen is not anymore available,
I suggested to rewrite that select in this way:

"SELECT typname, 4, typlen FROM pg_type"

and someone else suggested:

"SELECT typname, -1, typlen FROM pg_type"

why was not yet corrected ?

Ciao
Gaetano

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#5Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#3)
Re: [BUGS] pgdb.py is still wrong [not just] in Postgres 7.3.1

I have CC'ed D'Arcy asking for info.

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

Tom Lane wrote:

Lamar Owen <lamar.owen@wgcr.org> writes:

Tom, Bruce: who has the python interface these days?

D'Arcy still is the lead guy on it, I think. Looking at the CVS logs,
it seems this problem was fixed in CVS HEAD but not back-patched into
the 7.3 branch:

2002-12-04 07:23 darcy

* src/interfaces/python/pgdb.py: Remove typprtlen from getdescr()
as it is not available in 7.3. Return -1 for that field so that
existing programs don't break.

We should certainly back-patch this for 7.3.2. Not sure if any of the
other recent changes in interfaces/python should be back-patched.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#6Gerhard Häring
haering_postgresql@gmx.de
In reply to: Bruce Momjian (#4)
Re: [ADMIN] pgdb.py is still wrong in Postgres 7.3.1 rpm

* Bruce Momjian <pgman@candle.pha.pa.us> [2003-01-07 17:13 -0500]:

CC'ing D'Arcy.

Sorry, we really can't backpatch that unless D'Arcy does it. He
controls the python interface and applied the patch only to CVS head.

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

Gaetano Mendola wrote:

I already post the fact that the file pgdb.py distribuited with
Postgres 7.3 is wrong but was not already fixed in 7.3.1 !!!!

The class pgdbTypeCache is not working with the version 7.3.1
the method getdescr try to do the following select:

"SELECT typname, typprtlen, typlen FROM pg_type"

and the column typprtlen is not anymore available,
I suggested to rewrite that select in this way:

"SELECT typname, 4, typlen FROM pg_type"

and someone else suggested:

"SELECT typname, -1, typlen FROM pg_type"

That was me.

This, however is WRONG, (and I'll also have to fix it in pyPgSQL
eventually).

I recently asked a related question in the Python DB-SIGs mailing list
recently in a thread

"cursor.description - values for 'I don't know'"

asking which value to use for unknown values in cursor.description
(here: the displaysize field).

The answer is to use None for unknown values, *not* -1 like I proposed
above. In fact, the DB-API 2.0 specification clearly says so, but it
somehow slipped my eye.

Gerhard
--
Favourite database: http://www.postgresql.org/
Favourite programming language: http://www.python.org/
Combine the two: http://pypgsql.sf.net/
Embedded database for Python: http://pysqlite.sf.net/

#7D'Arcy J.M. Cain
darcy@druid.net
In reply to: Bruce Momjian (#4)
Re: [ADMIN] pgdb.py is still wrong in Postgres 7.3.1 rpm

On Tuesday 07 January 2003 17:13, Bruce Momjian wrote:

Sorry, we really can't backpatch that unless D'Arcy does it. He
controls the python interface and applied the patch only to CVS head.

"Controls" is probably too strong a word. "Leads" is more like it since we
merged the projects.

I'm not sure what is being asked for here. Is there some sort of pull-up (or
pull-down) required? There's not much on the site explaining this.

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.
#8Tom Lane
tgl@sss.pgh.pa.us
In reply to: D'Arcy J.M. Cain (#7)
Re: [ADMIN] pgdb.py is still wrong in Postgres 7.3.1 rpm

"D'Arcy J.M. Cain" <darcy@druid.net> writes:

I'm not sure what is being asked for here.

We'd like to put the typlen fix into the REL7_3_STABLE CVS branch.
Also any other post-7.3 fixes that you consider appropriate for 7.3.2
(ie, important, low-risk fixes).

If you're not comfortable enough with CVS-munging to want to touch
branches other than HEAD, Bruce or I can handle it for you. Just let
us know exactly which changes should be back-patched.

regards, tom lane

#9D'Arcy J.M. Cain
darcy@druid.net
In reply to: Tom Lane (#8)
Re: [ADMIN] pgdb.py is still wrong in Postgres 7.3.1 rpm

On Tuesday 07 January 2003 23:12, Tom Lane wrote:

"D'Arcy J.M. Cain" <darcy@druid.net> writes:

I'm not sure what is being asked for here.

We'd like to put the typlen fix into the REL7_3_STABLE CVS branch.
Also any other post-7.3 fixes that you consider appropriate for 7.3.2
(ie, important, low-risk fixes).

I also just fixed that file again. As someone else just pointed out, we need
to return None instead of -1 there.

If you're not comfortable enough with CVS-munging to want to touch
branches other than HEAD, Bruce or I can handle it for you. Just let
us know exactly which changes should be back-patched.

Sure. Just that one and the one I just made I think. Other things were
mainly feature additions. If you can tell me what the process is or point me
to the relevant docs I can do this myself in the future. I want to walk
softly here because I know that different projects have different rules and
methods for these sorts of things.

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.
#10D'Arcy J.M. Cain
darcy@druid.net
In reply to: Gerhard Häring (#6)
Re: [ADMIN] pgdb.py is still wrong in Postgres 7.3.1 rpm

On Tuesday 07 January 2003 18:28, Gerhard H�ring wrote:

I recently asked a related question in the Python DB-SIGs mailing list
recently in a thread

"cursor.description - values for 'I don't know'"

asking which value to use for unknown values in cursor.description
(here: the displaysize field).

The answer is to use None for unknown values, *not* -1 like I proposed
above. In fact, the DB-API 2.0 specification clearly says so, but it
somehow slipped my eye.

I have fixed this in HEAD.

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.
#11Bruce Momjian
bruce@momjian.us
In reply to: D'Arcy J.M. Cain (#9)
Re: [ADMIN] pgdb.py is still wrong in Postgres 7.3.1 rpm

D'Arcy J.M. Cain wrote:

On Tuesday 07 January 2003 23:12, Tom Lane wrote:

"D'Arcy J.M. Cain" <darcy@druid.net> writes:

I'm not sure what is being asked for here.

We'd like to put the typlen fix into the REL7_3_STABLE CVS branch.
Also any other post-7.3 fixes that you consider appropriate for 7.3.2
(ie, important, low-risk fixes).

I also just fixed that file again. As someone else just pointed out, we need
to return None instead of -1 there.

If you're not comfortable enough with CVS-munging to want to touch
branches other than HEAD, Bruce or I can handle it for you. Just let
us know exactly which changes should be back-patched.

Sure. Just that one and the one I just made I think. Other things were
mainly feature additions. If you can tell me what the process is or point me
to the relevant docs I can do this myself in the future. I want to walk
softly here because I know that different projects have different rules and
methods for these sorts of things.

What I normally do is to do a separate checkout for the branch I want to
patch. In this case, a cvs log on /HISTORY shows it as:

REL7_3_STABLE: 1.182.0.2

You know it is a branch rather than a tag because it has four numbers.
(The developers FAQ has stuff on this.) I then make changes to that
CVS, and do a commit while sitting in that CVS tree. I applies the
changes against that branch only.

I usually get a cvs diff from the HEAD tree, and apply that patch file
against the branch. Let me know if you would like me to do it.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073