Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 2E67763290A for ; Mon, 1 Feb 2010 00:42:10 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 63740-04 for ; Mon, 1 Feb 2010 04:41:59 +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 A80FA63249E for ; Mon, 1 Feb 2010 00:41:59 -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 o114fuwH029275; Sun, 31 Jan 2010 23:41:56 -0500 (EST) To: Andreas cc: Joshua Tolley , pgsql-sql@postgresql.org Subject: Re: Howto have a unique restraint on UPPER (textfield) In-reply-to: <4B66583C.1050708@gmx.net> References: <4B64EA46.60605@gmx.net> <4b64f184.9613f30a.5d13.01b2@mx.google.com> <4B65EC9C.6000606@gmx.net> <16294.1264972066@sss.pgh.pa.us> <4B66583C.1050708@gmx.net> Comments: In-reply-to Andreas message dated "Mon, 01 Feb 2010 05:27:40 +0100" Date: Sun, 31 Jan 2010 23:41:56 -0500 Message-ID: <29274.1264999316@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201002/3 X-Sequence-Number: 33602 Andreas writes: > Tom Lane schrieb: >> Well, it is that --- it just doesn't provide access to all the features >> that CREATE INDEX does. >> > So as it is a shortcut for "create index" then why would the function > call of upper not be accepted when the sql parser maps the > uniqe-constraint into the "create index" command? Because the UNIQUE constraint syntax is defined by the SQL standard, and among other things the standard requires all UNIQUE constraints to be represented in the information_schema. But the information_schema views don't have the flexibility to represent anything but simple column values in a unique constraint. So we just expose that in CREATE INDEX, which is outside the standard anyway. regards, tom lane