pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Marco Lechner <mlechner@bfs.de>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Download file from COPY ... TO with pgadmin
Date: Tue, 31 Jan 2023 08:30:59 -0800
Message-ID: <007fdd46-89a2-a40f-1e79-803c9d7c71b9@aklaver.com> (raw)
In-Reply-To: <ffd4bbfbb2644a2fa41445be74e7ae37@bfs.de>
References: <ffd4bbfbb2644a2fa41445be74e7ae37@bfs.de>

On 1/31/23 05:02, Marco Lechner wrote:
> Hi,
> 
> 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?

Read the docs:

https://www.pgadmin.org/docs/pgadmin4/6.19/import_export_data.html

> 
> Regards
> 
> Marco
> 
> i.A. Dr. Marco Lechner
> 
> Leiter Fachgebiet RN 1 │ Head RN 1
> 
> --

-- 
Adrian Klaver
adrian.klaver@aklaver.com






view thread (3+ messages)

Message-ID: <007fdd46-89a2-a40f-1e79-803c9d7c71b9@aklaver.com>
Permalink:  ../007fdd46-89a2-a40f-1e79-803c9d7c71b9@aklaver.com/
Also on:    postgresql.org/message-id/007fdd46-89a2-a40f-1e79-803c9d7c71b9@aklaver.com

 · 

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: adrian.klaver@aklaver.com, mlechner@bfs.de
  Subject: Re: Download file from COPY ... TO with pgadmin
  In-Reply-To: <007fdd46-89a2-a40f-1e79-803c9d7c71b9@aklaver.com>
  References: <ffd4bbfbb2644a2fa41445be74e7ae37@bfs.de> <007fdd46-89a2-a40f-1e79-803c9d7c71b9@aklaver.com>

* 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