Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 273FE632957 for ; Thu, 2 Sep 2010 16:12:24 -0300 (ADT) 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 15437-09 for ; Thu, 2 Sep 2010 19:12:16 +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 AAF236325EB for ; Thu, 2 Sep 2010 16:12:16 -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 o82JCAZx006463; Thu, 2 Sep 2010 15:12:10 -0400 (EDT) To: Fabien COELHO cc: Peter Eisentraut , PostgreSQL Bugs List Subject: Re: issue about information_schema REFERENTIAL_CONSTRAINTS In-reply-to: References: <2683.1283266019@sss.pgh.pa.us> <1283369900.15386.0.camel@vanquo.pezone.net> <1283438419.23199.0.camel@vanquo.pezone.net> Comments: In-reply-to Fabien COELHO message dated "Thu, 02 Sep 2010 20:34:46 +0200" Date: Thu, 02 Sep 2010 15:12:10 -0400 Message-ID: <6462.1283454730@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: 201009/18 X-Sequence-Number: 27982 Fabien COELHO writes: > (1) use the OID as the "constraint name" everywhere, it would work, it > would not look so good for display, but it is simple and fast. > (2) otherwise something built on top of . To be on the > safe side, I would build a string (sql_identifier?) with something like: > quote_ident() || '.' || quote_ident() Note that (2) fails for long names; you have to do something to compress to NAMEDATALEN. The big problem with either of these is that it's no longer easily possible to extract the actual constraint name from the view. In any case, I am fairly sure that not having the constraint_name column show the actual constraint name is a violation of the spirit of the SQL spec, whether or not you can claim that it meets the letter. regards, tom lane