Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id AD620632A74 for ; Tue, 12 Jan 2010 15:39:37 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 73079-01 for ; Tue, 12 Jan 2010 19:39:27 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sd-17937.dedibox.fr (sd-17937.dedibox.fr [88.191.100.74]) by mail.postgresql.org (Postfix) with ESMTP id 37D5B6329B4 for ; Tue, 12 Jan 2010 15:39:27 -0400 (AST) Received: from [192.168.10.3] (ASte-Genev-Bois-153-1-36-111.w83-200.abo.wanadoo.fr [83.200.26.111]) by sd-17937.dedibox.fr (Postfix) with ESMTPA id C61C03B8F5; Tue, 12 Jan 2010 20:39:24 +0100 (CET) Message-ID: <4B4CCFE9.2010704@lelarge.info> Date: Tue, 12 Jan 2010 20:39:21 +0100 From: Guillaume Lelarge User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: Nadine Mauch CC: pgsql-php@postgresql.org Subject: Re: Capitalized Databases and columns names References: <201001121956.01058.nadine.mauch@laposte.net> In-Reply-To: <201001121956.01058.nadine.mauch@laposte.net> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=3.003 tagged_above=-10 required=5 tests=BAYES_40=-0.185, FH_DATE_PAST_20XX=3.188 X-Spam-Level: *** X-Archive-Number: 201001/2 X-Sequence-Number: 4100 Hi, Le 12/01/2010 19:56, Nadine Mauch a écrit : > [...] > For reasons of lisibility I've created DataBases and > Table Columns with capitalized names. > > To access databases in php code I just use double > cotes as delimiters for names in sql requests. > > I compose on-demand requests with concatened > php strings. The result is for example : > select "TCRtimestp" from "TrcDFCR" where "TCRtimestp"=20060228113419 ; > > Such requests are manageable thru concatenation > but I get problems with functions like > select nextval ('TCRnrordre') ; > where the request becomes select nextval ('trcnrordre') ; > where everything is in lowercase and the result is : > relation tcrnrordre does not exist. > select nextval ('"TCRnrordre"') ; is not possible due > to syntax error. > It works for me. b1=# create sequence "Titi"; CREATE SEQUENCE b1=# select nextval('"Titi"'); nextval --------- 1 (1 ligne) b1=# select nextval('"Titi"'); nextval --------- 2 (1 ligne) Are you sure you gave us the right error message? can you copy and paste it here? > I just don't achieve nor in php nor in psql to get the > next value because of this capitalize problem. > Does someone know if there is a solution or if > I have to use only lowercase caracters ? > You should better use lowercase for PostgreSQL objects, but your issue is not related to this. Regards. -- Guillaume. http://www.postgresql.fr http://dalibo.com