From: | Diogo Biazus <diogo(at)ikono(dot)com(dot)br> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Problem with memory in C function |
Date: | 2004-03-29 17:53:01 |
Message-ID: | 4068627D.4090505@ikono.com.br |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Tom Lane wrote:
>Diogo Biazus <diogo(at)ikono(dot)com(dot)br> writes:
>
>
>>Am I doing something wrong?
>>
>>
>
>You forgot to set up the length word that's required for a bytea value
>(or any other variable-length datatype). The system is taking the first
>four bytes of the file data as the datum length.
>
>
Thanks, now I've got it working.
I've done a bytea_import function, that works like lo_import, but you
put it into a insert statement:
insert into table_name (field_name) values
(bytea_import('/path_to_file_on_server'));
Does anyone think it could be useful in the /contrib?
My Regards,
--
Diogo Biazus
diogo(at)ikono(dot)com(dot)br
http://www.ikono.com.br
From | Date | Subject | |
---|---|---|---|
Next Message | Andrew Ayers | 2004-03-29 17:59:15 | Re: PG vs MySQL |
Previous Message | Joshua D. Drake | 2004-03-29 17:26:12 | Re: PG vs MySQL |