pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Igor Korot <ikorot01@gmail.com>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: Inserting into the blob
Date: Mon, 10 Jun 2019 21:53:46 -0600
Message-ID: <A301911F-322A-4D6A-B5BB-50A326450701@gmail.com> (raw)
In-Reply-To: <CAKFQuwZN5VCnqOXDfSEYp0rOMJugNkRKTyHQvni6na-Rmur_kg@mail.gmail.com>
References: <CA+FnnTzRCOPGDjyfeR32c7btgtLES12t_k8RB7d-fU+2v9+CZQ@mail.gmail.com>
	<6cbb4f03-7c05-4473-330d-b220b0a9ec7b@aklaver.com>
	<CA+FnnTx-8TO-ny5UXhHVf8rXwS0vrU9EQtQHv0ZTbAfPz5HbcQ@mail.gmail.com>
	<a2e94058-b409-b4d9-4044-53ccb02438be@aklaver.com>
	<CA+FnnTxafc=GH_2xdQJuy_n2i57U9w5JLK0v+HLS1SBXLd8BMw@mail.gmail.com>
	<84a73244-f26e-c2cc-4fac-81e6e39b7a42@aklaver.com>
	<CA+FnnTwUhTdovmEJgVK4LTX8QzeYsHk=-kchJoh6PNq-FaAnPQ@mail.gmail.com>
	<A209BE4C-F78F-4E80-BAC3-5ABA9C46334A@gmail.com>
	<CAKFQuwZN5VCnqOXDfSEYp0rOMJugNkRKTyHQvni6na-Rmur_kg@mail.gmail.com>



> 
> >> 1) Are you really wanting to insert a file at a time at the psql command
> >> line?
> > 
> > Yes.
> Gnarly. I suppose you could open the pdf in emacs and tell emacs to  NOT render it. Cut the entire buffer and paste it, properly quoted, into your psql command line. But \lo stuff seems much more likely to work. 
> 
> 
> This is what I've used for text:
> 
>     \set file_content `cat './file.txt'`
>     SELECT:'file_content';
> 
> For smallish files I'd probably just stick with the same theme but encode the binary data as Base64 and then decode it into the bytea field.
> 
> For not-so-small files probably better off storing the content elsewhere and inserting location data into the database.
> 
> I have not yet had the desire to incorporate the large object API into my designs.
> 
> David J.
Yes if you’re comfortable managing the great leap of faith that the file remains where it once claimed to be. And of course the other camp must contend with what could be excessively large database data directories.
  

view thread (13+ messages)

Message-ID: <A301911F-322A-4D6A-B5BB-50A326450701@gmail.com>
Permalink:  ../A301911F-322A-4D6A-B5BB-50A326450701@gmail.com/
Also on:    postgresql.org/message-id/A301911F-322A-4D6A-B5BB-50A326450701@gmail.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: robjsargent@gmail.com, david.g.johnston@gmail.com, ikorot01@gmail.com, adrian.klaver@aklaver.com
  Subject: Re: Inserting into the blob
  In-Reply-To: <A301911F-322A-4D6A-B5BB-50A326450701@gmail.com>
  References: <CA+FnnTzRCOPGDjyfeR32c7btgtLES12t_k8RB7d-fU+2v9+CZQ@mail.gmail.com> <6cbb4f03-7c05-4473-330d-b220b0a9ec7b@aklaver.com> <CA+FnnTx-8TO-ny5UXhHVf8rXwS0vrU9EQtQHv0ZTbAfPz5HbcQ@mail.gmail.com> <a2e94058-b409-b4d9-4044-53ccb02438be@aklaver.com> <CA+FnnTxafc=GH_2xdQJuy_n2i57U9w5JLK0v+HLS1SBXLd8BMw@mail.gmail.com> <84a73244-f26e-c2cc-4fac-81e6e39b7a42@aklaver.com> <CA+FnnTwUhTdovmEJgVK4LTX8QzeYsHk=-kchJoh6PNq-FaAnPQ@mail.gmail.com> <A209BE4C-F78F-4E80-BAC3-5ABA9C46334A@gmail.com> <CAKFQuwZN5VCnqOXDfSEYp0rOMJugNkRKTyHQvni6na-Rmur_kg@mail.gmail.com> <A301911F-322A-4D6A-B5BB-50A326450701@gmail.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