Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 9C93EB5DC44 for ; Mon, 17 Oct 2011 10:44:26 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 49720-05 for ; Mon, 17 Oct 2011 13:44:19 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mail.cybertec.at (mail.cybertec.at [87.118.110.48]) by mail.postgresql.org (Postfix) with ESMTP id 9EA68B5DBE1 for ; Mon, 17 Oct 2011 10:44:19 -0300 (ADT) Received: from localhost.localdomain (host-87-242-22-111.prtelecom.hu [87.242.22.111]) by mail.cybertec.at (Postfix) with ESMTP id 1D2145FC362 for ; Mon, 17 Oct 2011 15:22:56 +0200 (CEST) Message-ID: <4E9C3132.5060703@cybertec.at> Date: Mon, 17 Oct 2011 15:44:18 +0200 From: Boszormenyi Zoltan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1 MIME-Version: 1.0 To: pgsql-bugs@postgresql.org Subject: Re: char(0) References: <4E9BD9E2.2010305@2ndQuadrant.com> <4E9C1F5E.7000303@2ndQuadrant.com> In-Reply-To: <4E9C1F5E.7000303@2ndQuadrant.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201110/137 X-Sequence-Number: 31407 2011-10-17 14:28 keltezéssel, Susanne Ebrecht írta: > On 17.10.2011 10:30, Simon Riggs wrote: >> On Mon, Oct 17, 2011 at 8:31 AM, Susanne Ebrecht >> wrote: >> >>> PostgreSQL isn't supporting CHAR(0). >> What does the SQL Standard say? >> > > Document: 02-Foundation > > Section: 4.2.1 Introduction to character strings > > Begin quoting > A character string is a sequence of characters. All the characters in a character string > are taken from a single > character set. A character string has a length, which is the number of characters in the > sequence. The length is > 0 (zero) or a positive integer. > End quoting I am looking at 6WD2_02_Foundation_2007-12.pdf. Search for "" that is used in section "6.1 ": := [ ] Section 6.1 doesn't talk about limiting the definition to > 0 values But in page 157, section "5.3 ": ============================================================ 17) The declared type of a is fixed-length character string. The length of a is the number of s that it contains. Each contained in represents a single in both the value and the length of the . The two s contained in a shall not be separated by any . NOTE 92 — s are allowed to be zero-length strings (i.e., to contain no characters) even though it is not permitted to declare a that is CHARACTER with 0 (zero). ============================================================ So, a table column is not allowed to be char(0) or varchar(0). It's explicit in NOTE 92. Best regards, Zoltán Böszörményi -- ---------------------------------- Zoltán Böszörményi Cybertec Schönig& Schönig GmbH Gröhrmühlgasse 26 A-2700 Wiener Neustadt, Austria Web: http://www.postgresql-support.de http://www.postgresql.at/