473,654 Members | 3,066 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python client lib for PostgreSQL8

I just tried to connect to a PostgreSQL8 beta2 database server with
pyPgSQL 2.4 and got a libpq.DatabaseE rror telling "Ivalid format for
PgVersion construction".

Is there already a PyPgSQL version in CVS or another client library
that handles PostgreSQL 8?

--
-------------------------------------------------------------------
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0 BtcGx1c3IuZGU=\ n'.decode('base 64')
-------------------------------------------------------------------
Jul 18 '05 #1
5 1434
On Thu, Nov 18, 2004 at 01:58:48PM +0100, Peter Maas wrote:
I just tried to connect to a PostgreSQL8 beta2 database server with
pyPgSQL 2.4 and got a libpq.DatabaseE rror telling "Ivalid format for
PgVersion construction".

Is there already a PyPgSQL version in CVS or another client library
that handles PostgreSQL 8?


Oh, I wanted to fix that since some time ago.

Attached is a quick, completely untested try. If it doesn't work like this,you
should get the idea how to make it work ;-)

-- Gerhard

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBnKlHdIO 4ozGCH14RAiLTAJ 4vuRpjlBYiKe7K3 w5hSNdqz92CvgCe N8ty
nMWLDmkwA6j2dV8 3b0+Q18I=
=hSiu
-----END PGP SIGNATURE-----

Jul 18 '05 #2
Peter Maas <pe***@somewher e.com> writes:
I just tried to connect to a PostgreSQL8 beta2 database server with
pyPgSQL 2.4 and got a libpq.DatabaseE rror telling "Ivalid format for
PgVersion construction".
This bug was reported over three months ago:

http://sourceforge.net/tracker/index...28&atid=116528
Is there already a PyPgSQL version in CVS or another client library
that handles PostgreSQL 8?


A lot of people like psycopg.

http://initd.org/software/initd/psycopg

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
Jul 18 '05 #3
Gerhard Haering schrieb:
On Thu, Nov 18, 2004 at 01:58:48PM +0100, Peter Maas wrote:
I just tried to connect to a PostgreSQL8 beta2 database server with
pyPgSQL 2.4 and got a libpq.DatabaseE rror telling "Ivalid format for
PgVersion construction".
[...] Attached is a quick, completely untested try. If it doesn't work like this, you
should get the idea how to make it work ;-)


Thanks, Gerhard, but it doesn't work.

The error is due to pgversion.c/parseToken(). Parsing the vstr info
into major, minor, patch doesn't work. The version string from
"SELECT version();" is

PostgreSQL 8.0.0beta4 on ...

parseToken() handles beta versions too restrictive allowing only ...b4
instead of ...beta4. I have relaxed this condition by replacing the line

*result = strtol(token, &last, 0);

by

*result = strtol(token, &last, 0);
return (errno != 0);

thus allowing everything after the patch number. This is perhaps
too permissive but my test script with a simple SELECT statement
works now.

--
-------------------------------------------------------------------
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0 BtcGx1c3IuZGU=\ n'.decode('base 64')
-------------------------------------------------------------------
Jul 18 '05 #4
Michael Fuhr schrieb:
Is there already a PyPgSQL version in CVS or another client library
that handles PostgreSQL 8?

A lot of people like psycopg.

http://initd.org/software/initd/psycopg


Thanks, Michael. Does it handle PostgreSQL 8beta? I didn't try psycopg
yet because I used to work at a Win2k computer and wasn't able to
compile it. C++Builder didn't work and I was not in the mood to buy
MSVC for compiling Python extensions).

Now I've made the jump to a Linux workstation but I still prefer
software that I can install on several platforms without hassle.
I don't have any clue what advantages psycopg has over pyPgSQL.
Are there comparisons / benchmarks available?

--
-------------------------------------------------------------------
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0 BtcGx1c3IuZGU=\ n'.decode('base 64')
-------------------------------------------------------------------
Jul 18 '05 #5
Peter Maas <pe***@somewher e.com> writes:
Michael Fuhr schrieb:
Is there already a PyPgSQL version in CVS or another client library
that handles PostgreSQL 8?
A lot of people like psycopg.

http://initd.org/software/initd/psycopg


Thanks, Michael. Does it handle PostgreSQL 8beta?


Yes -- I use psycopg with the PostgreSQL 8.0 betas.
Now I've made the jump to a Linux workstation but I still prefer
software that I can install on several platforms without hassle.
I don't have any clue what advantages psycopg has over pyPgSQL.
Are there comparisons / benchmarks available?


Psycopg can be a lot faster than pyPgSQL or PyGreSQL, especially
when retrieving large data sets. You could google for comparisons,
but the most meaningful benchmarks would be those that you ran
against your own data.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
Jul 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
6275
by: MK | last post by:
I'm working with IIS on W2K server. I'm trying to use module "wmi" in a CGI script but with no success. The following works: import cgitb; cgitb.enable() cgi.test() .... but the following isn't working:
2
4898
by: DeepBleu | last post by:
When one is using an HTML form via a web broswer, the user submits the form contents and these are passed to a CGI Python script on the web server. I need to write a client script that connects to a web site, runs a Python CGI script on the web server AND passes a string to the CGI Python script that the Python CGI script can store/manipulate/evalute etc.... I know how to connect to the web site and run the CGI Python script using a client...
11
10082
by: Nick Keighley | last post by:
I'm probably missing something rather obvious, but is there a known problem with getting a Python based socket program to communicate with a C based socket program? A simple echo server written in Python (the example from Python in a Nutshell actually) will happily talk to a Python based client. If a C based client is substitued the connection is refused (or so the C client reports). The C client will talk to a C server. --
17
20040
by: Simon Foster | last post by:
I am meeting with a potential client next week to discuss starting a new project. His preference is for VB whereas I would prefer Python for obvious reasons ;-) Could anybody come up with a short list of the pros and cons of the two languages (I am not terribly familiar with the strengths/weaknesses of VB). This will be a general-purpose text-processing type application with no GUI required.
5
1554
by: black | last post by:
Howdy everyone~ i heard Python could be used in web programming and aftering searching many docs just found something on Python and CGI. the fact is i know nothing about CGI and most of my projects(both of company and myself) are established with PHP and ASP. now the questions come: 1. Could Python be used in web programming ? (i guess yes ?) 2. If the answer of above is yes, then can we programms with Python in both server and client...
3
1961
by: Paul Keating | last post by:
I have a very simple COM server written in Python that is trying to return a two-dimensional array 268 x 20. The values it contains are some small integers, some short (<29 character) Unicode strings, and None. To isolate the problem I have taken out the code that builds the matrix from real data, and just substituted a literal tuple of tuples, like this: class AtlasSecurity:
8
4581
by: Joakim Persson | last post by:
Hello all. I am involved in a project where we have a desire to improve our software testing tools, and I'm in charge of looking for solutions regarding the logging of our software (originating from embedded devices). Currently, we are using a heavyweight, proprietary log tool developed by another part of the company. This tool contains all "standard" logging functionality, but we also need to insert "debug" log points in the software of...
29
2773
by: Frank Millman | last post by:
Hi all I am writing a multi-user accounting/business system. Data is stored in a database (PostgreSQL on Linux, SQL Server on Windows). I have written a Python program to run on the client, which uses wxPython as a gui, and connects to the database via TCP/IP. The client program contains all the authentication and business logic. It has dawned on me that anyone can bypass this by modifying the program. As it is written in Python, with...
28
2618
by: H J van Rooyen | last post by:
Hi, I want to write a small system that is transaction based. I want to split the GUI front end data entry away from the file handling and record keeping. Now it seems almost trivially easy using the sockets module to communicate between machines on the same LAN, so that I want to do the record keeping on one machine.
0
8380
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8296
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8710
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8497
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7310
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5627
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
1928
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1598
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.