[postgis-users] shp2pgsql - how to avoid double quotes aroundtable name and column names

cyw at dls.net cyw at dls.net
Thu Sep 4 21:09:50 PDT 2008


Thanks. The problem was that one of my table use a PostgreSQL keyword.


----- Original Message ----- 
From: "Kevin Neufeld" <kneufeld at refractions.net>
To: "PostGIS Users Discussion" <postgis-users at postgis.refractions.net>
Sent: Thursday, September 04, 2008 9:41 PM
Subject: Re: [postgis-users] shp2pgsql - how to avoid double quotes 
aroundtable name and column names


> You should only have to reference your table with double quotes if your 
> table name contains uppercase characters or is a PostgreSQL keyword. In 
> PostgreSQL, this works, so using double quotes is not a problem:
> CREATE TABLE "x"(gid serial);
> SELECT * FROM x;
>
> What is your exact command with shp2pgsql?
> -- Kevin
>
> cyw at dls.net wrote:
>> Hi All,
>>  The shp2pgsql generated sql uses double quotes around table name and 
>> column names, such as:
>>  CREATE TABLE "x" (gid serial PRIMARY KEY, "route" varchar, "jurisdicti" 
>> varchar,....
>>  The effect is that I have to use double quotes in SQLs that access data 
>> in this table later on. For example, I have to use sql like:
>>  select * from "x"
>>  Sql without double quotes, such as below, won't work:
>>     select * from x
>>  Thanks for any help.
>>  cyw
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> 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
> 





More information about the postgis-users mailing list