Re: [GENERAL] how to save a bytea value into a file?

2011-10-10 Thread Merlin Moncure
On Mon, Oct 10, 2011 at 9:26 AM, Albe Laurenz wrote: > I wrote: > [fanlijing wants to write bytea to file] >> A simple >>    COPY (SELECT byteacol WROM mytab WHERE ...) TO 'filename' (FORMAT > binary) >> should do the trick. > > Corrections: > a) "binary" must be surrounded by single quotes. > b)

Re: [GENERAL] how to save a bytea value into a file?

2011-10-10 Thread Albe Laurenz
I wrote: [fanlijing wants to write bytea to file] > A simple >COPY (SELECT byteacol WROM mytab WHERE ...) TO 'filename' (FORMAT binary) > should do the trick. Corrections: a) "binary" must be surrounded by single quotes. b) that won't dump just the binary data - you would have to remove the

Re: [GENERAL] how to save a bytea value into a file?

2011-10-10 Thread fanlijing
*EXTERN*; pgsql-ad...@postgresql.org; pgsql-general@postgresql.org Subject: RE: [GENERAL] how to save a bytea value into a file? fanlijing wrote: > When I want to save a bytea value into a file, what should I do? > Is there any function dealing with that in PostgreSQL? (like lo_export() to &g

Re: [GENERAL] how to save a bytea value into a file?

2011-10-10 Thread Albe Laurenz
fanlijing wrote: > In Fact, I'm doing a porting project from Oracle 10g to PostgreSQL 9.0.4 > > There is a procedure in Oracle 10g to write a blob value into a file using: [...] > I know PostgreSQL doesn't support procedure, so I want to porting it into a > function use LANGUAGE plpgsql. > So I mu

Re: [GENERAL] how to save a bytea value into a file?

2011-10-10 Thread Albe Laurenz
fanlijing wrote: > When I want to save a bytea value into a file, what should I do? > Is there any function dealing with that in PostgreSQL? (like lo_export() to > deal with the large-object) (# I didn't find any) If you want to save it in a file on the server, you can use the COPY statement.

[GENERAL] how to save a bytea value into a file?

2011-10-09 Thread fanlijing
Hello PostgreSQL members: I'm a user of PostgreSQL. Now I have a question when using it. When I want to save a bytea value into a file, what should I do? Is there any function dealing with that in PostgreSQL? (like lo_export() to deal with the large-object) (# I didn't find any) Sorry for int