agora inbox for postgres@postgres.berkeley.edu  
help / color / mirror / Atom feed
From: Suresh Srinivasan <suresh@nlm.nih.gov>
To: postgres@postgres.Berkeley.EDU
Subject: Re: Mosaic and libpq
Date: Tue, 10 May 94 11:55:33 EDT
Message-ID: <9405101555.AA20018@hume.csb> (raw)



----- 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 (suresh@nlm.nih.gov)


===============================================================================
    To add/remove yourself from the POSTGRES mailing list: send mail with 
    the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU"

    If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
    a human will deal with it.  DO NOT post to the "postgres" mailing list.
===============================================================================




reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: postgres@postgres.berkeley.edu
  Cc: suresh@nlm.nih.gov
  Subject: Re: Mosaic and libpq
  In-Reply-To: <9405101555.AA20018@hume.csb>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox