BEGIN; CREATE EXTENSION IF NOT EXISTS postgis; UPDATE pg_database SET datistemplate = true WHERE datname = 'template_postgis'; COMMIT;