Re: Inserting into the blob

From: Matthias Apitz <guru(at)unixarea(dot)de>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Inserting into the blob
Date: 2019-06-10 17:08:30
Message-ID: 20190610170830.GA31912@sh4-5.1blu.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)unixarea(dot)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!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Verite 2019-06-10 17:08:32 Re: Inserting into the blob
Previous Message Andreas Kretschmer 2019-06-10 16:51:05 Re: Drive Architecture for new PostgreSQL Environment