X-Original-To: pgsql-jdbc-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 827439FB730 for ; Thu, 20 Jul 2006 17:46:56 -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 47983-03-5 for ; Thu, 20 Jul 2006 20:46:44 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mir3-fs.mir3.com (mail.mir3.com [65.208.188.100]) by postgresql.org (Postfix) with ESMTP id C593D9FB80B for ; Thu, 20 Jul 2006 17:13:19 -0300 (ADT) Received: mir3-fs.mir3.com 172.16.1.11 from 172.16.2.68 172.16.2.68 via HTTP with MS-WebStorage 6.0.6249 Received: from archimedes.mirlogic.com by mir3-fs.mir3.com; 20 Jul 2006 13:13:11 -0700 Subject: Re: DatabaseMetaData.getTables() is silently quoting table From: Mark Lewis To: Marc Herbert Cc: pgsql-jdbc@postgresql.org In-Reply-To: References: Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: MIR3, Inc. Date: Thu, 20 Jul 2006 13:13:11 -0700 Message-Id: <1153426391.1634.307.camel@archimedes> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-27) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=UNPARSEABLE_RELAY X-Spam-Level: X-Archive-Number: 200607/68 X-Sequence-Number: 15494 This is because PostgreSQL allows the creation of case-sensitive table names. If you run: CREATE TABLE MY_TABLE ...; then the created table name is my_table. But if you run: CREATE TABLE "MY_TABLE" ...; then the created table name is MY_TABLE. So in order for PG to differentiate between my_table and MY_TABLE, the getTables() function has to be case-sensitive. -- Mark On Thu, 2006-07-20 at 18:21 +0200, Marc Herbert wrote: > Hi, > > If I create table MY_TABLE (unquoted uppercase), then my_table > (lowercase) is actually created. This is clearly documented, so fine. > > > > But now if I use .getTables(null, null, "MY_TABLE", null) to ask > whether this table actually exists, the answer is "no" (empty) because > .getTables() acts like I quoted the MY_TABLE identifier. > > It's quite annoying to create a table and not be able to see it... > > Tested with postgresql-server.i686 8.0.7-1PGDG and 8.2dev-503 > Maybe this is a server-side issue? > > > Cheers, > > Marc > > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faq