Thanks. I have updated the documentation with the attached patch, and
backpatched it to 8.2.X.
---------------------------------------------------------------------------
Kirill Simonov wrote:
>
> The following bug has been logged online:
>
> Bug reference: 2942
> Logged by: Kirill Simonov
> Email address: xi@gamma.dn.ua
> PostgreSQL version: 8.2
> Operating system: Linux
> Description: information_schema.element_types: documentation error
> Details:
>
> The page
> http://www.postgresql.org/docs/8.2/interactive/infoschema-element-types.html
>
> contains obsolete information.
>
> The example query
> SELECT c.column_name, c.data_type, e.data_type AS element_type
> FROM information_schema.columns c LEFT JOIN information_schema.element_types
> e
> ON ((c.table_catalog, c.table_schema, c.table_name, 'TABLE',
> c.dtd_identifier)
> = (e.object_catalog, e.object_schema, e.object_name, e.object_type,
> e.array_type_identifier))
> WHERE c.table_schema = '...' AND c.table_name = '...'
> ORDER BY c.ordinal_position;
> fails with ERROR: column e.array_type_identifier does not exist.
>
> The fix is to replace 'e.array_type_identifier' with e'dtd_identifier'.
>
> The column array_type_identifier described in the Table 32-17 does not
> exists.
>
> The column dtd_identifier, which is described as "This is currently not
> useful.", should have he description of the former array_type_identifier
> column.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
Index: doc/src/sgml/information_schema.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/information_schema.sgml,v
retrieving revision 1.31
diff -c -c -r1.31 information_schema.sgml
*** doc/src/sgml/information_schema.sgml 1 Feb 2007 00:28:17 -0000 1.31
--- doc/src/sgml/information_schema.sgml 20 Feb 2007 18:39:34 -0000
***************
*** 1876,1882 ****
SELECT c.column_name, c.data_type, e.data_type AS element_type
FROM information_schema.columns c LEFT JOIN information_schema.element_types e
ON ((c.table_catalog, c.table_schema, c.table_name, 'TABLE', c.dtd_identifier)
! = (e.object_catalog, e.object_schema, e.object_name, e.object_type, e.array_type_identifier))
WHERE c.table_schema = '...' AND c.table_name = '...'
ORDER BY c.ordinal_position;
</programlisting>
--- 1876,1882 ----
SELECT c.column_name, c.data_type, e.data_type AS element_type
FROM information_schema.columns c LEFT JOIN information_schema.element_types e
ON ((c.table_catalog, c.table_schema, c.table_name, 'TABLE', c.dtd_identifier)
! = (e.object_catalog, e.object_schema, e.object_name, e.object_type, e.dtd_identifier))
WHERE c.table_schema = '...' AND c.table_name = '...'
ORDER BY c.ordinal_position;
</programlisting>
***************
*** 1936,1948 ****
</row>
<row>
! <entry><literal>array_type_identifier</literal></entry>
<entry><type>sql_identifier</type></entry>
<entry>
The identifier of the data type descriptor of the array being
! described. Use this to join with the
! <literal>dtd_identifier</literal> columns of other information
! schema views.
</entry>
</row>
--- 1936,1946 ----
</row>
<row>
! <entry><literal>dtd_identifier</literal></entry>
<entry><type>sql_identifier</type></entry>
<entry>
The identifier of the data type descriptor of the array being
! described
</entry>
</row>
***************
*** 2097,2109 ****
<entry>Always null, because arrays always have unlimited maximum cardinality in
<productname>PostgreSQL</></entry>
</row>
- <row>
- <entry><literal>dtd_identifier</literal></entry>
- <entry><type>sql_identifier</type></entry>
- <entry>
- An identifier of the data type descriptor of the element. This
- is currently not useful.
- </entry>
</row>
</tbody>
</tgroup>
--- 2095,2100 ----