Re: Welchen 'Data type' nehme ich hier?

Andreas Kretschmer <[email protected]>
Newsgroups gmane.comp.db.postgresql.german
Message-ID <20130210082318.GA7346@tux>
Guenther Boelter <[email protected]> wrote:

> Moin,
> 
> ich habe mal wieder ein kleineres Problem im Rahmen der Umstellung von
> MySQL auf PostgreSQL:
> 
> Welchen 'data type' nehme ich sinnvollerweise fuer
> 
> A:) PDF-Dateien (ca. 25 KB gross)
> 
> B:) XML-Dateien (ca. 10-20 KB gross)
> 
> Die PDF-Dateien habe ich zunaechst mal als BYTEA gespeichert, die
> XML-Dateien als TEXT.

Dass sollte okay sein. Es gibt auch einen speziellen XML-Datentyp:
http://www.postgresql.org/docs/current/interactive/datatype-xml.html

Ob dieser besser als TEXT ist mußt Du entscheiden, der XML-Datentyp hat
halt noch z.B. Konsistenzprüfungen und so.


> 
> Bei den PDF-Dateien konnte ich es bisher noch nicht pruefen, aber bei
> den XML-Dateien scheint PostgreSQL die enthaltenen '\n' in '\012'
> unzuwandeln. Letzt sich Letzeres irgendwie verhindern?

Unwahrscheinlich. PostgreSQL vergreift sich nicht an den Daten.
Im übrigen ist '\n' oktal '\012'. Evtl. ist was bei Konvertierungen
zwischen Windows / Linux kapott gegangen.


Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°


-- 
Sent via pgsql-de-allgemein mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-de-allgemein
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.