pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Matthias Apitz <guru@unixarea.de>
To: pgsql-general@lists.postgresql.org
Subject: Re: Inserting into the blob
Date: Mon, 10 Jun 2019 19:08:30 +0200
Message-ID: <20190610170830.GA31912@sh4-5.1blu.de> (raw)
In-Reply-To: <CA+FnnTxafc=GH_2xdQJuy_n2i57U9w5JLK0v+HLS1SBXLd8BMw@mail.gmail.com>
References: <CA+FnnTzRCOPGDjyfeR32c7btgtLES12t_k8RB7d-fU+2v9+CZQ@mail.gmail.com>
	<6cbb4f03-7c05-4473-330d-b220b0a9ec7b@aklaver.com>
	<CA+FnnTx-8TO-ny5UXhHVf8rXwS0vrU9EQtQHv0ZTbAfPz5HbcQ@mail.gmail.com>
	<a2e94058-b409-b4d9-4044-53ccb02438be@aklaver.com>
	<CA+FnnTxafc=GH_2xdQJuy_n2i57U9w5JLK0v+HLS1SBXLd8BMw@mail.gmail.com>

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...,
> 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!





view thread (13+ messages)  latest in thread

Message-ID: <20190610170830.GA31912@sh4-5.1blu.de>
Permalink:  ../20190610170830.GA31912@sh4-5.1blu.de/
Also on:    postgresql.org/message-id/20190610170830.GA31912@sh4-5.1blu.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: guru@unixarea.de
  Subject: Re: Inserting into the blob
  In-Reply-To: <20190610170830.GA31912@sh4-5.1blu.de>
  References: <CA+FnnTzRCOPGDjyfeR32c7btgtLES12t_k8RB7d-fU+2v9+CZQ@mail.gmail.com> <6cbb4f03-7c05-4473-330d-b220b0a9ec7b@aklaver.com> <CA+FnnTx-8TO-ny5UXhHVf8rXwS0vrU9EQtQHv0ZTbAfPz5HbcQ@mail.gmail.com> <a2e94058-b409-b4d9-4044-53ccb02438be@aklaver.com> <CA+FnnTxafc=GH_2xdQJuy_n2i57U9w5JLK0v+HLS1SBXLd8BMw@mail.gmail.com> <20190610170830.GA31912@sh4-5.1blu.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox