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
current transaction is aborted, commands ignored until end of transaction blockerror means that the transaction has failed, and it is ignoring subsequent statements. The useful message, at the start of the errors, has been omitted. Please edit the question to show it.CREATE EXTENSIONas the preferred technique, so you probably want to look at that when you can; but it's basically just the old technique with a little bookkeeping to support more graceful management, including upgrades. If you see that the directory for it has a.sqlfile with "unpackaged" as part of the filename, that would be a script to move you from the old technique to the new one usingCREATE EXTENSION.