[postgis-users] NOTICE: type "spheroid" is not yet defined

Markus Schaber schabi at logix-tt.com
Tue Nov 28 06:38:48 PST 2006


Hi, Christian,

Christian.Strobl at dlr.de wrote:

> NOTICE:  type "histogram2d" is not yet defined
> DETAIL:  Creating a shell type definition.

> is that anything i have to get worried about?

Short answer:

No, those messages are expected, and no problem.


Long answer:

First, this messages are "NOTICE"s, their level of importance is way
below WARNING and ERROR.

The reason for this is a hen-and-egg problem:

- For creating a type, you need to specify its input/output functions.

- For creating the input / output functions, you need the type for the
parameter declaration.

To solve this problem, PostgreSQL has the concept of a "shell type",
that means you can use a type name in function declarations before the
type has been specified, allowing you to create the input/output
functions first. (But, of course, you've to fully declare the type
before you can actually use it.) As soon as all input/output functions
exist, you can issue the "CREATE TYPE" declaration to convert the shell
type into a real one.

PostgreSQL 8.2 has an explicit syntax "CREATE TYPE foobar;" to create
such an shell type.

Older releases, however, did not have that special syntax. Instead, they
assume that the input/output functions are written in C. Now, when you
declare a function in C, and use unknown types, PostgreSQL accepts it
and creates the "shell type". But as this can easily lead to introduce
new shell types accidentally by making a typo in the function
definition, PostgreSQL issues this NOTICE.

Btw, language implememtations like pljava which want to allow the user
to implement custom types without resorting to C also suffer from this
problem, as there's no possibility to create a shell type in older
PostgreSQL versions, but abusing a C function, as it is described on:
http://wiki.tada.se/wiki/display/pljava/Creating+a+Scalar+UDT+in+Java

HTH,
Markus
-- 
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in Europe! www.ffii.org
www.nosoftwarepatents.org



More information about the postgis-users mailing list