[postgis-users] AddGeometryColumn doesn't quote column name properly

Bernhard Herzog bh at intevation.de
Wed Nov 12 11:25:15 PST 2003


I'm trying to write some test cases for Thuban's PostGIS support which
specifically test whether Thuban handles unusual table and column names
properly, i.e. names containing spaces or quotes. Unfortunately it's
impossible to create a table with a geometry column that contains spaces
or double quotes because the name is not quoted correctly.

The code of AddGeometryColumn seems to try to deal with this in many
cases by surrounding the table and column name with double quotes but
there's at least one place where this isn't done for the column names,
line 304 in postgis_sql_common.sql.in, rev. 1.19.

Adding the double quotes there as well would probably fix the problem
for names with spaces but would still not work for names with double
quotes. Double quotes also don't work in the table name even though
spaces do. The best solution for all of these problems would be to use
the quote_ident function instead of explicit double quotes.

   Bernhard

-- 
Intevation GmbH                                 http://intevation.de/
Sketch                                 http://sketch.sourceforge.net/
Thuban                                  http://thuban.intevation.org/



More information about the postgis-users mailing list