putting binary data in a char field? - Mailing list pgsql-general

From Ron Snyder
Subject putting binary data in a char field?
Date
Msg-id D486606E7AD20947BDB7E56862E04C39474F8C@cvo1.cvo.roguewave.com
Whole thread Raw
Responses Re: putting binary data in a char field?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
I'm attempting to use spamassassin 3.0 (beta) with an SQL backend, and have
identified one performance gain so far that makes PostgreSQL a good (IMO)
candidate for the backend.  I need some advice though on another aspect--
instead of storing each token as text in the database, the token is being
sha1()'d and then possibly pack()'d.

That's all just background for my real question-- is there anything in the
standards (or elsewhere) that says you can't put binary(**) data into a char
field?  When I changed the field to a bytea, processing time was
significantly reduced.

(**) Based on what very little I know of sha1 and of the tokens that have
been created by SA, it certainly looks like it's binary data that is being
inserted into the char field.

Thanks,
-ron

pgsql-general by date:

Previous
From: mike.griffin@mygenerationsoftware.com
Date:
Subject: Re: 7.4 for Windows?
Next
From: Rory Campbell-Lange
Date:
Subject: [OT] Dilemma about OS <-> Postgres interaction