打開psql(用開始菜單中搜索即可搜到,或者進入pgAdmin的插件菜單下的psql console)
進入數據庫后,使用下列語句創建數據庫(此時還是普通數據庫)
create database xx;
轉到你新建的xx數據庫中:
\c xx;
然后輸入官網給的這幾條添加擴展語句(官網可找到):
-- Enable PostGIS (includes raster)
CREATE EXTENSION postgis;
-- Enable Topology
CREATE EXTENSION postgis_topology;
-- Enable PostGIS Advanced 3D
-- and other geoprocessing algorithms
-- sfcgal not available with all distributions
CREATE EXTENSION postgis_sfcgal;
-- fuzzy matching needed for Tiger
CREATE EXTENSION fuzzystrmatch;
-- rule based standardizer
CREATE EXTENSION address_standardizer;
-- example rule data set
CREATE EXTENSION address_standardizer_data_us;
-- Enable US Tiger Geocoder
CREATE EXTENSION postgis_tiger_geocoder;
進行對比可看出,我創建的mygis(空間數據庫)比普通數據庫多了5個擴展,3個架構