Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 256B76324CE for ; Thu, 6 Aug 2009 04:36:31 -0300 (ADT) 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 79218-09 for ; Thu, 6 Aug 2009 07:36:16 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from relay.ptn-ipout01.plus.net (relay.ptn-ipout01.plus.net [212.159.7.35]) by mail.postgresql.org (Postfix) with ESMTP id 4C9056327DA for ; Thu, 6 Aug 2009 04:36:20 -0300 (ADT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEADclekrUnw4R/2dsb2JhbADVC4QYBYFM Received: from pih-relay04.plus.net ([212.159.14.17]) by relay.ptn-ipout01.plus.net with ESMTP; 06 Aug 2009 08:36:18 +0100 Received: from [84.51.143.99] (helo=server3.office.archonet.com) by pih-relay04.plus.net with esmtp (Exim) id 1MYxWL-0004B3-V6; Thu, 06 Aug 2009 08:36:18 +0100 Received: from dell36.office.archonet.com (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id A58C9274067; Thu, 6 Aug 2009 08:36:17 +0100 (BST) Message-ID: <4A7A87F1.60904@archonet.com> Date: Thu, 06 Aug 2009 08:36:17 +0100 From: Richard Huxton User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: Klas Stockhem CC: PostgreSQL Subject: Re: Problems when copy data from dump file References: <2A250781A3744D48B1529FCC3C2EB8ABCB483B@comserver.benders.se> In-Reply-To: <2A250781A3744D48B1529FCC3C2EB8ABCB483B@comserver.benders.se> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Plusnet-Relay: c85cc0889d386a9d99bf17d9a739708b X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.611 tagged_above=-10 required=5 tests=AWL=0.989, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/23 X-Sequence-Number: 32932 Klas Stockhem wrote: > Does the php engine interpret the big P like a small one? It's not PHP, but PostgreSQL itself. All names in PostgreSQL are case insensitive unless you double-quote them. PostgreSQL actually translates everything to lower-case internally. CREATE TABLE1 ...; -- gives "table1" CREATE "TABLE2" ...; -- gives "TABLE2" SELECT * FROM table1 -- works SELECT * FROM TABLE1 -- works SELECT * FROM TaBlE1 -- works SELECT * FROM "table1" -- works SELECT * FROM "TABLE1" -- FAILS, actually "table1" SELECT * FROM table2 -- FAILS, looks for "table2" SELECT * FROM TABLE2 -- FAILS, still looking for "table2" SELECT * FROM "TABLE2" -- works So - if you double-quote a table-name (or function or schema name) when you create it, you should always double-quote it when using it. I'm guessing something added double-quotes for you when you created the schema. > Is it recommended to always have small letters in schema names? Personally, I do. I think it looks neater. > How do I make so I not must type the schema name in every sql query? > The best would be if I just can type the table name. There is a variable called "search_path" which controls what schemas are checked for tables, functions etc. If you have two tables with the same name but different schemas you'll need to use the . format though. SET search_path = public2,public; ALTER USER myuser SET search_path = ... ALTER DATABASE mydb SET search_path = ... -- Richard Huxton Archonet Ltd