Re: Inserting into the blob

Поиск
Список
Период
Сортировка
От Igor Korot
Тема Re: Inserting into the blob
Дата
Msg-id CA+FnnTxafc=GH_2xdQJuy_n2i57U9w5JLK0v+HLS1SBXLd8BMw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Inserting into the blob  (Adrian Klaver <adrian.klaver@aklaver.com>)
Ответы Re: Inserting into the blob  (Matthias Apitz <guru@unixarea.de>)
Re: Inserting into the blob  ("Daniel Verite" <daniel@manitou-mail.org>)
Re: Inserting into the blob  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
Hi, Adrian,

On Mon, Jun 10, 2019 at 8:38 AM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
>
> On 6/9/19 10:06 AM, Igor Korot wrote:
> > Hi, Adrian,
> >
> > On Sun, Jun 9, 2019 at 11:14 PM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
> >>
> >> On 6/9/19 8:28 AM, Igor Korot wrote:
> >>> Hi, ALL,
> >>> How do I insert the png file (content, not a name) into the BLOB field
> >>> in the table i PostgreSQL DB?
> >>
> >> Are you talking about this data type?:
> >>
> >> https://www.postgresql.org/docs/11/datatype-binary.html
> >>
> >> Or this?:
> >>
> >> https://www.postgresql.org/docs/11/largeobjects.html
> >
> > Which one is best to hold an images of unknown size?
>
> Probably bytea as it is easier to work with overall.

OK.

>
> >
> >>
> >> What client/language are you using?
> >
> > psql if possible.
>
> Take a look at(NOTE: need to be superuser):
>
> https://www.postgresql.org/docs/current/functions-admin.html
>
> pg_read_binary_file is similar to pg_read_file, except that the result
> is a bytea value; accordingly, no encoding checks are performed. In
> combination with the convert_from function, this function can be used to
> read a file in a specified encoding:

According to
https://stackoverflow.com/questions/16048649/postgresql-9-x-pg-read-binary-file-inserting-files-into-bytea,
the file needs to be on the server inside PGDATA directory.
It is not a problem in general, but just curious - is there a more
generic solution (to get the file from the client)?

Thank you.

>
> >
> > Thank you.
> >
> >>
> >>
> >>>
> >>> Thank you.
> >>>
> >>>
> >>>
> >>
> >>
> >> --
> >> Adrian Klaver
> >> adrian.klaver@aklaver.com
> >
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com



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

Предыдущее
От: Igor Korot
Дата:
Сообщение: Re: Inserting into the blob
Следующее
От: "Hilbert, Karin"
Дата:
Сообщение: Drive Architecture for new PostgreSQL Environment