Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id EA8C5632A8A for ; Mon, 16 Nov 2009 01:12:37 -0400 (AST) 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 31275-02-9 for ; Mon, 16 Nov 2009 05:12:25 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from elasmtp-kukur.atl.sa.earthlink.net (elasmtp-kukur.atl.sa.earthlink.net [209.86.89.65]) by mail.postgresql.org (Postfix) with ESMTP id 709D36341A2 for ; Mon, 16 Nov 2009 01:12:24 -0400 (AST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=dk20050327; d=earthlink.net; b=SUw5xGwWKFnU0t7HCgMhz5rz7oEEYfE3wa1Axii7LZ0YDBtTfEcSwG1UDJ31OMGa; h=Message-ID:Date:From:Reply-To:To:Subject:Cc:Mime-Version:Content-Type:Content-Transfer-Encoding:X-Mailer:X-ELNK-Trace:X-Originating-IP; Received: from [209.86.224.52] (helo=mswamui-valley.atl.sa.earthlink.net) by elasmtp-kukur.atl.sa.earthlink.net with esmtpa (Exim 4.67) (envelope-from ) id 1N9tsz-00038c-Kz; Mon, 16 Nov 2009 00:12:21 -0500 Received: from 66.245.20.110 by webmail.earthlink.net with HTTP; Mon, 16 Nov 2009 00:12:21 -0500 Message-ID: <2354695.1258348341643.JavaMail.root@mswamui-valley.atl.sa.earthlink.net> Date: Sun, 15 Nov 2009 21:12:21 -0800 (GMT-08:00) From: ikorot@earthlink.net Reply-To: ikorot@earthlink.net To: Craig Ringer Subject: Re: Table creation Cc: pgsql-odbc@postgresql.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Mailer: EarthLink Zoo Mail 1.0 X-ELNK-Trace: ae972db06a188bef94f5150ab1c16ac0d64a9adbca5b3d7c4ec131a7cf6cb008ea45ff2c1b11f2d7350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 209.86.224.52 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: 200911/12 X-Sequence-Number: 10061 Craig, -----Original Message----- >From: Craig Ringer >Sent: Nov 15, 2009 7:02 PM >To: ikorot@earthlink.net >Cc: pgsql-odbc@postgresql.org >Subject: Re: [ODBC] Table creation > >On 16/11/2009 10:08 AM, ikorot@earthlink.net wrote: >> Hi, ALL, >> I'm new to this list and to PostgreSQL. However, I am >> a C++ developer with some ODBC development experience. >> >> I heard that in PostgreSQL it is possible to create table >> in 2 ways: >> >> CREATE TABLE "Foo" ....; >> >> CREATE TABLE Foo... ; >> >> So, when using unquoted version all query should check for >> the case sensitivity. >> >> Is it possible to check how the table was created to use proper >> query syntax? > >If the unquoted form was used, the table name will have been downcased >by PostgreSQL. It's still case sensitive, just forced to lower case. >Essentially, > > CREATE TABLE Foo ... ; > >is exactly equivalent to: > > CREATE TABLE "foo" ... ; > >in terms of its effects after the CREATE statement has executed. So, if >you expect to have any non-lower-case identifiers (table names, index >names, constraint names, etc) in your database, ALWAYS quote your >identifiers. If they're all lower case, it'll still work. So, if I call both formats, i.e.: CREATE TABLE "foo1"...; CREATE TABLE Foo2....; what will SQLTables() return? Thank you. > >The only problem that'll arise is if your application is told by some >external source to access table "Foo" but doesn't know if the external >source created it as "Foo" or "foo". In that case, you can either query >INFORMATION_SCHEMA with a case-insensitive search to find the table >(which is slow and ugly) or just fix your app to be consistent about >quoting and case. > >-- >Craig Ringer > >-- >Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) >To make changes to your subscription: >http://www.postgresql.org/mailpref/pgsql-odbc