From: Marco Lechner <mlechner@bfs.de>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Download file from COPY ... TO with pgadmin
Date: Tue, 31 Jan 2023 13:02:55 +0000
Message-ID: <ffd4bbfbb2644a2fa41445be74e7ae37@bfs.de> (raw)
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?
Regards
Marco
i.A. Dr. Marco Lechner
Leiter Fachgebiet RN 1 │ Head RN 1
--
Bundesamt für Strahlenschutz │ Federal Office for Radiation Protection
Koordination Notfallschutzsysteme │ Coordination Emergency Systems │ RN 1
Rosastr. 9
D-79098 Freiburg
Tel.: +49 30 18333-6724
E-Mail: mlechner@bfs.de<mailto:mlechner@bfs.de>
www.bfs.de<http://www.bfs.de/;
🌐 Besuchen<https://www.bfs.de/; Sie unsere Website, folgen Sie uns auf Twitter<https://www.twitter.com/strahlenschutz; und abonnieren<https://www.bfs.de/strahlenschutzaktuell; Sie unseren 📢 Newsletter.
🔒 Informationen zum Datenschutz<https://www.bfs.de/datenschutz; gemäß Artikel 13 DSGVO
💚 E-Mail drucken? Lieber die Umwelt schonen!
--
Hinweis zu Anhängen die auf .p7m/.p7c/.p7s oder .asc/.asc.sig enden:
Die .p7?- und .asc-Dateien sind ungefährliche Signaturdateien (digitale Unterschriften). In E-Mail-Clients mit S/MIME Konfiguration (.p7?) oder PGP-Erweiterung (.asc) dienen sie zur:
- Überprüfung des Absenders
- Überprüfung einer evtl. Veränderung des Inhalts während der Übermittlung über das Internet
Die Signaturdateien können ebenso dazu verwendet werden dem Absender dieser Signatur eine E-Mail mit verschlüsseltem Inhalt zu senden. In E-Mail-Clients ohne S/MIME Konfiguration oder PGP-Erweiterung erscheinen die Dateien als Anhang und können ignoriert werden.
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
Subject: Re: Download file from COPY ... TO with pgadmin
In-Reply-To: <ffd4bbfbb2644a2fa41445be74e7ae37@bfs.de>
References: <ffd4bbfbb2644a2fa41445be74e7ae37@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