Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id A96E3B5DC15 for ; Tue, 6 Sep 2011 12:52:48 -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 14548-07 for ; Tue, 6 Sep 2011 15:52:40 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id C1E1BB5DC12 for ; Tue, 6 Sep 2011 12:52:39 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p86FqW1L007709; Tue, 6 Sep 2011 11:52:33 -0400 (EDT) To: "lsliang" cc: "pgsql-docs" Subject: Re: about value storage In-reply-to: <201109061043572514728@pconline.com.cn> References: <201109061043572514728@pconline.com.cn> Comments: In-reply-to "lsliang" message dated "Tue, 06 Sep 2011 10:43:57 +0800" Date: Tue, 06 Sep 2011 11:52:32 -0400 Message-ID: <7708.1315324352@sss.pgh.pa.us> From: Tom Lane 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: 201109/19 X-Sequence-Number: 6940 "lsliang" writes: > http://www.postgresql.org/docs/9.0/interactive/typeconv-query.html > example shows: > CREATE TABLE vv (v character(20)); > INSERT INTO vv SELECT 'abc' || 'def'; > SELECT v, length(v) FROM vv; > v | length > ----------------------+-------- > abcdef | 20 > (1 row) > but my test show not like this : Hmm, looks like that example was overlooked when we changed the behavior years ago: http://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=f27976c85b1fb9002727cce65b9f9567e158f754 Given the context, we should change it to use octet_length(). Will fix, thanks. regards, tom lane