[maplab-users] Re : problem with postgis layer (Alberto Cavalli)
Gilles
si.geo at free.fr
Thu Sep 2 04:02:40 EDT 2004
Hi,
I think, Alberto, you are not connecting to the right database -
template1 -.
You should create a database name MY_DATABASE ex :
createdb MY_DATABASE
createlang plpgsql MY_DATABASE
psql -d MY_DATABASE -f path_to\postgis.sql
psql -d MY_DATABASE -f path_to\spatial_ref_sys.sql
Then you use shp2pgsql :
shp2pgsql -D path_to\my_shape.shp MY_DESTINATION_TABLE MY_DATABASE |
psql -U postgres MY_DATABASE
If you don't want to have problem with the password of postgres, you can
change in *pg_hba.conf* the way the user postgres is connecting to the
database : change *md5* in *trust*.
And don't forget to change this value when you finished your transactions.
In order to see your data with MapServer edit the *CONNECTION* section
of your map :
CONNECTION "user=postgres password=admin dbname=MY_DATABASE host=localhost"
I hope this can help you.
Gilles
More information about the Maplab-users
mailing list