473,795 Members | 3,122 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Pygresql classic vs DB-API interface

I am relatively new to python and am developing an application using
mod_python/pygresql/postgresql.

Being attracted to the idea of database portability, I started out using
the DB-API 2.0 compliant pgdb module. However, I am finding it to be
pretty clunky compared to the classic pg interface.
It just doesn't seem "pythonic" to me. Chief among my concerns is the
way it won't return results as a dictionary, so I have to address the
data using cryptic numeric indeces. To be fair, the 3rd party dtuple
module lets me use dictionaries, but it still seems a bit clunky. Also,
insertion into a table seems unnecessarily ugly. With the classic
interface, I just pass a tablename and a dictionary and let the
interface deal with it. With pgdb, if I want to do something like that
I've got to write my own code to do it. Or does DB-API and pyformat
allow me to do this in a more elegant way of which I am unaware?

I still like the portability of pgdb though. So, does anyone have any
recommendations ? Perhaps a module that does for inserts and updates
kind of what dtuple does for selects?

Thank you for any guidance.

Steve Bergman
Sep 19 '05 #1
0 979

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

Similar topics

1
2291
by: trewornan | last post by:
I'm trying to install pygresql on mandrake 9.1 but when I try "python setup.py build" I get the error - "cannot find /usr/lib/python2.2/config/makefile" I don't have this makefile - is it because I didn't build python myself (added at installation). I'd rather not have to try to root out the python installation, then build and install again. Is there an alternative?
1
1937
by: Radu Stanciu | last post by:
Hi, I want to use the PygreSQL modules on a Windows machine (more exactly a WinXP one). I've downloaded the latest version (3.4 so far) and I am required to build the pgmodule C library. Is there a way to avoid this? I need to install this on many user systems and it would be very hard to do. Is there a compiled package available for this? Or an easier way to install this package?
4
5814
by: Chuck Amadi | last post by:
Hi all Anyone know a good Pygresql Tutorial for Interfacing between Python & Postgresql . Cheers Chuck
2
2784
by: Neil Zanella | last post by:
Hello, I am using the following with python: The PyQt python bindings: http://www.riverbankcomputing.co.uk/pyqt/ based on the Qt GUI Application Framework:
3
2155
by: bill | last post by:
I need to open a asp.net web form from a classic asp page, and pass a username and password to the asp.net page. The username and password exist as session variables in the classic asp application. I can't put the password in the classic asp page form as a hidden field and submit it, because someone can view source and see the password. This is a security problem I encounter in a mixed classic asp and asp.net environment. I don't...
1
2531
by: Jan Danielsson | last post by:
Hello all, I'm trying to use pygresql to insert binary data (type: bytea) into a column (using postgresql, obviously). To make a long story short: I can't get it to work. Not even by cutting and pasting the very few examples I have found on the 'net. Does _anyone_ have a working example? A simple insertion, and a simple select is all I'm looking for.
3
1547
by: Keen Anthony | last post by:
Hello, I am currently using psycopg 2 as my db adapter for a mod_python & PostgreSQL web app. It's works fine, and I haven't any complaints. I would appreciate some input on what other pythonistas like in an adapter. There were several different options available to me, but there was no particular informed reason for me to choose psycopg. Am I missing anything? ~ Anthony
0
1667
by: h112211 | last post by:
Hi all, I'm using the Windows version of Python 2.4.3 and everything worked okay until I installed PyGreSQL. Well, in fact the installation went fine, but when I try to run my script from IDLE I get: Traceback (most recent call last): File "<pathtomyscript>\main.py", line 3, in -toplevel- import pgdb File "C:\Program Files\Python24\Lib\site-packages\pgdb.py", line 69,
2
2594
by: goodepic | last post by:
I successfully installed postgresql and pygresql from source on my MacBook 2ghz Intel core duo running os x 10.4.8. However, pygresql installed under the defualt python 2.3 installation, while I've been upgrading and working in 2.5, and have invested too much time to go back to 2.3. I definitely don't know where every file is, but I know that the site-packages folder where I need pgdb to be is...
0
864
by: D'Arcy J.M. Cain | last post by:
On Mon, 19 May 2008 18:00:30 +0200 <ervin.ramonllari@hotmail.comwrote: I assume that you got the installer from http://www.PyGreSQL.org/. If so, please join the PyGreSQL list (see above URL) and explain the problem there. It's my module but I don't create the Windows package. Others on that list can probably help you better or create a fixed installer if that is the problem.
0
9672
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
9519
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
10439
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
10215
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...
0
10001
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9043
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...
1
7541
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6783
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
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.