From: Marco Lechner <mlechner@bfs.de>
To: Erik Wienhold <ewie@ewie.name>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: AW: Download file from COPY ... TO with pgadmin
Date: Tue, 31 Jan 2023 14:17:34 +0000
Message-ID: <e4beb8b2bc6941ddbeff5148a55dbbc0@bfs.de> (raw)
In-Reply-To: <264813354.7537.1675173488843@office.mailbox.org>
References: <ffd4bbfbb2644a2fa41445be74e7ae37@bfs.de>
<264813354.7537.1675173488843@office.mailbox.org>
Works as expected on both ways. Thnx.
-----Ursprüngliche Nachricht-----
Von: Erik Wienhold <ewie@ewie.name>
Gesendet: Dienstag, 31. Januar 2023 14:58
An: Marco Lechner <mlechner@bfs.de>; pgsql-general@lists.postgresql.org
Betreff: Re: Download file from COPY ... TO with pgadmin
> On 31/01/2023 14:02 CET Marco Lechner <mlechner@bfs.de> wrote:
>
> Using COPY …TO it is possible to store e.g. the “value” of a bytea
> cell in a directory on the server. E.g. by this:
>
> COPY (SELECT content FROM d_doc WHERE id = 'x123456') TO
> CONCAT('/tmp/mydoc.pdf’) (FORMAT binary);
>
> As we do not have access to the postgresql fileserver (ssh, …), but
> can SELECT the value of the bytea cell, is It possible to download the
> bytea directly into a file on a client computer when using pgadmin? Is
> there a solution with the COPY … TO command, any pgadmin specific feature or any other simple solution?
Use psql with \copy which targets the client file system. pgAdmin 5.4+ can also launch psql.
--
Erik
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: mlechner@bfs.de, ewie@ewie.name
Subject: Re: Download file from COPY ... TO with pgadmin
In-Reply-To: <e4beb8b2bc6941ddbeff5148a55dbbc0@bfs.de>
References: <ffd4bbfbb2644a2fa41445be74e7ae37@bfs.de> <264813354.7537.1675173488843@office.mailbox.org> <e4beb8b2bc6941ddbeff5148a55dbbc0@bfs.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