Re: Storing image contents in TEXT fields

From: Alex Pilosov <alex(at)pilosoft(dot)com>
To: Jerome Alet <alet(at)unice(dot)fr>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Storing image contents in TEXT fields
Date: 2001-06-26 22:34:32
Message-ID: Pine.BSO.4.10.10106261833430.21119-100000@spider.pilosoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

You must use type 'bytea'.

When you insert data, you must escape them like this: '\001\002\\000'
note the double-backslash for null byte.

On Wed, 27 Jun 2001, Jerome Alet wrote:

> Hi,
>
> I wanted to know if it's possible to store an image content in a TEXT field,
> or if another type is needed (in this case, then which one ?).
>
> I don't want to use BLOBs, because I modify an existing application
> which also works with MySQL, and I can't update to postgresql-7.1.x
> (I don't admin this server)
>
> in a TEXT field the image seems to be truncated at the first nul byte.
>
> Thanks in advance for any help.
>
> bye,
>
> Jerome Alet
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Sergei Pohilko 2001-06-26 23:15:45 Cast varchar to interval in plpgsql
Previous Message Jie Liang 2001-06-26 22:23:52 how to limit user to open another session