Received: from mx1.datanet.hu (mx1.datanet.hu [194.149.13.160]) by postgresql.org (Postfix) with ESMTP id 5F64047586D for ; Sat, 23 Feb 2002 15:16:39 -0500 (EST) Received: from mithrandir.hu (tiszaujvaros2-26.dialin.datanet.hu [195.56.11.217]) by mx1.datanet.hu (DataNet) with ESMTP id 95B34FCC4 for ; Sat, 23 Feb 2002 21:16:38 +0100 (CET) Message-ID: <3C77F89F.68BFA64@mithrandir.hu> Date: Sat, 23 Feb 2002 21:16:31 +0100 From: =?iso-8859-2?Q?Ikl=F3di?= Lajos X-Mailer: Mozilla 4.51 [hu] (WinNT; I) X-Accept-Language: hu MIME-Version: 1.0 To: "pgsql-sql@postgresql.org" Subject: How to insert zeros into a bytea column? Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit X-Archive-Number: 200202/341 X-Sequence-Number: 6763 Hello, I'm inserting data into a bytea colunm which can contain zero bytes. It seems that insertion stops at first zero: gkk=# CREATE TABLE test (id int4, adat bytea); CREATE gkk=# insert into test (id, adat) values (1, '\100\200\000\100\200'); INSERT 164175 1 gkk=# select * from test; id | adat ----+------- 1 | @\200 (1 row) gkk=# select get_byte(adat,1) from test; get_byte ---------- 128 (1 row) gkk=# select get_byte(adat,2) from test; ERROR: byteaGetByte: index 2 out of range [0..1] How to insert in a correct way? Thanks, Lajos