Re: Regarding bytea column in Posgresql

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: Regarding bytea column in Posgresql
Дата
Msg-id 5526D2A2.4030100@hogranch.com
обсуждение исходный текст
Ответ на Re: Regarding bytea column in Posgresql  (Bill Moran <wmoran@potentialtech.com>)
Ответы Re: Regarding bytea column in Posgresql  (Craig Ringer <craig@2ndquadrant.com>)
Re: Regarding bytea column in Posgresql  ("Deole, Pushkar (Pushkar)" <pdeole@avaya.com>)
Список pgsql-general
On 4/9/2015 4:10 AM, Bill Moran wrote:
>> 1.       Is 'bytea' column intended for storing text data?
> No, it's intended for storing binary data.
>
>> >2.       Typically a chat can have text data with several special characters (which can be represented in multi
bytes),how these characters can be stored in a bytea column and retrieved back properly? 
> bytea won't help you here. You'll have to manage the special
> characters entirely in your code. bytea gives you back the
> exact same types you put in, with no changes or interpretation.
>
> A better choice would be to use a text field with a proper
> text encoding (such as utf-8).

one possible rationale for using BYTEA is that the data could be in
various encodings, which the application wishes to preserve, and keeps
track of somewhere else (perhaps in a field within the XML?).
PostgreSQL text types would insist that all text be stored in the same
encoding, and anything in a different encoding would have to be
converted to the database encoding.   Me, I'd be inclined to convert
everything to UTF8 and store it as such, and convert it back to the
user's encoding on display, but the feasibility of this really depends
on the use cases.

--
john r pierce, recycling bits in santa cruz



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

Предыдущее
От: Melvin Davidson
Дата:
Сообщение: Re: no pg_hba.conf entry for replication connection from host
Следующее
От: Volkan Unsal
Дата:
Сообщение: Re: no pg_hba.conf entry for replication connection from host