Re: Storing images in PG?

Поиск
Список
Период
Сортировка
От Jan Wieck
Тема Re: Storing images in PG?
Дата
Msg-id 200108161736.f7GHaNs02256@jupiter.us.greatbridge.com
обсуждение исходный текст
Ответ на RE: Storing images in PG?  ("Andrew Snow" <andrew@modulus.org>)
Список pgsql-general
Andrew Snow wrote:
>
>
> > I have found (and confirmed by studying the PostgreSQL
> > source) that to reliably insert arbitrary binary data into a
> > bytea column there are only 3 characters which need to be
> > escaped: \000, \047 ( ' ), \134 ( \ ). Here's the PHP
> > function that I've been using:
>
>
> Postgresl, in treating things as strings, handles \000 as NULL as an end
> of string.
>
>  select 'abc\000def' as hehehe;
>  hehehe
> --------
>  abc
> (1 row)

    You forgot to quote the \ and cast it to bytea.

>
>
> How do you get the data back from a query, with all the nulls in it?
>
>
> - Andrew
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>


--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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

Предыдущее
От: "Joe Conway"
Дата:
Сообщение: Re: Storing images in PG?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Roll Back dont roll back counters