Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id AB8D2B5DFA2 for ; Wed, 8 Jun 2011 12:09:43 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 16392-05 for ; Wed, 8 Jun 2011 15:09:36 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id EF99EB5DF8F for ; Wed, 8 Jun 2011 12:09:35 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p58F9SIq009774; Wed, 8 Jun 2011 11:09:28 -0400 (EDT) To: Susanne Ebrecht cc: Ingmar Brouns , pgsql-bugs@postgresql.org, Peter Eisentraut Subject: Re: BUG #5926: information schema dtd_identifier for element_types, columns, parameters views inconsistent In-reply-to: <4DDCE812.10401@2ndQuadrant.com> References: <201103111318.p2BDITcL034900@wwwmaster.postgresql.org> <4DDCE812.10401@2ndQuadrant.com> Comments: In-reply-to Susanne Ebrecht message dated "Wed, 25 May 2011 13:29:22 +0200" Date: Wed, 08 Jun 2011 11:09:27 -0400 Message-ID: <9773.1307545767@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201106/87 X-Sequence-Number: 30466 > On 11.03.2011 14:18, Ingmar Brouns wrote: >> ... The reason seems to be >> that the dtd_identifier of the element_types view has prepended 'a's whereas >> the dtd_identifiers of the columns and parameter views do not: >> >> select column_name,dtd_identifier >> from information_schema.columns c >> where c.table_schema = 'public' >> and c.table_name = 'test_table'; >> >> column_name | dtd_identifier >> -------------+---------------- >> a | 1 >> b | 2 >> c | 3 >> (3 rows) >> >> select dtd_identifier >> from information_schema.element_types e >> where e.object_schema = 'public' >> and e.object_name = 'test_table'; >> >> dtd_identifier >> ---------------- >> a1 >> a3 >> (2 rows) >> >> The element_types view has a column 'collection_type_identifier', this >> column is not present in the documentation. It is defined exactly as the >> dtd_identifier, only then without the prepended 'a': The omission of collection_type_identifier from the docs is clearly a doc bug. However, it looks to me like you've identified an error in the view definition, not only a doc bug. I think the values of the dtd_identifier and collection_type_identifier columns are swapped, ie, we ought to be prepending 'a' to the collection_type_identifier not the dtd_identifier. As far as I can tell from the spec, dtd_identifier ought to be the identifier of the element type, while collection_type_identifier should be a made-up identifier for the array type. That would make the sample query given in the docs correct. If my analysis is correct, we really ought to try to fix this in time for beta2, since there's no way to fix it without a forced initdb. Comments? regards, tom lane