Re: Import SVG file

Поиск
Список
Период
Сортировка
От Phil Endecott
Тема Re: Import SVG file
Дата
Msg-id 41FFB2CA.2070704@chezphil.org
обсуждение исходный текст
Ответ на Import SVG file  (Miguel Angel Tribaldos Hervas <mitriher@teleco.upv.es>)
Ответы Re: Import SVG file  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Список pgsql-general
Hi Miguel,

 > how can I import a SVG file to a row?? The main problem is
 > that it has many postgres scape symbols. Can I use the
 > 'text' type for that?

I would probably choose to use 'bytea' rather than 'text' because of the
character set issues.  The SVG, being XML, describes its own character
set in its header.  If you have an 8859-1 database and then import a
UTF-8 SVG file into a text field you will have unnecessary problems.
bytea is just a sequence of bytes.

The main disadvantage of bytea is that you can't do regular expression
searches on them.

 > Have I to do some byte-stuffing before the import?

Yes, you will have to do the necessary escaping.  I think that the
postgres C library has code to do this, and others have mentioned the
possibilities with other languages.  You cannot do it with anything
quite as simple as the one line of psql that you posted.

Regards,

--Phil Endecott.


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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: PostgreSQL Security Release
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Import SVG file