Re: Bug #467: Can't insert a value of 0 (zero) into a Bytea

From: "Billy G(dot) Allie" <Bill(dot)Allie(at)mug(dot)org>
To: Bill(dot)Allie(at)mug(dot)org, pgsql-bugs(at)postgresql(dot)org
Cc: bga(at)mug(dot)org
Subject: Re: Bug #467: Can't insert a value of 0 (zero) into a Bytea
Date: 2001-09-24 06:16:34
Message-ID: 200109240616.f8O6GYt24711@bajor.mug.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

pgsql-bugs(at)postgresql(dot)org wrote:
> Billy G. Allie (Bill(dot)Allie(at)mug(dot)org) reports a bug with a severity of 2
> The lower the number the more severe it is.
>
> Short Description
> Can't insert a value of 0 (zero) into a Bytea type.
>
> Long Description
> It does not zeem possible to insert a value of zero (0) into a bytea type. A
> lso, using '\134' (the octal code for a backslash) causes byteain() to genera
> te an error message.
>
> As a side issue, how can one tell a backslash followed by 3 digits (four byte
> s of data) from an encoded byte of data? It seems to me that byteaout() shou
> ld always output an octal escape sequence per byte, even if the character is
> printable. That way the result is unambiguous in meaning (even if it is wast
> eful of bytes).

Further investigation provided the following information:

1. To insert a zero value the '\\000' sequence is required.

2. To insert a backslash, 4 backslashes are required (i.e. '\\\\')

Therefore, to insert a backslash followed by the characters 1, 2, and 3 (four bytes of data), you would uses the sequence '\\\\123'. On retrieval from the database, the sequence '\\123' would be returned.

Can anyone confirm that this is correct. If it is, then this bug report can be closed.

Thanks.
--
____ | Billy G. Allie | Domain....: Bill(dot)Allie(at)mug(dot)org
| /| | 7436 Hartwell | MSN.......: B_G_Allie(at)email(dot)msn(dot)com
|-/-|----- | Dearborn, MI 48126|
|/ |LLIE | (313) 582-1540 |

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Kovacs Baldvin 2001-09-24 08:01:43 Server crash caused by CHECK on child
Previous Message pgsql-bugs 2001-09-24 01:46:47 Bug #467: Can't insert a value of 0 (zero) into a Bytea type.