Re: bytea question

mjp@ornl.gov

From: mjp@ornl.gov
To: mikeo <mikeo@spectrumtelecorp.com>
Cc: pgsql-general@postgresql.org
Date: 2000-08-15T20:38:56Z
Lists: pgsql-general
Try

substr(text,int4) or
substr(text, int4, int4)

For example,


% select substr('hi there',4,3);
 substr 
--------
 the
(1 row)

Morey Parang
ORNL

On Tue, Aug 15, 2000 at 03:34:27PM -0400, mikeo wrote:
> hi all,
>    in the pg_trigger table the tgargs column is defined
> as type "BYTEA".  i can split this up in perl, once
> retrieved, but can't figure out how to "substring"
> it in sql.  is there an SQL way to select pieces of
> a column of this type?  
> 
> any help is appreciated,
> 
> mikeo