AW: Download file from COPY ... TO with pgadmin

From: Marco Lechner <mlechner(at)bfs(dot)de>
To: Erik Wienhold <ewie(at)ewie(dot)name>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: AW: Download file from COPY ... TO with pgadmin
Date: 2023-01-31 14:17:34
Message-ID: e4beb8b2bc6941ddbeff5148a55dbbc0@bfs.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Works as expected on both ways. Thnx.

-----Ursprüngliche Nachricht-----
Von: Erik Wienhold <ewie(at)ewie(dot)name>
Gesendet: Dienstag, 31. Januar 2023 14:58
An: Marco Lechner <mlechner(at)bfs(dot)de>; pgsql-general(at)lists(dot)postgresql(dot)org
Betreff: Re: Download file from COPY ... TO with pgadmin

> On 31/01/2023 14:02 CET Marco Lechner <mlechner(at)bfs(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2023-01-31 15:03:37 Re: toast useless
Previous Message Magnus Hagander 2023-01-31 14:02:17 Re: pgBackrest Error : authentication method 10 not supported