From: Billy G. A. <Bil...@mu...> - 2003-03-04 05:16:18
|
"Todd Reed" wrote: > I had PostgreSQL 7.21 and pyPgSQL 2.2 installed and working on a RedHat 7.3 > installation. After upgrading to PostgreSQL 7.3.2, my scripts generated an > ImportError as shown below: > > I found a copy libqp.so.2 in /usr/lib/pgsql/backup, and copied it to > /usr/lib. After that, I received the following error: > > Any suggestions on fixing this problem? Todd, 1. remove the libpq.so.2 from /usr/lib. 2. get the latest source code from CVS or get the source distribution from SF. 3. build pyPgSQL 2.3 from source. The backup copy of libpq.so.2 was from the previous version of PostgreSQL and will not work. The RPM was not built with the version of libpq.so you have for the newer version of PostgreSQL. Building from the source should resolve the issutes your are expirencing. |
From: Billy G. A. <bg...@mu...> - 2003-03-05 06:26:18
|
"Todd Reed" wrote: > I ended up installing pyPgSQL 2.3 from the source distribution, and this did > resolve the ImportError. However, there is an incompatibility between > pyPgSQL 2.3 and PostgreSQL 7.3.2 (and possibly other 7.3.x releases). The > system table pg_type used to have a column called "typprtlen" which is no > longer present in PostgreSQL 7.3.2. pyPgSQL makes a query on pg_type that > attempts to access this non-existent column to obtain information for the > "description" field of cursor objects. I ended up modifying the query to > always return -1; I think "typprtlen" was used to find the display width for > the column. > The 2.3 release does have the typprtlen problem. The CVS source contains a fix for that problem as well as several others. I would recommend getting the latest source from CVS for the latest bug fixes. -- ____ | Billy G. Allie | Domain....: Bil...@mu... | /| | 7436 Hartwell | MSN.......: B_G...@em... |-/-|----- | Dearborn, MI 48126| |/ |LLIE | (313) 582-1540 | |
From: Billy G. A. <bg...@mu...> - 2003-03-05 06:45:54
|
"Billy G. Allie" wrote: > "Todd Reed" wrote: > > I ended up installing pyPgSQL 2.3 from the source distribution, and this > > did resolve the ImportError. However, there is an incompatibility between > > pyPgSQL 2.3 and PostgreSQL 7.3.2 (and possibly other 7.3.x releases). The > > system table pg_type used to have a column called "typprtlen" which is no > > longer present in PostgreSQL 7.3.2. pyPgSQL makes a query on pg_type that > > attempts to access this non-existent column to obtain information for the > > "description" field of cursor objects. I ended up modifying the query to > > always return -1; I think "typprtlen" was used to find the display width > > for the column. > > > > The 2.3 release does have the typprtlen problem. The CVS source contains a > fix for that problem as well as several others. The 2.3 release does contain the fix for the typprtlen problem. The change in the current CVS was to have display length in the cursor.description object return None instead of -1. > I would recommend getting > the latest source from CVS for the latest bug fixes. I still recomend getting the latest source from CVS, though. :-) -- ____ | Billy G. Allie | Domain....: Bil...@mu... | /| | 7436 Hartwell | MSN.......: B_G...@em... |-/-|----- | Dearborn, MI 48126| |/ |LLIE | (313) 582-1540 | |
From: Todd R. <tr...@ko...> - 2003-03-04 16:42:10
|
I ended up installing pyPgSQL 2.3 from the source distribution, and this did resolve the ImportError. However, there is an incompatibility between pyPgSQL 2.3 and PostgreSQL 7.3.2 (and possibly other 7.3.x releases). The system table pg_type used to have a column called "typprtlen" which is no longer present in PostgreSQL 7.3.2. pyPgSQL makes a query on pg_type that attempts to access this non-existent column to obtain information for the "description" field of cursor objects. I ended up modifying the query to always return -1; I think "typprtlen" was used to find the display width for the column. ----- Original Message ----- From: "Billy G. Allie" <Bil...@mu...> To: "Todd Reed" <tr...@ko...> Cc: <pyp...@li...> Sent: Monday, March 03, 2003 10:15 PM Subject: Re: [Pypgsql-users] ImportError with libpq.so.2 > "Todd Reed" wrote: > > I had PostgreSQL 7.21 and pyPgSQL 2.2 installed and working on a RedHat 7.3 > > installation. After upgrading to PostgreSQL 7.3.2, my scripts generated an > > ImportError as shown below: > > > > I found a copy libqp.so.2 in /usr/lib/pgsql/backup, and copied it to > > /usr/lib. After that, I received the following error: > > > > Any suggestions on fixing this problem? > > Todd, > > 1. remove the libpq.so.2 from /usr/lib. > 2. get the latest source code from CVS or get the source distribution from SF. > 3. build pyPgSQL 2.3 from source. > > The backup copy of libpq.so.2 was from the previous version of PostgreSQL > and will not work. The RPM was not built with the version of libpq.so you > have for the newer version of PostgreSQL. Building from the source should > resolve the issutes your are expirencing. |
From: <gh...@gh...> - 2003-03-04 17:27:25
|
Todd Reed wrote: > I ended up installing pyPgSQL 2.3 from the source distribution, and this did > resolve the ImportError. However, there is an incompatibility between > pyPgSQL 2.3 and PostgreSQL 7.3.2 (and possibly other 7.3.x releases). The > system table pg_type used to have a column called "typprtlen" which is no > longer present in PostgreSQL 7.3.2. [...] This change was actually made in revision 1.18 of pyPgSQL/PgSQL.py (http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/pypgsql/pypgsql/pyPgSQL/PgSQL.py) and is in the 2.3 release. You seem to have old sources lying around. -- Gerhard |