Skip to content

Tag: postgresql

How to find pg_config path

Complete newbie here, trying to set up Django to work with PostgreSQL. I’m using mac osx 10.6.8. I have also installed PostgreSQL 9.3 When I run pip install psycopg2 in terminal I get the following error I’ve seen a number of posts on this how-to-install-psycopg2-with-pip-on-python pg-config-execu…

Get psycopg2 count(*) number of results

Whats the correct way to get the number or rows returned by this query? I’m specifically looking to see if no results are returned. Thanks. Answer results is itself a row object, in your case (judging by the claimed print output), a dictionary (you probably configured a dict-like cursor subclass); simpl…

Altering an Enum field using Alembic

How can I add an element to an Enum field in an alembic migration when using a version of PostgreSQL older than 9.1 (which adds the ALTER TYPE for enums)? This SO question explains the direct process, but I’m not quite sure how best to translate that using alembic. This is what I have: The above unfortu…

Install psycopg2 on Ubuntu

I’m trying to get the python postgres client module installed on Ubuntu 12.04. The guidance is to do the following: However, apt says that the package can’t be located. I’m keen to install this through apt. Is this part of another package that I can install? Answer Using Ubuntu 12.04 it appe…