putting binary data in a char field?

From: Ron Snyder <snyder(at)roguewave(dot)com>
To: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: putting binary data in a char field?
Date: 2004-06-17 20:04:22
Message-ID: D486606E7AD20947BDB7E56862E04C39474F8C@cvo1.cvo.roguewave.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas F. O'Connell 2004-06-17 21:34:08 pg_dump out of shared memory
Previous Message mike.griffin 2004-06-17 19:40:25 Re: 7.4 for Windows?