Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 5EA7F632EAA for ; Thu, 16 Apr 2009 17:10:16 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 66981-05 for ; Thu, 16 Apr 2009 17:09:58 -0300 (ADT) 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 BFF5E632CE8 for ; Thu, 16 Apr 2009 17:09:58 -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 n3GK9uwu003623; Thu, 16 Apr 2009 16:09:56 -0400 (EDT) To: Gerardo Herzig cc: pgsql-sql@postgresql.org Subject: Re: finding UNIQUES in information_schema In-reply-to: <49E798A3.2020805@fmed.uba.ar> References: <49E787FC.8020909@fmed.uba.ar> <28152.1239909139@sss.pgh.pa.us> <49E798A3.2020805@fmed.uba.ar> Comments: In-reply-to Gerardo Herzig message dated "Thu, 16 Apr 2009 17:44:19 -0300" Date: Thu, 16 Apr 2009 16:09:56 -0400 Message-ID: <3622.1239912596@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.158 tagged_above=0 required=5 tests=AWL=0.158 X-Spam-Level: X-Archive-Number: 200904/98 X-Sequence-Number: 32444 Gerardo Herzig writes: > Tom Lane wrote: >> No, they contain information about constraints, period. How did you >> create those indexes? If you made them via SQL-standard PRIMARY KEY or >> UNIQUE constraint syntax, they should show in the information_schema. >> Otherwise not. > Well, i just dont get it. No, apparently not. The term "constraint" in this context has a very specific meaning; it's talking about the CONSTRAINT syntax in CREATE TABLE or ALTER TABLE. This is per SQL specification. Indexes are an implementation detail that the standard doesn't concern itself with; therefore anything you do with CREATE INDEX is outside the standard and is not reflected in the standard-defined information_schema. regards, tom lane