Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 368C51337B3E for ; Sun, 20 Feb 2011 11:35:42 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 45999-03 for ; Sun, 20 Feb 2011 15:35:34 +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 F3EFF1337B5E for ; Sun, 20 Feb 2011 11:35:33 -0400 (AST) 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 p1KFZSJt028933; Sun, 20 Feb 2011 10:35:28 -0500 (EST) To: Fabien COELHO cc: Bruce Momjian , Peter Eisentraut , Alvaro Herrera , pgsql-docs@postgresql.org Subject: Re: [BUGS] issue about information_schema REFERENTIAL_CONSTRAINTS In-reply-to: References: <201102200011.p1K0B1l06164@momjian.us> Comments: In-reply-to Fabien COELHO message dated "Sun, 20 Feb 2011 08:48:21 +0100" Date: Sun, 20 Feb 2011 10:35:27 -0500 Message-ID: <28932.1298216127@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: 201102/66 X-Sequence-Number: 6414 Fabien COELHO writes: > This issue makes the "information_schema" pretty useless for being really > use for serious work as the data can be ambiguous, so I still claim that > for me this is a real "bug" rather than just a "feature", which is the > status reached once a bug is documented:-) > When constraint names are generated by postgresql, ISTM that the software > is free to choose them so they could be chosen non ambiguous per schema. We do that already. See ChooseConstraintName and ChooseRelationName. > When users choose colliding names, I agree that it would break existing > schemas, but there could be an option to enforce uniqueness of the name > per schema if desired. What would be the point of that? IIRC, your complaint about this was in connection with wanting to write some information-schema-using code that could be used by anybody. Such code could hardly assume that the option was set. Basically, the only way to satisfy your request is to take freedom away from our users, and we're unlikely to do that. regards, tom lane