Database Reference
In-Depth Information
$ psql -U me -d postgis_cookbook
postgis_cookbook=> CREATE TABLE
chp01.firenews
(
x float8,
y float8,
place varchar(100),
size float8,
update date,
startdate date,
enddate date,
title varchar(255),
url varchar(255),
the_geom geometry(POINT, 4326)
);
Note
Weareusingthe psql clientforconnectingtoPostgreSQL,butyoucan
use your favorite one, for example, pgAdmin .
Usingthe psql client,wewillnotshowthehostandportoptionsaswe
will assume that you are using a local PostgreSQL installation on the
standard port.
If that is not the case, please provide those options!
3. CopytherecordsfromtheCSVfiletothePostgreSQLtableusingthe COPY
command(ifyouareonWindows,useaninputdirectorysuchas c:\temp
instead of /tmp ) as follows:
postgis_cookbook=> COPY chp01.firenews
(x, y, place, size, update, startdate,
enddate, title, url) FROM '/tmp/
firenews.csv' WITH CSV HEADER;
Search WWH ::




Custom Search