Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 61DFA1336B42 for ; Wed, 1 Dec 2010 10:29:26 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 44581-03 for ; Wed, 1 Dec 2010 14:29:20 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from newserver.jfcomputer.com (unknown [76.14.161.106]) by mail.postgresql.org (Postfix) with ESMTP id B20D01335B36 for ; Wed, 1 Dec 2010 10:29:18 -0400 (AST) Received: from localhost (unknown [127.0.0.1]) by newserver.jfcomputer.com (Postfix) with ESMTP id 25D0912203 for ; Wed, 1 Dec 2010 02:28:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at site Received: from newserver.jfcomputer.com ([127.0.0.1]) by localhost (linux-jfp8.site [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7Mxvzp+5Leps for ; Tue, 30 Nov 2010 18:28:00 -0800 (PST) Received: from linux-desktop.localnet (unknown [76.14.161.106]) by newserver.jfcomputer.com (Postfix) with ESMTP id 834E0121D3 for ; Tue, 30 Nov 2010 18:28:00 -0800 (PST) From: John Fabiani Organization: J.F. Computer Solutions To: pgsql-sql@postgresql.org Subject: Re: OT - load a shp file Date: Wed, 1 Dec 2010 06:29:10 -0800 User-Agent: KMail/1.13.5 (Linux/2.6.34.7-0.5-desktop; KDE/4.4.4; i686; ; ) References: <201011302206.58515.johnf@jfcomputer.com> <4CF611D0.9030505@gmail.com> In-Reply-To: <4CF611D0.9030505@gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Message-Id: <201012010629.10542.johnf@jfcomputer.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.107 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RDNS_NONE=0.793 X-Spam-Level: X-Archive-Number: 201012/6 X-Sequence-Number: 34842 On Wednesday, December 01, 2010 01:13:52 am Lee Hachadoorian wrote: > John, >=20 > Would probably be useful to see the results of the command, but a couple > of things are immediately obvious. >=20 > First, Postgres requires identifiers to start with a letter or > underscore. You are attempting to create a table named 2008_us_county, > which is not a legal identifier. Also, unless you want this in the > public schema, make sure to use the schema-qualified table name. >=20 > Second, the docs specify that the shapefile be passed in without the > .shp extension. >=20 > Third, since you're not specifying the database explicitly, make sure > that the default makes sense (psql assumes a default of your user name > or reads it from the PGDATABASE environment variable). The examples in > the shp2pgsql docs all explicitly specify a target database with, e.g. > =85 | psql -d my_db >=20 > If you fix all of this and it still isn't working, I would direct the > output to a file, look at it to make sure it makes sense, then try to > pass the file to psql. >=20 > If you would prefer, there are also a couple of GUIs that can control > shp2pgsql. I've had success with the SPIT (Shapefile to PostGIS Import > Tool) plugin for Quantum GIS (http://qgis.org/). For Windows only you > can use the Shp2PgSQL Graphical Loader (a plugin for pgAdmin III) > available at http://postgis.refractions.net/download/windows/. >=20 > Finally, a better list for PostGIS support is > postgis-users@postgis.refractions.net. >=20 > --Lee >=20 > On 12/01/2010 01:06 AM, John Fabiani wrote: > > Hi, > > How do I load a Census shp file into an exist database? I believe I ha= ve > > postGIS install and now I want to load the US counties shp file. > >=20 > > the following does not appear to work > > shp2pgsql -s 4269 -I -W latin1 tl_2008_us_county.shp 2008_us_county | > > psql > >=20 > > Plus I don't know what it does! > >=20 > > Johnf thanks for the help. Your response already has taught me a few things and = I=20 haven't even tried to fix the issues. Johnf