Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 786A4B5DC4B for ; Mon, 17 Oct 2011 10:57:29 -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 54065-03 for ; Mon, 17 Oct 2011 13:57:23 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from outmail148104.authsmtp.com (outmail148104.authsmtp.com [62.13.148.104]) by mail.postgresql.org (Postfix) with ESMTP id 0D03CB5DC44 for ; Mon, 17 Oct 2011 10:57:22 -0300 (ADT) Received: from mail-c194.authsmtp.com (mail-c194.authsmtp.com [62.13.128.121]) by punt9.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id p9HDvLqO097261; Mon, 17 Oct 2011 14:57:21 +0100 (BST) Received: from [192.168.23.4] (212.100.42.202.fixip.bitel.net [212.100.42.202]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2) with ESMTP id p9HDvL3A014910; Mon, 17 Oct 2011 14:57:21 +0100 (BST) Message-ID: <4E9C3440.8090703@2ndQuadrant.com> Date: Mon, 17 Oct 2011 15:57:20 +0200 From: Susanne Ebrecht User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.23) Gecko/20110922 Thunderbird/3.1.15 MIME-Version: 1.0 To: Boszormenyi Zoltan CC: pgsql-bugs@postgresql.org Subject: Re: char(0) References: <4E9BD9E2.2010305@2ndQuadrant.com> <4E9C1F5E.7000303@2ndQuadrant.com> <4E9C3132.5060703@cybertec.at> In-Reply-To: <4E9C3132.5060703@cybertec.at> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Server-Quench: ef2c6ce9-f8c7-11e0-80b9-0022640b883e X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZOUR8T DCUJJHVGRTw4LxFW CBkfawBdJUwMSABN M15eIxoJcUtFGhZ+ UCIUWVRVUU1wXWlw bABTbEtfY0hQXgVq TkxLXFBSFhpqBB4E GR5QEhAKA0M6ew9w ZEJrX3AVWkVzcwgo FEwHEz5TbHo2YDMY TUFZIgNJeAMYdwJF alJ9UncNM20PZS8u JQJhdwMbABpkHWxe QggXbQpTKQD/ X-Authentic-SMTP: 61633235383639.1015:706 X-AuthFastPath: 0 (Was 255) X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201110/138 X-Sequence-Number: 31408 Hello, On 17.10.2011 15:44, Boszormenyi Zoltan wrote: > 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 type>": > > := [ ] > > 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 string literal> is the number of s that it > contains. Each contained > in represents a single in both the > value and the length of the string literal>. 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. > I looked this up again. I found more passages in which is written that it should start with 0. But in the section you mentioned here - 1 is given. That is a bug in SQL Standard. SQL Standard is inconsistent here. The next SQL Standard meeting is next week. Of course I will bring up this problem. We will see what will be the outcome of it. Susanne -- Susanne Ebrecht - 2ndQuadrant PostgreSQL Development, 24x7 Support, Training and Services www.2ndQuadrant.com