> \The problem is, lots of different people will be using this, and I'm
> trying to avoid having to put all of the various usernames in the Postgres
> shadow file by having everybody connect as user deep. I have not found
> anywhere in the documentation how to set the user with libpq; what I've
> tried here is based on analogy to the Pg Perl module (which I have been
> able to get working).
>
Try changing the owner of your C program to deep. Then set the setuid bit. At
that point anyone running your program will be user deep.