Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add python support to already installed postgreSQL? [closed]

I have postgreSQL version 8.3 installed on an ubuntu machine. This was installed via apt get. When I was trying to source a database dump that has some plsql functions written, I got the following error -

could not access file "$libdir/plpython": No such file or directory

When I tried to enable python support for a particular database, I got yet another error -

$ createlang plpythonu <dbname> -U postgres
createlang: language installation failed: ERROR:  could not access file "$libdir/plpython": No such file or directory

Is there a way that I can add support for python without having to reinstall postgreSQL?

like image 999
Sumeet Pareek Avatar asked Aug 25 '10 05:08

Sumeet Pareek


People also ask

How do I connect to PostgreSQL with Python?

How to Connect to PostgreSQL from Python? In order to connect to a PostgreSQL database instance from your Python script, you need to use a database connector library. In Python, you have several options that you can choose from. Some libraries that are written in pure Python include pg8000 and py-postgresql.

What is plpython3u?

If a language is installed into template1 , all subsequently created databases will have the language installed automatically. PL/Python is only available as an “untrusted” language, meaning it does not offer any way of restricting what users can do in it and is therefore named plpython3u .

What is psycopg2 used for?

Psycopg2 is a PostgreSQL database driver, it is used to perform operations on PostgreSQL using python, it is designed for multi-threaded applications. SQL queries are executed with psycopg2 with the help of the execute() method. It is used to Execute a database operation query or command.


2 Answers

sudo apt-get install postgresql-plpython-8.3

or for postgresql 8.4:

sudo apt-get install postgresql-plpython-8.4
like image 199
denis.peplin Avatar answered Sep 20 '22 20:09

denis.peplin


Install postgresql-plpython-8.3?

like image 20
JanC Avatar answered Sep 19 '22 20:09

JanC