Skip to main content

PostgreSQL bindings for Python w/ bind parameters support

Project description

This is a set of Python bindings for PostgreSQL derived from the PyGreSQL 3.8.1
sources. The main changes from the PyGreSQL module are:

* support for bind parameters, alleviating the need for extensive,
expensive and vulnerable quoting of user-supplied data
* support for server side cursors for looping through large query
results without loading up the entire result set in the client's memory
* returned values are translated to Python objects in the C layer,
resulting in some speed improvement
* DB API 2.0 compliance, with some extensions


PostgreSQL allows for numeric parameters to be passed in a query (bind
parameters). If parameters are used, they are referred to in the query string as
$1, $2, etc. Bind parameters are passed in as a tuple that holds the values
bound in the query. The primary advantage of using bind parameters is that
parameter values may be separated from the command string, thus avoiding the
need for tedious and error-prone quoting and escaping.

Because of the different query syntax between what PostgreSQL natively
supports and what PyGreSQL used to implement (Python style substitutions like %s
and %(name)s), these bindings will not grok SQL queries written for PyGreSQL -
you might need to slightly rework some of your queries to take advantage of the
bind parameter support.

Project details


Release history Release notifications

This version
History Node

0.9.7

History Node

0.9.6

History Node

0.9.5

History Node

0.9.3

History Node

0.9.2

History Node

0.9.1

History Node

0.9.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
python-pgsql-0.9.7.tar.gz (35.4 kB) Copy SHA256 hash SHA256 Source None Feb 11, 2008

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page