2

I'm using ubuntu 12.04, I have postgis2.1 installed and postgresql9.1... and I'm a newbie for all!... I follow this tuto to create a template database: http://linfiniti.com/2012/05/installing-postgis-2-0-on-ubuntu/ and I'm stuck and don't know what to do now...

When I try to execute the following command:

psql -d template_postgis2 -f /usr/share/postgresql/9.1/contrib/postgis-2.0/postgis.sql

I have the following errors (I copy paste only the end since it is the same mistake for different line numbers):

psql:/usr/share/postgresql/9.1/contrib/postgis-2.1/postgis.sql:6050: ERROR:  current transaction is aborted, commands ignored until end of transaction block
psql:/usr/share/postgresql/9.1/contrib/postgis-2.1/postgis.sql:6056: ERROR:  current transaction is aborted, commands ignored until end of transaction block
ROLLBACK

I've noticed that each error is linked to a command starting by "LANGUAGE...." in the script postgis.sql that I execute I have seen on the internet that this kind of error can be due to plpgsql which is not installed but it is not my case since when I type:

createlang -d template_postgis2 plpgsql

(as was given in the tuto) the machine returns

createlang: language "plpgsql" is already installed in database "template_postgis2"

Does anyone has an idea on what's going on?? and/or what I should do? maybe since I'm using postgis2.1 and not 2.0, as in the tutorial linfinity.com, it messes things up?

EDIT: the beginning of the error message is the following:

$ psql -d template_postgis2 -f /usr/share/postgresql/9.1/contrib/postgis-2.1/postgis.sql
SET
BEGIN
psql:/usr/share/postgresql/9.1/contrib/postgis-2.1/postgis.sql:47: ERROR:  permission denied for language c
psql:/usr/share/postgresql/9.1/contrib/postgis-2.1/postgis.sql:52: ERROR:  current transaction is aborted, commands ignored until end of transaction block
4

2 に答える 2

3

Postgres 9.1 で空間データベースを作成する新しい方法があります。

psql -d template_postgis2 -c "CREATE EXTENSION postgis;"
于 2012-09-17T09:40:36.173 に答える
0

いくつかのフォーラムで見つけたばかりです:

sudo ldconfig

更新:公式ドキュメントでこの推奨事項を見つけました:

Linux プラットフォームでは、各ライブラリのインストール後に ldconfig コマンドを実行する必要がある場合があります。

postgis テンプレートからデータベースを作成する際に発生する可能性のある postres エラーを修正しました。

于 2013-08-06T20:57:34.997 に答える