Creating Spatial Database in PostgreSQL
In this tutorial we will use pgAdmin4 because the GUI is easy to understand. To create new database right click on server then click Create > Database
I name this database as poi
Click on sql tools to use query on this database
Type this to enable postgis on the database:
CREATE EXTENSION postgis;
Click run button or just press F5 To check if postgis is enabled you can use this:
SELECT postgis_full_version();
Import Shapefile
You can use this to import shapefile into your database:
export PGPASSWORD=mydatabasepassword
ogr2ogr -f "PostgreSQL" PG:"dbname=poi user=postgres" -nlt PGEOMETRY /path/to/file.shp
You can view the table you just create on Schemas > Public > Tables Right click and view data. You can view your entire table.