convert int to bytea - Mailing list pgsql-hackers

From ohp@pyrenet.fr
Subject convert int to bytea
Date
Msg-id Pine.UW2.4.53.0711291438060.13487@sun.pyrenet
Whole thread Raw
Responses Re: convert int to bytea  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
Hi all,

I'm trying to write a trigger that converts integer to bytea.
My schema is like this:

Create table xx (
id int,
....
...
data bytea);

the first 3 bytes of data are the binary representation of id
(id  is extracted from data by  the application)

I can occur that id change in that case data has to change too!

select 124::bytea doesn't work

Is there an other way? (preferabily simple :)

Regards
-- 
Olivier PRENANT                    Tel: +33-5-61-50-97-00 (Work)
15, Chemin des Monges                +33-5-61-50-97-01 (Fax)
31190 AUTERIVE                       +33-6-07-63-80-64 (GSM)
FRANCE                          Email: ohp@pyrenet.fr
------------------------------------------------------------------------------
Make your life a dream, make your dream a reality. (St Exupery)


pgsql-hackers by date:

Previous
From: Jorgen Austvik - Sun Norway
Date:
Subject: Re: lo_export and lo_import: paths and servers
Next
From: NikhilS
Date:
Subject: Re: [pgsql-www] Time to update list of contributors