jgvander (2) [Avatar] Offline
Hi all,

I'm just started working with the book, but cannot find instructions on where to load the sample data. I don't know if they are missing or if I'm overlooking something.

I'm trying to load the first set of sample data (on the fast food restaurants, cp. 22) . The book says the indicated path is relative to the server. I tried various locations but none of them seems to be the right one.

"Using the SQL command method, we’d do the following. Note that when we use the
SQL COPY command, the /data/ path references the path on the PostgreSQL server:
COPY ch01.fastfoods FROM '/data/fastfoods.csv' DELIMITER ',';"

The file psql.exe on my (windows) computer is located at: Csmilierogram FilesPostgreSQL9.0inpsql.exe

I have 2 questions:

In which folder should I load the sample data so the literal command in the book would work?

How would I refer to loading the fastfoods.csv file having it in located in:

thanks a lot anybody for help

regina.leo (265) [Avatar] Offline
Re: Where to install the book's sample data?

Is the fastfoods.csv file on your server? Or should I ask is your PostgreSQL server your windows desktop?

If it is then the path would be

COPY ch01.fastfoods FROM 'e:/postgisbook/ch01/data/fastfoods.csv' DELIMITER ',';"

The tricky thing to remember is the PostgreSQL path is always / (not windows ) even if it is a windows PostgreSQL server.

If your postgresql server is on another machine, then you can't use the SQL copy without fiddling with a whole bunch of permssions that would allow the postgres account to see the path.

You would need to use the client copy built into PSQL in that case

/copy ..
the path would still be the same though since the psql path is relative to your computer.
jgvander (2) [Avatar] Offline
Re: Where to install the book's sample data?
Thanks Regina that helped.

I tried your statement but did not use the single quotes.

Writing your book must have been a hard time since your public seems to have widely variable experience in databases. I'm a GIS who want's to move towards open source GIS and database, whose only familiar with databases as a end user.

You're book is welcome, PostGIS seems to be powerful but there isn't that much accessible information. I think the steep learning curves still scare away many people from open source software that is isn't well or documented for non-specialist users.

Thanks a lot for the book and the help,

regina.leo (265) [Avatar] Offline
Re: Where to install the book's sample data?

You are very welcome. Hope you find the rest of your read helpful and don't be afraid to ask questions.