Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1haNmh-0003js-Nd for pgsql-general@arkaria.postgresql.org; Mon, 10 Jun 2019 17:08:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1haNmf-0000L9-5q for pgsql-general@arkaria.postgresql.org; Mon, 10 Jun 2019 17:08:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1haNme-0000JI-RG for pgsql-general@lists.postgresql.org; Mon, 10 Jun 2019 17:08:36 +0000 Received: from smh-06.1blu.de ([178.254.0.206]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1haNmb-0002VP-FL for pgsql-general@lists.postgresql.org; Mon, 10 Jun 2019 17:08:36 +0000 Received: from [172.16.29.5] (helo=sh4-5.1blu.de) by smh-06.1blu.de with esmtp (Exim 4.86_2) (envelope-from ) id 1haNmY-0005Zn-Hv for pgsql-general@lists.postgresql.org; Mon, 10 Jun 2019 19:08:30 +0200 Received: from ftp51246-2575596 by sh4-5.1blu.de with local (Exim 4.86_2) (envelope-from ) id 1haNmY-0000mT-EP for pgsql-general@lists.postgresql.org; Mon, 10 Jun 2019 19:08:30 +0200 Date: Mon, 10 Jun 2019 19:08:30 +0200 From: Matthias Apitz To: pgsql-general@lists.postgresql.org Subject: Re: Inserting into the blob Message-ID: <20190610170830.GA31912@sh4-5.1blu.de> Reply-To: Matthias Apitz References: <6cbb4f03-7c05-4473-330d-b220b0a9ec7b@aklaver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Operating-System: FreeBSD 12.0-CURRENT r314251 (amd64) X-message-flag: Mails containing HTML will not be read! Please send only plain text. User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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!