Re: Can not match 0 on bytea

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: seiliki(at)so-net(dot)net(dot)tw
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Can not match 0 on bytea
Date: 2010-02-27 09:34:42
Message-ID: ae93099e-58c3-4251-868d-89f27d250678@mm
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

seiliki(at)so-net(dot)net(dot)tw wrote:

> Data type of table1.c1 is bytea. That column stores binary data. The
> following matchings do not work. What is the right syntax?
>
> TIA
> CN
> ---------------
> select c1 ~ E'\000' from table1;
> select c1 LIKE E'%\000%' from table1;

selection position(E'\\000'::bytea in c1) from table1;
The value is 0 when there is no match and >0 otherwise.

Best regards,
--
Daniel
PostgreSQL-powered mail user agent and storage: http://www.manitou-mail.org

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Osvaldo Kussama 2010-02-27 13:47:33 Re: regexp_replace: LF, CR, or tab
Previous Message Anton Maksimenkov 2010-02-27 09:30:10 Re: ERROR: value out of range: underflow