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!