[postgis-users] ogr2ogr S57 question

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Sun Jun 24 10:07:30 PDT 2007


On Sun, 2007-06-24 at 12:34 -0400, Kurt Schwehr wrote:
> Hi All,
> 
> I'm having trouble with a NOAA electronic chart that I am trying to  
> put into postgres without success.  I don't seem to be able to access  
> the tables.
> 
> http://vislab-ccom.unh.edu/~schwehr/ENC/NOAA/US5NH02M.000.bz2
> 
> Here is what I am doing an the error that I am getting... using Mac  
> OSX 10.4.10 with fink
> 
> i   postgis82            1.2.1-1024      PostgreSQL geographic object  
> support
> i   postgresql82         8.2.4-1021      PostgreSQL open-source database
> i   postgresql82-dev     8.2.4-1021      PostgreSQL development  
> headers and libraries
> i   postgresql82-shlibs  8.2.4-1021      PostgreSQL shared libraries
> 
> createdb s57
> sudo -u postgres /sw/bin/psql-8.2 -f /sw/share/doc/postgis82/ 
> lwpostgis.sql -d s57
> ogr2ogr -f PostgreSQL PGL:dbname=s57 US5NH02M.000
> 
> psql -l
>          List of databases
>     Name    |  Owner   | Encoding
> -----------+----------+-----------
> ais       | postgres | SQL_ASCII
> postgres  | postgres | SQL_ASCII
> s57       | schwehr  | SQL_ASCII
> template0 | postgres | SQL_ASCII
> template1 | postgres | SQL_ASCII
> 
> 
> psql s57
> # Paste in the create command from pgadmin
> ERROR:  relation "FAIRWY" already exists
> # Okay... so it looks like it is there until I try to select anything  
> from it...
> s57=# SELECT * FROM FAIRWY;
> ERROR:  relation "fairwy" does not exist
> 
> What am I doing wrong?
> 
> Thanks!
> -kurt

Hi Kurt,

PostgreSQL folds table names to lower case unless they are quoted in
double quotes - what does SELECT * FROM "FAIRWY" give you? Also 
you can get a listing of tables in the database by using \d in psql.


HTH,

Mark.

-- 
ILande - Open Source Consultancy
http://www.ilande.co.uk





More information about the postgis-users mailing list