X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 122AD9DCB4F for ; Mon, 20 Mar 2006 08:50:40 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 69641-07 for ; Mon, 20 Mar 2006 08:50:43 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from moon.antora.ru (moon.antora.ru [83.222.21.34]) by postgresql.org (Postfix) with ESMTP id E24EC9DCAE4 for ; Mon, 20 Mar 2006 08:50:37 -0400 (AST) Received: from [217.26.17.26] (helo=[10.0.0.72]) by moon.antora.ru with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.60 (FreeBSD)) (envelope-from ) id 1FLJpg-000I7f-1a; Mon, 20 Mar 2006 15:50:39 +0300 Message-ID: <441EA3AA.3080909@bankir.ru> Date: Mon, 20 Mar 2006 15:44:26 +0300 From: "Eugene E." User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050517) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Alvaro Herrera CC: Achilleus Mantzios , Peter Eisentraut , pgsql-sql@postgresql.org Subject: Re: have you feel anything when you read this ? References: <200603201251.11255.peter_e@gmx.net> <20060320121354.GA12564@surnet.cl> <441E9DEC.2070805@bankir.ru> <20060320122749.GC12564@surnet.cl> In-Reply-To: <20060320122749.GC12564@surnet.cl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.12 required=5 tests=[AWL=0.120] X-Spam-Score: 0.12 X-Spam-Level: X-Archive-Number: 200603/302 X-Sequence-Number: 24648 Alvaro Herrera wrote: > Eugene E. wrote: > >>Alvaro Herrera wrote: > > >>>text is not bytea. >> >>source says: >> >>typedef text varlena; >>typedef bytea varlena; > > > This means that as far as the C type system is concerned, both bytea and > text are treated as "struct varlena". It doesn't mean that they are > processed by the same input/output functions, which they aren't. > > NUL bytes are preserved in bytea, and used as terminators in text. I > don't find this surprising at all, do you? I do found surprising it. since both (text and bytea) I/O functions has CSTRING arguments and resut type. - this only means a user should perform some unescaping on the bytea value he got. THE SAME THING he should do with a string value if he decide to use type text and to escape NUL-bytes before input. then what a difference bitween those types except strlen() ?