Re: Inserting into the blob

Поиск
Список
Период
Сортировка
От Rob Sargent
Тема Re: Inserting into the blob
Дата
Msg-id A301911F-322A-4D6A-B5BB-50A326450701@gmail.com
обсуждение исходный текст
Ответ на Re: Inserting into the blob  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список 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.
  

В списке pgsql-general по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Inserting into the blob
Следующее
От: Karsten Hilbert
Дата:
Сообщение: Re: pg_dump include/exclude data, was: verify checksums / CREATEDATABASE