如何初始化postgresql,创建用户gisuser,数据库gis,激活postgis
1个回答
展开全部
postgres=# create user gisuser password '123456';
CREATE ROLE
postgres=# create tablespace tbs_geo owner gisuser location '/tbs_postgisdb';
CREATE TABLESPACE
postgres=# create database postgisdb owner=gisuser tablespace=tbs_geo;
CREATE DATABASE
postgres=# \c postgisdb postgres
You are now connected to database "postgisdb" as user "postgres".
postgisdb=# \i /postgresql/share/contrib/postgis-2.1/postgis.sql
SET
BEGIN
CREATE FUNCTION
.
.
.
CREATE ROLE
postgres=# create tablespace tbs_geo owner gisuser location '/tbs_postgisdb';
CREATE TABLESPACE
postgres=# create database postgisdb owner=gisuser tablespace=tbs_geo;
CREATE DATABASE
postgres=# \c postgisdb postgres
You are now connected to database "postgisdb" as user "postgres".
postgisdb=# \i /postgresql/share/contrib/postgis-2.1/postgis.sql
SET
BEGIN
CREATE FUNCTION
.
.
.
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询