mac pgsql 使う
.bash_profileの編集
ツールへのパスを通す
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/latest/bin
db作成
CentOSにPostgreSQL/PostGISの環境構築 | JURI★GIS
created test psql -d test test=# create extension Postgis; CREATE EXTENSION test=# select postgis_full_version(); postgis_full_version -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- POSTGIS="2.2.2 r14797" GEOS="3.5.0-CAPI-1.9.0 r4084" PROJ="Rel. 4.9.2, 08 September 2015" GDAL="GDAL 1.11.5, released 2016/07/01" LIBXML="2.9.4" LIBJSON="0.12.1" RASTER (1 row) ¥q
ファイルに用意したSQLの実行
test=# ¥i test.sql
create table
create table hoge( id int8 primary key, address varchar(200), geom geometry(point, 4326) );