None of the threads in stack exchange related to this error helped me to resolve this issue. Hence I am posting it.
I have installed postgres 9.3 and PostGIS 2.1 Now I have done the following
su postgrescreateuser -U postgres giscreatedb -U postgres -E UTF8 -O gis giscreatelang -U postgres plpgsql gispsql -U postgres -d gis -f /usr/pgsql-9.3/share/contrib/postgis-2.1/postgis.sqlpsql -U postgres -d gis -f /usr/pgsql-9.3/share/contrib/postgis-2.1/spatial_ref_sys.sqlNow when I try to create extension for postgis with the following
psql --username=postgres --dbname=gis -c "CREATE EXTENSION postgis;"I get this:
ERROR: PostGIS is already installed in schema 'public', uninstall it firstgis=# \dt List of relations Schema | Name | Type | Owner--------+-----------------+-------+---------- public | spatial_ref_sys | table | postgres(1 row)gis=#This is the table
I tried altering the db with search path as well but no luck ALTER DATABASE gis SET search_path = postgis;
This is the list of my dbs
gis=# \l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges-----------+----------+----------+-------------+-------------+----------------------- gis | gis | UTF8 | en_US.UTF-8 | en_US.UTF-8 | postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + | | | | | postgres=CTc/postgres template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + | | | | | postgres=CTc/postgres(4 rows)gis=#Any help will be appreciated
أكثر...
I have installed postgres 9.3 and PostGIS 2.1 Now I have done the following
su postgrescreateuser -U postgres giscreatedb -U postgres -E UTF8 -O gis giscreatelang -U postgres plpgsql gispsql -U postgres -d gis -f /usr/pgsql-9.3/share/contrib/postgis-2.1/postgis.sqlpsql -U postgres -d gis -f /usr/pgsql-9.3/share/contrib/postgis-2.1/spatial_ref_sys.sqlNow when I try to create extension for postgis with the following
psql --username=postgres --dbname=gis -c "CREATE EXTENSION postgis;"I get this:
ERROR: PostGIS is already installed in schema 'public', uninstall it firstgis=# \dt List of relations Schema | Name | Type | Owner--------+-----------------+-------+---------- public | spatial_ref_sys | table | postgres(1 row)gis=#This is the table
I tried altering the db with search path as well but no luck ALTER DATABASE gis SET search_path = postgis;
This is the list of my dbs
gis=# \l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges-----------+----------+----------+-------------+-------------+----------------------- gis | gis | UTF8 | en_US.UTF-8 | en_US.UTF-8 | postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + | | | | | postgres=CTc/postgres template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + | | | | | postgres=CTc/postgres(4 rows)gis=#Any help will be appreciated
أكثر...