473,698 Members | 2,179 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PostgreSQL 7.4.1 and pgdb.py

Hi
My box: RedHat 9.0, Pentium III

Recently I upgraded from PostgreSQL 7.3.2 to PostgreSQL 7.4.1.
The PostgreSQL 7.3.2's rpms were installed from RehHat CDs
The PostgreSQL 7.4.1's rpms I used to upgrade were downloaded from RHEL3
subdirectory (of the mirror
ftp://ftp4.ar.postgresql.org/pub/mir.../redhat/rhel3).

The upgrade is working well, even I can connect to PostgreSQL from a PHP
script.

Before upgrading I used to connect to PostgresQL using pgdb.py (part of
PyGreSQL that comes with one of the rpms I guess). The sintaxis I was using
from interactive shell were:

---------------
import pgdb
dbConnect = pgdb.connect(ds n='localhost:or acle', user='manuel', password='')cursor = dbConnect.curso r()
cursor.execu te("select * from address")
while (1): .... row = cursor.fetchone ()
.... if row == None:
.... break
.... print row
....
['BAILEY','WILLI AM',None,None,N one,None,'213-293-0223',None]
['ADAMS','JACK', None,None,None, None,'415-453-7330',None]
-
-cursor.close ()
dbConnect.cl ose() -----------------------

As you can see, the connection and fechting were successful.

But now when I input the same sintaxis with the new Installation(Po stgreSQL
7.4.1), I get an error when I enter rhe four line:

----------------import pgdb
dbConnect = pgdb.connect(ds n='localhost:or acle', user='manuel', password='')cursor = dbConnect.curso r()
cursor.execu te("select * from address")

Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.2/site-packages/pgdb.py", line 189, in execute
self.executeman y(operation, (params,))
File "/usr/lib/python2.2/site-packages/pgdb.py", line 221, in executemany
desc = type[1:2]+self ._cache.getdesc r(typ[2])
File "/usr/lib/python2.2/site-packages/pgdb.py", line 149, in getdescr
self ._source.execut e(
_pg.error: ERROR: non exist the column "typprtlen"
------------------

By the way the types of columns from address table are:
lastname varchar(25)
firstname varchar(25)
street varchar(30)
city varchar(15)
state varchar(2)
zip int
phone varchar(12)
ext varchar(5)

My questions:

-Anybody knows why I can't connect to PostgreSQL using the pgdb.py module
now?
- Perhaps the sintaxis has changed?
Manuel Tejada
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 22 '05
14 4106
On Friday 30 January 2004 10:59 pm, Alvaro Herrera wrote:
On Fri, Jan 30, 2004 at 07:42:27PM -0800, Jeff Davis wrote:
You can probably get an updated pgdb.py somehow, or you can just use
"import pg" which has a different interface (non DBAPI-2.0 compliant)
but should work fine (since it doesn't try to access system catalogs,
it's more of a low-level PG interface for python).
Keep in mind that there's also psycopg and PyGreSql, as far as Python
interfaces go.


Since I don't necessarily keep up with what is going on in the Python client
world, would people enlighten me as to which python client would be best to
build RPMs for? I'm going to pull the python subpackage out of the main set,
but I really would like to roll a set for the python clients, unless the
maintainers of those now out of the main tarball clients have their own RPMs.
--
Lamar Owen
Director of Information Technology
Pisgah Astronomical Research Institute
1 PARI Drive
Rosman, NC 28772
(828)862-5554
www.pari.edu
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postg resql.org

Nov 22 '05 #11

Since I don't necessarily keep up with what is going on in the Python client
world, would people enlighten me as to which python client would be best to
build RPMs for?
Well at CMD we only use psycopg as it is the only one we have used that
has proven to:

A. Actually be actively maintained.
B. Have a solid community behind it.
C. It is what Zope (although we don't Zope) uses.

Sincerely,

Joshua D. Drake


I'm going to pull the python subpackage out of the main set, but I really would like to roll a set for the python clients, unless the
maintainers of those now out of the main tarball clients have their own RPMs.

--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - jd@commandpromp t.com - http://www.commandprompt.com
Mammoth PostgreSQL Replicator. Integrated Replication for PostgreSQL

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 22 '05 #12
Lamar Owen wrote:
On Friday 30 January 2004 10:59 pm, Alvaro Herrera wrote:
On Fri, Jan 30, 2004 at 07:42:27PM -0800, Jeff Davis wrote:
You can probably get an updated pgdb.py somehow, or you can just use
"import pg" which has a different interface (non DBAPI-2.0 compliant)
but should work fine (since it doesn't try to access system catalogs,
it's more of a low-level PG interface for python).


Keep in mind that there's also psycopg and PyGreSql, as far as Python
interfaces go.

Since I don't necessarily keep up with what is going on in the Python client
world, would people enlighten me as to which python client would be best to
build RPMs for? I'm going to pull the python subpackage out of the main set,
but I really would like to roll a set for the python clients, unless the
maintainers of those now out of the main tarball clients have their own RPMs.

Simply distribute the same files distributed with postgres 7.3.X, what
you did in last 7.4.1 distribution was insert a pre 7.3.2 pgdb.py
IMHO is a pity remove the pyhton subpackage just for a so little mistake.
Regards
Gaetano Mendola


Nov 22 '05 #13
As a user of PostgreSQL I totally agree with Gaetano Mendola.
There is no reason to pull the python subpackage out of the main set,

----- Original Message -----
From: "Gaetano Mendola" <me*****@bigfoo t.com>
To: <pg***********@ postgresql.org>
Sent: Friday, February 06, 2004 9:24 PM
Subject: Re: [GENERAL] PostgreSQL 7.4.1 and pgdb.py

Lamar Owen wrote:
On Friday 30 January 2004 10:59 pm, Alvaro Herrera wrote:
On Fri, Jan 30, 2004 at 07:42:27PM -0800, Jeff Davis wrote:

You can probably get an updated pgdb.py somehow, or you can just use
"import pg" which has a different interface (non DBAPI-2.0 compliant)
but should work fine (since it doesn't try to access system catalogs,
it's more of a low-level PG interface for python).
Keep in mind that there's also psycopg and PyGreSql, as far as Python
interfaces go.

Since I don't necessarily keep up with what is going on in the Python client world, would people enlighten me as to which python client would be best to build RPMs for? I'm going to pull the python subpackage out of the main set, but I really would like to roll a set for the python clients, unless the
maintainers of those now out of the main tarball clients have their own

RPMs.

Simply distribute the same files distributed with postgres 7.3.X, what
you did in last 7.4.1 distribution was insert a pre 7.3.2 pgdb.py
IMHO is a pity remove the pyhton subpackage just for a so little mistake.
Regards
Gaetano Mendola

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postg resql.org

Nov 22 '05 #14


On Sun, 8 Feb 2004, Manuel Tejada wrote:
Lamar Owen wrote:
Since I don't necessarily keep up with what is going on in the Python client world, would people enlighten me as to which python client would be best to build RPMs for? I'm going to pull the python subpackage out of the main set, but I really would like to roll a set for the python clients, unless the
maintainers of those now out of the main tarball clients have their own

RPMs.

As a user of PostgreSQL I totally agree with Gaetano Mendola.
There is no reason to pull the python subpackage out of the main set,


The decision to remove all interfaces from the main CVS tree was made in
part to remove the responsibility of the core developers to maintain the
build systems for various components and try to make sure that bugs and
new backend functionality were addressed. While this allows core
developers to focus solely on the backend it puts a lot of pressure on the
packagers to track the various components they are now distributing.
This is not the first packaging problem and it won't be the last if we
rely on a very busy package maintainer to track each independent project.
The only people who really know which version needs to go into an package
are the projects' maintainers.

Asking the interface projects to build and distribute their own packages
is not going to work because they are not likely to have all of the
requirements the existing packagers already have: expertise with the
packaging system, access to machines to build this on a variety of
platforms, and contacts with the upstream package distributors.

Perhaps a system where each project maintainer could register the correct
version of their package to go with each server version. This way in
addition to the hackers email that goes out saying "we're planning on
making the 7.X.X release on Monday" this would also go out to the project
maintainers who would then produce a new version if necessary and register
it on a website somewhere. Then when a packager is ready to produce a
package he can check the website and immediately find for all packages the
correct version of the package to distribute.

Lamar, Oliver, interface maintainers, and others would that be useful?

Kris Jurka
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 22 '05 #15

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

Similar topics

4
5808
by: Chuck Amadi | last post by:
Hi all Anyone know a good Pygresql Tutorial for Interfacing between Python & Postgresql . Cheers Chuck
4
3629
by: Lance Hoffmeyer | last post by:
Hello, I am trying to learn some basics of python. One of the things I want to do is write a script to access a postgresql database DB as user USER with password PW and SELECT first_name, last_name, birthday FROM contacts print to the screen and then disconnect.
2
1947
by: Mage | last post by:
Hello, I started to write my PostgreSQL layer. I tried pyPgSQL and PyGreSQL. I made a *very minimal* performance test and comparsion with the same thing in php. Table "movie" has 129 record and many fields. I found PyGreSQL / DB-API / fetchall horrible slow (32 sec in my test). PHP did 13 secs and it gave the result in associative array. Maybe I did something bad.
1
1867
by: Ram | last post by:
Dear All I am very new to python . i would appreciate any help from you all on this problem which i am facing. I am trying to connect to postgres from python.for this i am using something like " import pgdb". i am able to connect to postgres and fetch data , if i execute the python file directly in unix prompt. However when i try to do thsi through broeser iam getting the following error.. Traceback (most recent call last):
0
1218
by: James Saker | last post by:
Just curious if anyone's aware of a good recipe for setting up SSL access to postgresql for pgdb (or another appropriate db-sig 2 compliant module). Or any good recommendations/considerations e.g. m2crypto with pgdb. jamie
3
1682
by: artistlikeu | last post by:
i have connected database with python program.... this program is simulation using Simpy. i call all simulation data from Postgresql using pgdb. is it possible that i can send some of results by using SQL queries back in the database. if is any hint plz??? regards
3
3205
by: dpholmes | last post by:
hi everyone, i'm very new to python and to this forum. i'm actually just trying to work through the tutorial on webpy.org. so far, so good, but as i tried to incorporate a postgresql database into the demo web app i'm receiving this error print out: Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/web/wsgiserver/__init__.py", line 624, in communicate req.respond() File...
3
2220
by: SteveD | last post by:
Hi guys, http://luaforge.net/frs/?group_id=327 pgdb.zip is an addition to scite-debug, which adds source debugging to the popular SciTE programmer's editor. gdbpy.zip is a standalone version which can be run from Emacs. These allow you to single-step from Python to C code in a debugger session.
1
3142
by: Johannes Bauer | last post by:
Hello group, I've run into a small problem with pgdb which is actually not PostgreSQL specific - I just do not understand the Python syntax at one point. I'm trying to initialize a connection to a PG database. So help(pgdb) says: pgdb.connect(connect_string) -connection connect_string = 'host:database:user:password:opt:tty' All parts are optional. You may also pass host through
0
8674
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
9157
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...
1
8895
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
7728
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
5860
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();...
0
4369
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2330
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2001
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.