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 7329611F6545 for ; Thu, 6 Apr 2006 02:08:34 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 42067-04 for ; Thu, 6 Apr 2006 02:08:31 -0300 (ADT) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id E34AF11F627E for ; Thu, 6 Apr 2006 02:08:31 -0300 (ADT) Received: from moon.antora.ru (moon.antora.ru [83.222.21.34]) by svr4.postgresql.org (Postfix) with ESMTP id A98B65AF8B6 for ; Thu, 6 Apr 2006 05:08:31 +0000 (GMT) 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 1FRMjC-000B2k-9N; Thu, 06 Apr 2006 09:08:18 +0400 Message-ID: <4434A207.6010600@bankir.ru> Date: Thu, 06 Apr 2006 09:07:19 +0400 From: "Eugene E." User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050517) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephan Szabo Cc: Peter Eisentraut , Achilleus Mantzios , pgsql-sql@postgresql.org Subject: Re: have you feel anything when you read this ? References: <441EA0A7.8030601@bankir.ru> <200603201415.30719.peter_e@gmx.net> <442CC95C.1030700@bankir.ru> <20060331084503.W64402@megazone.bigpanda.com> <44324AB6.2060104@bankir.ru> <20060404071118.C19036@megazone.bigpanda.com> <4433650E.1020508@bankir.ru> <20060405071322.Y58168@megazone.bigpanda.com> In-Reply-To: <20060405071322.Y58168@megazone.bigpanda.com> 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 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200604/31 X-Sequence-Number: 24840 Stephan Szabo wrote: > On Wed, 5 Apr 2006, Eugene E. wrote: > > >>Stephan Szabo wrote: >> >>>On Tue, 4 Apr 2006, Eugene E. wrote: >>> >>> >>> >>>>Stephan Szabo wrote: >>>> >>>> >>>>>On Fri, 31 Mar 2006, Eugene E. wrote: >>>>> >>>>> >>>>> >>>>> >>>>>>Peter Eisentraut wrote: >>>>>> >>>>>> >>>>>> >>>>>>>Eugene E. wrote: >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>>>the problem is: you'll get this four byte sequence '\000' _instead_ >>>>>>>>of NUL-byte anyway. >>>>>>> >>>>>>> >>>>>>>What you seem to be missing is that PostgreSQL data can be represented >>>>>>>in textual and in binary form. What you in psql is the textual form. >>>>>>>If you want the binary form you need to select it. Then you can pass >>>>>>>the exact bytes back and forth. >>>>>> >>>>>>your sentence is not true. >>>>>>I can not select exact bytes even if i use BYTEA type >>>>> >>>>> >>>>>No, that is still using the textual form. If you use PQexecParams and set >>>>>the last argument to show you want binary data, you should get binary >>>>>data. >> >>ok >>then i am using PQexecParams >> >>the following tiny program shows a wonderful lameness... > > > What lameness? The fact that you're trying to use a binary (network order > maybe) integer as a string? That's not the fault of PQexecParams but > of the code calling it. You're right ! That's is not a fault of PQexecParams at all. That's the fault of its design. (I pretty know why an integer has been not displayed, but why they designed this function that way ? i do not know) > It'd be nice for ease of use to be able to say, give me this > column (the integer) as a string and this column (the bytea) as binary, I always want to retrieve TEXT (and mostly INT) in TEXTUAL-FORM, and BYTEA always in BINARY-FORM. (at least by defaul) WHY SHOULD I RETRIVE A SINGLE BYTEA FIELD IN A SEPARATE QUERY ??? Look: if i define a field as of type BYTEA, doesn't it mean the field tends to store binary data ? If does, then WHY they (by default) convert its value to TEXTUAL-FORM which is not needed by default -- i already inform the server: "i want some BINARY to in and out" when i have choosed the type BYTEA