PostGIS is a Postgres extension, which needs to be enabled for each database:
Once PostGIS is installed, it needs to be enabled (Section 3.3, “Creating spatial databases”) or upgraded (Section 3.4, “Upgrading spatial databases”) in each individual database you want to use it in.
Run the following SQL snippet in the database you want to enable spatially:
CREATE EXTENSION IF NOT EXISTS plpgsql; CREATE EXTENSION postgis;
Also be aware that the extension is by default installed to the default schema (e.g.
public). So when using the
currentSchema option, be sure to not accidentally exclude the schema postgis was installed into. To prevent this, one could either add the postgis schema to the
jdbc:postgresql://localhost:5432/tst?currentSchema=app1,public), or move postgis to the preferred schema.
CLICK HERE to find out more related problems solutions.