Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 85050B5DE73 for ; Mon, 5 Sep 2011 23:53:07 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 56490-01 for ; Tue, 6 Sep 2011 02:52:59 +0000 (UTC) X-Greylist: delayed 00:08:58.44265 by SQLgrey-1.7.6 Received: from mail.pc.com.cn (mail.pconline.com.cn [202.96.159.232]) by mail.postgresql.org (Postfix) with ESMTP id 18F3FB5DE4A for ; Mon, 5 Sep 2011 23:52:59 -0300 (ADT) Received: from JISHU-LSLIANG (unknown [192.168.20.4]) by mail.pc.com.cn (Postfix - by pc.com.cn) with ESMTPA id B141B1DEF8E for ; Tue, 6 Sep 2011 10:43:55 +0800 (CST) Date: Tue, 6 Sep 2011 10:43:57 +0800 From: "lsliang" To: "pgsql-docs" Subject: about value storage Message-ID: <201109061043572514728@pconline.com.cn> X-mailer: Foxmail 6, 15, 201, 23 [cn] Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=====003_Dragon715338250033_=====" X-Antivirus: avast! (VPS 110905-1, 2011/09/06), Outbound message X-Antivirus-Status: Clean X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.297 tagged_above=-5 required=5 tests=BAYES_50=0.8, HTML_MESSAGE=0.001, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201109/17 X-Sequence-Number: 6938 This is a multi-part message in MIME format. --=====003_Dragon715338250033_===== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 : ^ lsl=# select version(); version ------------------------------------------------------------------------------------------------------------------- PostgreSQL 9.0.1 on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46), 64-bit (1 row) lsl=# CREATE TABLE vv (v character(20)); INSERT INTO vv SELECT 'abc' || 'def'; SELECT v, length(v) FROM vv; CREATE TABLE lsl=# INSERT INTO vv SELECT 'abc' || 'def'; INSERT 0 1 lsl=# SELECT v, length(v) FROM vv; v | length ----------------------+-------- abcdef | 6 (1 row) why ?? anyone help me ? or it is a doc mistake ? thank you! --=====003_Dragon715338250033_===== Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: 7bit
 
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 :
 
               ^
lsl=# select version();
                                                      version                                                      
-------------------------------------------------------------------------------------------------------------------
 PostgreSQL 9.0.1 on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46), 64-bit
(1 row)
 
lsl=# CREATE TABLE vv (v character(20));
INSERT INTO vv SELECT 'abc' || 'def';
SELECT v, length(v) FROM vv;
CREATE TABLE
lsl=# INSERT INTO vv SELECT 'abc' || 'def';
INSERT 0 1
lsl=# SELECT v, length(v) FROM vv;
          v           | length 
----------------------+--------
 abcdef               |      6
(1 row)
 
 
why ??   anyone  help me ?
 
or  it is a  doc mistake ?
 
thank you!
 
--=====003_Dragon715338250033_=====--