[postgis-devel] Re: [postgis-users] shp2pgsql and schemas

strk strk at keybit.net
Mon Dec 15 03:25:35 PST 2003


About schemas.
I took a quick look at the AddGeometryColumn procedure.

This procedure does not have an explicit 'schema' argument, but
using a fully qualified table name results in an error since
the parameter "table_name" is quoted using quote_ident.
This means that schema.table is written "schema.table" instead 
of "schema"."table".

If we parse the table string extracting a schema and a table separated
by a dot we could make a better guess, anyway that would still break
any attempt at using a table - or a schema - really containing a dot
in its name (yes, there is such crazy people around).

IMHO we should provide another AddGeometryColumn function taking
one more parameter: the schema. In this way old dump will still use
the no-schema version while new dumps can use the new procedure.
Moreover shp2pgsql could call the new version if it needs a schema
specification (a command line switch ?) or fallback to the old
one if no schema has been requested. In this way newer shp2pgsql
will be still able to generate SQL for old installation (just omit
the -S <schema> or something similar).

Comments welcome.

--strk;



More information about the postgis-devel mailing list