Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bitwise operators for bytea

50 views
Skip to first unread message

Nick Johnson

unread,
Mar 22, 2005, 10:52:34 PM3/22/05
to
Is there any particular reason there are no bitwise operators (I'm
looking for XOR, specifically) for the bytea data type? Any plans to
add them?

What I'm trying to do is store an SHA-1 hash in the database, and
create a trigger that runs on insert or update and updates a 'running
hash' record in another table by xoring it with the new (and in the
case of an update, old) hash. The best candidates are bytea, but that
has no xor operation, or bit(n), but there's no way to convert back to
hexadecimal from it.

Also, is there any particular reason sha1() is still not in PGSQL? I
know it's in pgcrypto, but shouldn't it be in main? MD5 is, and that's
now deprecated.

0 new messages