I have a Postgres database called db_1
and a schema s1
(Using PgAdmin)
postgis
and postgis_topology
.CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS postgis_topology;
under s1
, I can see 18 Types including the geography
, geometry
...etc
search_path
from s1, s2, public
Then I created another schema s2
, but this time s2
has no type
Run my flyway sql on Spring,
Caused by: org.postgresql.util.PSQLException: ERROR: type "geography" does not exist
Turns out it is not about how to install
, but how to connect
I am using Spring to connect to the pgsql, for example, I am connecting to schema s1
and the extension is installed on postgis
.
When I set the connection string to the following, then it works:
?currentSchema=s1,postgis