[postgis-users] Missing template_postgis file
Nicolas Ribot
nicolas.ribot at gmail.com
Sun Aug 14 05:40:23 PDT 2011
On 14 August 2011 09:10, bac at brucecallander.com <bac at brucecallander.com> wrote:
> I have downloaded and installed PostGIS 1.5 on my MacBook Pro running Snow Leopard v10.6.8 (having pre-installed Postgres 9.0, Geo 3, Proj ..)
>
> I am using the Getting Started instructions in Geoserver in order to create a PostGIS table, but I have been unable to create a test database using the template 'template_postgis'. The system can't find the template file. I have searched for the file 'template_postgis' using the Unix 'locate' command but without success.
>
> I have searched the web to see if I can download 'template_postgis' on its own but found nothing.
>
> Grateful for any advice. Please note that I am relatively new to Unix on the Mac so don't assume too much background knowledge.
>
> Bruce Callander
>
Hi Bruce.
"template_postgis" is not a file but a template database generally
created by the Postgis installer to ease the process of creating
Postgis-enabled databases.
You can check if this database exists in your cluster by typing:
psql -l
which gives you the list of all available databases in a Postresql cluster.
If it does not exist, you can create such a template:
createdb template_postgis
createlang plpgsql template_postgis
psql -f /usr/local/pgsql/share/contrib/postgis-1.5/postgis.sql template_postgis
psql -f /usr/local/pgsql/share/contrib/postgis-1.5/spatial_ref_sys.sql
template_postgis
(you may have to adapt paths to postgis files according to your
current installation)
Then you will be able to create new Postgis-enabled databases by using
the template:
createdb -T template_postgis mypostgisdatabase
Nicolas
More information about the postgis-users
mailing list