Search Postgresql Archives

Re: Import SVG file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux