Interesting,
I just happened to read some code or docs which explains this. Every
table when created also creates an entry in pg_type. Postgres supports
inheritance, so every table is a type.
Dave
On Thu, 2003-10-09 at 04:40, Roger Bjärevall wrote:
> Hi,
>
> We are currently testing the upcoming version of DbVisualizer with
> PostgreSQL and the JDBC drivers.
>
> We have one concern and that is the information returned from the
> DatabaseMetaData.getTypeInfo() method.
>
> It returns a lots of information, some are data type info while some
> are tables or functions(?).
>
> We did a quick comparision of the supported data types as listed in the
> PostgreSQL documenation and what is returned by the getTypeInfo call.
> The result is rather confusing for us.
>
> (http://www.postgresql.org/docs/7.3/static/datatype.html)
>
> - Among the real data types we find types such as:
>
> TYPE_NAME DATA_TYPE PRECISION
> pg_cast 1111 9
> pg_class 1111 9
> pg_constraint 1111 9
> pg_conversion 1111 9
> pg_database 1111 9
>
> What is this and why do they appear when getting type info?
>
> - The documentation lists data types as "Type Name" and "Aliases".
> Why do the getTypeInfo() call return the aliased name for almost
> all data types that have an alias instead of the in most cases
> preferred "Type Name"?
> I.e we believe that users coming from other databases would prefeer
> "bigint" rather then "int8", "smallint" rathern then "int2", etc.
> There are some exceptions to this such as the "varchar" alias which
> is more common then "character varying".
>
> One solution is simply to add the real type names to the existing list
> of data types as returned by the getTypeInfo() call.
>
> Any feedback is appreciated.
>
> Roger Bjärevall
> Minq Software
>
>
>
>
>
>