I've found that if you load postgresql and then load sha2 (but not the other way around), you get a segmentation fault when you use one of the digest functions. I have reduced the problem to this:
Compiled with csc -v scratch.scm -L`pg_config --libdir` -lpq, this causes a segmentation fault. Without libpq, it works fine.
This appeared in old, previously working code after both rebuilding Chicken and updating just about everything else on my system, including libpq, to the newest debian unstable packages. Everything else, including postgresql, seems to work.