Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id A4C1D9FA491 for ; Sat, 28 Oct 2006 11:39:11 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 04941-02 for ; Sat, 28 Oct 2006 14:39:01 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web31812.mail.mud.yahoo.com (web31812.mail.mud.yahoo.com [68.142.207.75]) by postgresql.org (Postfix) with SMTP id 42CD19F93A2 for ; Sat, 28 Oct 2006 11:39:01 -0300 (ADT) Received: (qmail 20376 invoked by uid 60001); 28 Oct 2006 14:38:59 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=SpeLAeU7dUzdQXsjJcRWRNzWm2q0/Nyulx6wWVh4lYerPQ1Pal38cAy/5VOTT2nsHrCcXi/dcd5mWKUgu91dfddAdX8dc9XDzd9Gf/xO9Gh9SjiWDVMo5zffjwArqhlXZnNSH0NLZ81qoYziyWaQyFXT6sy1wQe9b/9exnwAD2A= ; X-YMail-OSG: YFVsohEVM1m2NAuwUSN.0cz0Rz.qBxMP_dV0vFdCEfU0.QsTeGJOrWiLJdnXJj4SfB3VX00XapHghm5icmIFP.trZw4Vkb8RL12s6kgwWoBQRPRCt5XeVzrTcX33V2J6hEFROOadc_fAC9I- Received: from [24.54.196.198] by web31812.mail.mud.yahoo.com via HTTP; Sat, 28 Oct 2006 07:38:59 PDT Date: Sat, 28 Oct 2006 07:38:59 -0700 (PDT) From: Richard Broersma Jr Subject: Re: Case Preservation disregarding case sensitivity? To: beau hargis , pgsql-sql@postgresql.org In-Reply-To: <200610271623.37525.beauh@bluefrogmobile.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <467277.20359.qm@web31812.mail.mud.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=3.355 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS X-Spam-Level: *** X-Archive-Number: 200610/229 X-Sequence-Number: 26618 > Case was preserved. Now lets add the foreign key just as we did before (note > that the case in the table definition and the ALTER TABLE query is the same): > > ALTER TABLE user_profile ADD CONSTRAINT fk_uproftype FOREIGN KEY > (userProfileTypeId) REFERENCES user_profile_type (userProfileTypeId); > ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ > ERROR: column "userprofiletypeid" referenced in foreign key constraint does > not exist When ever you defince a column with quotes, all references to it must also contain quotes. Try: ALTER TABLE user_profile ADD CONSTRAINT fk_uproftype FOREIGN KEY ("userProfileTypeId") REFERENCES user_profile_type ("userProfileTypeId"); > OK, another query (perfectly valid SQL): > > insert into user_profile_type > (userProfileTypeId,userProfileType) VALUES(1,'ABNORMAL'); > ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ > ERROR: column "userprofiletypeid" of relation "user_profile_type" does not > exist Try: insert into user_profile_type ("userProfileTypeId","userProfileType") VALUES(1,'ABNORMAL'); > > I am hoping that there is an easy way to obtain case-preservation with > case-insensitivity, or at the very least, case-preservation and complete > case-sensitivity, or case-preservation and a consistant case-conversion > strategy. > > Again, I am looking for a way (magic, patches, whiskey, etc) that will give me > case-preservation with EITHER case-sensitivity OR case-insensitivity, but not > both as I am seeing. Perhaps in your queries or views you use the AS keywork to respecify the column name with upper/lower cases. i.e. mydb=# select id as "Id" from foo; Id --------- goodbye (1 row) Regards, Richard Broersma Jr.