1

I wrote the following code to psql (Sql Shell)

createdb -T template_postgis nyc;

but does not work because syntax error .

trying to make an example of the links related aim GeoServer. I have postgis 2.0 and postgresql 9.4

http://docs.geoserver.org/stable/en/user/gettingstarted/postgis-quickstart/index.html

asked Sep 8, 2015 at 20:19
6
  • 1
    windows or linux? - windows has a postgres +postgis stack installer bostongis.com/PrinterFriendly.aspx?content_name=postgis_tut01 will always create a template 'template_postgis20' with postgis extension enabled Commented Sep 8, 2015 at 20:24
  • For Windows. What should I do so ? I wrote codes as the following create extension postgis(topology etc) @Mapperz Commented Sep 8, 2015 at 20:29
  • 1
    I use the installers here enterprisedb.com/products-services-training/pgdownload#windows 9.4 when the installer runs select postgis extension and template, you should see the postgis in the Extensions Tree under your created Database. see stackoverflow.com/questions/24981784/… Commented Sep 8, 2015 at 20:31
  • nyc database extension(3) plpgsql,postgis and postgis topology. I can see extensions. I'm learning new so How do I? @Mapperz Commented Sep 8, 2015 at 20:49
  • 1
    The template_postgis is created by the PostGIS installer, I suggest you try to reinstall PostGIS using the installer indicated by @Mapperz. Do you have PgAdminIII? I find that utility invaluable at seeing what's in the database, if so, you should see your template_postgis database (which may have a different name) if you can't see the template there's something broken with the install and there's a more serious problem that is worthy of a new question. Commented Sep 8, 2015 at 22:54

1 Answer 1

1

Why aren't you just using?

CREATE EXTENSION postgis;

It's universal across all platforms for PostGIS 2.0+ unless your distro for some crazy reason did not include raster.

pgAdmin New extension drop down -- in extension section, shows extensions you have available you have not yet installed in your db.

enter image description here

answered Sep 9, 2015 at 2:49
3
  • I can see extension(3) (postgis and postgis topology) but I say new extension name but I cant see postgis and postgis tolopogy why ? so How can I installed my db ? I have pgAdmin 3. @LR1234567 Commented Sep 9, 2015 at 7:02
  • Don't understand the question. Do you see them in the drop down or not? You just have to select the one you want and install. It's just GUI way of doing this from sql window CREATE EXTENSION postgis; Commented Sep 9, 2015 at 7:53
  • or are you talking about the additional extensions I have showing. The address_standardizer_data_us, postgis_sfcgal are new in PostGIS 2.2. -- you can get experimental binaries here - postgis.net/windows_downloads (for windows). that page has them before I are package them in application stackbuilder installers Commented Sep 9, 2015 at 7:56

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.