[postgis-devel] Issue 90 in postgis: AddGeometryColumn inappropriately defaults to current_schema() if given nonexistent schema

codesite-noreply at google.com codesite-noreply at google.com
Fri Dec 26 11:41:44 PST 2008


Status: New
Owner: ----

New issue 90 by r... at reidster.net: AddGeometryColumn inappropriately  
defaults to current_schema() if given nonexistent schema
http://code.google.com/p/postgis/issues/detail?id=90

** What steps will reproduce the problem?

Execute the following SQL (assuming schema XXX does not exist):

create temp table foo ( );
select AddGeometryColumn('XXX', 'foo', 'foopoint', 26915, 'POINT', 2);


** Actual behavior:

PostGIS sees that schema "XXX" does not exist, then looks for table "foo"
in schema public, e.g. error message from above:

NOTICE:  Invalid schema name - using current_schema()
CONTEXT:  SQL statement "SELECT AddGeometryColumn('', $1 , $2 , $3 , $4 ,
$5 , $6 )"
PL/pgSQL function "addgeometrycolumn" line 4 at SQL statement
ERROR:  relation "public.foo" does not exist
CONTEXT:  SQL statement "ALTER TABLE public.foo ADD COLUMN foopoint  
geometry "
PL/pgSQL function "addgeometrycolumn" line 86 at execute statement
SQL statement "SELECT AddGeometryColumn('', $1 , $2 , $3 , $4 , $5 , $6 )"
PL/pgSQL function "addgeometrycolumn" line 4 at SQL statement

As an aside, this error message is verbose and confusing; I initially
missed the first line and was rather baffled that PostGIS insisted on
trying "public" when I had clearly asked for "XXX".

** Expected behavior:

PostGIS looks for table in given schema, fails, and gives up with an error,
e.g. desired error message for above:

ERROR:  schema "XXX" does not exist


** What version of the product are you using? On what operating system?

Ubuntu Hardy
PostgreSQL 8.2.7 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.2.3
(Ubuntu 4.2.3-2ubuntu4)
POSTGIS="1.3.3" GEOS="3.0.0-CAPI-1.4.1" PROJ="Rel. 4.6.0, 21 Dec 2007"
USE_STATS





--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings



More information about the postgis-devel mailing list