Subject: Re: Mosaic and libpq

From: [email-masked] (Suresh Srinivasan)
Date: Tue, 10 May 94 11:55:33 EDT

----- Begin Included Message -----

 I'm having problems with the libpq call PQexec.

 I'm almost positive the problem stems from trying to integrate my
 postgres and a mosaic form server. If anyone knows what I'm talking about,
 please help. Here's some more details.

...

----- End Included Message -----

I'm using just such a beast - an unmodified NCSA httpd calling
an application written in C (that uses Postgres) via CGI.

One of the gotchas in this regard is that the CGI program
has to run as user "postgres", or whoever has access to
the databases in question.  Remember the http daemon generally
runs as nobody.  So the first thing to do in the CGI program
is to putenv("USER=postgres"), or at least just before
accessing the database.

Another is that the output of the program must have the
correct MIME tag in the first line, i.e., "Content-type:
text/html" (in my case) followed by two newlines.

I have some perl scripts that will emulate the environment
that the CGI program is running in.  These were valuable in
being able to debug the application.  Send me mail if
you're interested.

--Suresh ([email-masked])

===============================================================================
    To add/remove yourself from the POSTGRES mailing list: send mail with 
    the subject line ADD or DEL to "[email-masked]"

    If this fails, send mail to "[email-masked]" and
    a human will deal with it.  DO NOT post to the "postgres" mailing list.
===============================================================================