Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I want to have python3 in my postgresql database for writing stored procedures.

Being in the psql client, when I enter the command create extension plpython3u I get the error:

couldn't open extension control file /usr/share/postgresql/9.1/extension/plpython3u.control : No such file or directory

I have checked, there are plpythonu.control and plpython2u.control in the directory, but not the one for version 3.

However I have installed the packages python3 and python3-postgresql (among others) from depot. I'm using Ubuntu 12.04, kernel 3.2.0.38, with postgresql 9.1 installed.

What should I install (or do) to have the plpython3u.control file on my machine and have python3 available in my database?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

The package to install is postgresql-plpython3.

By way of dependencies, this will install postgresql-plpython3-9.1, which provides these files:

$ dpkg -L postgresql-plpython3-9.1
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/postgresql-plpython3-9.1
/usr/share/doc/postgresql-plpython3-9.1/copyright
/usr/share/postgresql
/usr/share/postgresql/9.1
/usr/share/postgresql/9.1/extension
/usr/share/postgresql/9.1/extension/plpython3u--1.0.sql
/usr/share/postgresql/9.1/extension/plpython3u.control
/usr/share/postgresql/9.1/extension/plpython3u--unpackaged--1.0.sql
/usr/lib
/usr/lib/postgresql
/usr/lib/postgresql/9.1
/usr/lib/postgresql/9.1/lib
/usr/lib/postgresql/9.1/lib/plpython3.so
/usr/share/doc/postgresql-plpython3-9.1/changelog.Debian.gz

and then you can do:

postgres=# create extension plpython3u;
CREATE EXTENSION
share|improve this answer
    
Did you find out the package in which the file was thanks to a special linux command, or did you know it ? –  Stephane Rolland Mar 22 '13 at 0:51
1  
@Stephane: apt-cache search plpython. apt-cache show packagename is useful as well. –  Daniel Vérité Mar 22 '13 at 13:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.