X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1361A329F96 for ; Tue, 12 Oct 2004 15:50:58 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 40483-10 for ; Tue, 12 Oct 2004 14:50:47 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id C81D9329F92 for ; Tue, 12 Oct 2004 15:50:50 +0100 (BST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id i9CEoiwt002293; Tue, 12 Oct 2004 10:50:44 -0400 (EDT) To: alwin Cc: pgsql-admin@postgresql.org Subject: Re: case insensitive table names In-reply-to: <6.1.2.0.0.20041012155623.025459c8@localhost> References: <6.1.2.0.0.20041012155623.025459c8@localhost> Comments: In-reply-to alwin message dated "Tue, 12 Oct 2004 16:18:01 +0200" Date: Tue, 12 Oct 2004 10:50:44 -0400 Message-ID: <2292.1097592644@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/167 X-Sequence-Number: 15160 alwin writes: > So far so good. But the current code uses queries without quotes, like > select * from Table; and not select * from "Table";. You have a problem :-( > Is there an easier fix for this? Does the SQL92/SQL3/SQL2003 specify > unquoted table names to be case-insensitive or does it say it needs to > be converted to lowercase? The SQL spec is absolutely clear that the above code is wrong. What the spec actually says is that unquoted names should be forced to all upper case (so Table is equivalent to "TABLE"). Postgres forces them to lower case (so Table is equivalent to "table") which is not quite the same but has the same effect that unquoted names are not case sensitive. But under both the exact spec rules and our rules, a mixed-case quoted name is never equivalent to any unquoted name. There is no such thing as case insensitivity for quoted names. regards, tom lane