Re: Inserting into the blob

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Igor Korot <ikorot01(at)gmail(dot)com>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Inserting into the blob
Date: 2019-06-11 03:53:46
Message-ID: A301911F-322A-4D6A-B5BB-50A326450701@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
> >> 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Karsten Hilbert 2019-06-11 07:15:46 Re: pg_dump include/exclude data, was: verify checksums / CREATE DATABASE
Previous Message David G. Johnston 2019-06-11 03:45:17 Re: Inserting into the blob