[postgis-users] shp2pgsql problem

Heitzso heitzso at growthmodels.com
Mon Jun 16 12:58:39 PDT 2003


Paul,

Thanks for responding.

Problem turned out to be one of those ... to simple to talk about ... 
things.

I had setup and run postgis as user 'postgres'.  That created the two
tables used by postgis but the tables were owned by 'postgres'.  Then,
when I tried to load the shapefile into postgis as a user other than 
'postgres'
it bombed because the other user didn't have access rights to the special
postgres tables.  The error messages (or the last umpteen thousand) made
no mention of a permissions problem and when I was looking at the db
by hand inside psql everything seemed fine -- i.e. I queried the table I
had just built but not populated and everything looked fine except for the
missing data rows, was able to delete that table from the db, etc.

The "ah-ah" moment was when I tried to do a select against one of the
special postgis tables and it bounced with a permissions problem.

I don't know if there's an easy way in the shp2pgsql code to catch
the permission problem and stop right then with a clear error message --
just a suggestion.

Thanks,
Heitzso



Paul Ramsey wrote:

> Step 1. Ensure you are using 0.7.5 or better. Alot of loader bugs were 
> fixed in the 0.7.4 -> 0.7.5 transition.
>
> Step 2. Edit your tmp file and remove the transaction blocks. Then try 
> and load the file. Note which record fails to load. Send to us.
>
> P.
>
> Heitzso wrote:
>
>> I have a large shape file with several layers of data
>> for census 2000 block level information for one state.
>> This shape file is smoothly imported by current stable
>> GRASS code.  I can run shp2pgsql against this shape file
>> and generate the sql statements to load the data w/o an
>> error being flagged.
>>    $ shp2pgsql -d blk2000_ga.shp ga_blk gis >h.tmp
>> The shp file is 100M, the dbf file is 160M.
>>
>> But when I attempt to load the script into the postgresql/gis
>> dbms with
>>    psql -f h.tmp gis
>> it breaks with thousands of errors like:
>>    ERROR:  current transaction is aborted,
>>    queries ignored until end of transaction block
>> Afterwards, within psql I '\dt;' and see the new table
>> ga_blk but it is empty (has no rows).
>>
>> Because GRASS imports the data w/o a problem I assume
>> the shape file is in reasonably good shape.
>>
>> Suggestions?
>>
>> Heitzso
>>





More information about the postgis-users mailing list