Re: Inserting into the blob - Mailing list pgsql-general

From Matthias Apitz
Subject Re: Inserting into the blob
Date
Msg-id 20190610170830.GA31912@sh4-5.1blu.de
Whole thread Raw
In response to Re: Inserting into the blob  (Igor Korot <ikorot01@gmail.com>)
List pgsql-general
El día Monday, June 10, 2019 a las 11:30:42AM -0500, Igor Korot escribió:

> 
> According to
https://stackoverflow.com/questions/16048649/postgresql-9-x-pg-read-binary-file-inserting-files-into-bytea,
> the file needs to be on the server inside PGDATA directory.
> It is not a problem in general, but just curious - is there a more
> generic solution (to get the file from the client)?

When we migrated a Sybase database to PG, we used the format TEXT for
the COPY command and loaded all image data too. The column of the image
data must be coded in 2-byte hex values and must have \\x in front of
it. The file was just in "user land", i.e.

COPY tablename FROM 'myfile' ....

    matthias 

-- 
Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
May, 9: Спаси́бо освободители! Thank you very much, Russian liberators!



pgsql-general by date:

Previous
From: Andreas Kretschmer
Date:
Subject: Re: Drive Architecture for new PostgreSQL Environment
Next
From: "Daniel Verite"
Date:
Subject: Re: Inserting into the blob