Q:. | I'm getting a
| ||
A:. | You need to install the BASE package from the eGenix mx Extensions: http://www.egenix.com/files/python/ | ||
Q:. | Inserting data for the SQL IN-operator doesn't seem to work. | ||
A:. | In pyPgSQL 2.3, you can use tuples:
If you want to use ARRAYs, you'll now need to wrap your (nested) lists with PgSQL.PgArray. | ||
Q:. | I get an error like:
| ||
A:. | Using pyPgSQL, you use %s for all parameters, no matter which type they have. | ||
Q:. | I've heard of Unicode support for pyPgSQL. What's the current status? | ||
A:. | It's integrated in pyPgSQL 2.3. | ||
Q:. | Large Object support doesn't work with Python 2.2. What gives? | ||
A:. | It's a Python bug. Please upgrade to Python 2.2.2. | ||
Q:. | Why isn't cursor.rowcount working as expected? | ||
A:. | By default, PgSQL uses PostgreSQL Portals (i.e. cursors). As a result of this, PgSQL doesn't know how many rows resulted from the query until they are fetched. (Note: rowcount will be set to the number of rows returned by the fectchXXX() method. If you fecthone(), rowcount will be 1.) There are a couple of ways to get the number of rows returned by a query:
| ||
Q:. | When building pyPgSQL™, I get an error message like the following: gcc: unrecognized option `-R/usr/lib/' What's up? | ||
A:. | This happens with pre-2.2 versions of Python™'s distutils™, when using the gcc™ compiler. This warning can be safely ignored if your PostgreSQL™ libraries can normally be found by the dynamic loader. Otherwise, you need to work around this problem by putting the PostgreSQL™ library directory into the search path of your dynamic loader. See man 1 ld for details. | ||
Q:. | I've little or no experience using Python for database programming, where can I find additional documentation? | ||
A:. | pyPgSQL™ is an implementation of the Python DB-API 2.0 specification. There's also an article from Andrew Kuchling about using the DB-API. Unfortunately, there doesn't seem to be a lot of beginner-level documentation out there currently. | ||
Q:. | How can I speed up the fetching of data with PgSQL? | ||
A:. | You can use
and
This will increase the performance of fetches by ca. 25 %. There's potential for increasing the performance of fetches in PgSQL by a lot more. This is something that will be looked onto for future releases of pyPgSQL™. |