[postgis-users] shp2pgsql & uppercase tablenames

Vincent Schut schut at sarvision.com
Fri Mar 21 04:28:44 PST 2003


Jeff,

I *do* get errors.

See pasted lines below:

vincent at STROOPWAFEL:~/indo_mof_gis/2000/Aceh> shp2pgsql -d hph.shp 
UppercaseTest indo_mof_gis | psql -d indo_mof_gis
DELETE 0
DROP TABLE
CREATE TABLE
WARNING:  Error occurred while executing PL/pgSQL function addgeometrycolumn
WARNING:  line 38 at execute statement
ERROR:  Relation "UppercaseTest" does not exist
BEGIN
ERROR:  INSERT has more expressions than target columns
ERROR:  current transaction is aborted, queries ignored until end of 
transaction block
... ( continues like this...)

If I specify the compact format (-D switch) I get different errors but 
probably from the same source?
As far as I can understand, everything is being translated to lowercase by 
shp2pgsql, except the attributes of the SELECT AddGeometryColumn call...

It's not very important to me, I can use lowercase names, but it took me quite 
some time to figure out this uppercase name actually was the problem...

If you need more info, mail again.

Regards,
Vincent.

On Thursday 20 March 2003 19:20, Jeff Lounsbury wrote:
> shp2pgsql inserts all tables and column names as lower case because
> Postgresql interprets everything as lower case unles you force it to be
> upper cased by quoting your table name and column names. This is done on
> purpose so that case is not accidentally causing people to become very
> confused about how to reference the table and column names that have upper
> case in them.
>
> Were you having any problems other than all things being lower cased? You
> said you were getting actual errors? Let me know if this is the case...
> -Jeff
> Refractions Research
>
> Vincent Schut wrote:
> > If you try to add some shape to postgres using the shp2pgsql utility, and
> > you specify a tablename that contains uppercase characters, errors occur.
> > Is this a bug or is it a feature? It seems to me that shp2pgsql shows no
> > consistent behaviour regarding uppercase characters in tablenames, but I
> > might be wrong and it might be intended behaviour...
> >
> > Cheers,
> > --
> > ______________________________________
> > Vincent Schut (schut at sarvision.com)
> > Sarvision B.V.
> > Wageningen, The Netherlands
> > www.sarvision.com
> >
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at postgis.refractions.net
> > http://postgis.refractions.net/mailman/listinfo/postgis-users
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users

-- 
______________________________________
Vincent Schut (schut at sarvision.com)
Sarvision B.V.
Wageningen, The Netherlands
www.sarvision.com



More information about the postgis-users mailing list