agora inbox for postgres@postgres.berkeley.edu  
help / color / mirror / Atom feed
Mosaic and libpq
3+ messages / 3 participants
[nested] [flat]

* Mosaic and libpq
@ 1994-05-09 21:34 Vivek Shivpuri <vivek@tis.telos.com>
  1994-05-09 22:29 ` Re: Mosaic and libpq Paul M. Aoki <aoki@postgres.Berkeley.EDU>
  0 siblings, 1 reply; 3+ messages in thread

From: Vivek Shivpuri @ 1994-05-09 21:34 UTC (permalink / raw)
  To: legacy

  
 
 A few weeks ago Russ posted the following :-

-----------------Russ's posting --------------------

 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.

 I am setting up a world-wide-web server and want to be able to use postgres to
 keep track of some things. So I've got a some data that the user inputs via
 a Mosaic form, this form get submitted to a.out, which parses it, and queries
 postgres. For some reason the program just hangs on
   PQexec("begin");

   Before I make this call the program has succesfully executed
   PQtrace();
   PQsetdb("dbname");
   buff=PQdb();

   I have tried removing all traces of the www interface and the program ran 
   succesfully, so that's why I think the problem lies there.

   Thanks
   Russ

-----------------ends ----------------

 Unfortuately no one replied to this. I am having the exact same problem.

 Any useful hints or any advice would be appreciated......I've been working
 on this problem for 2 days now....and I'm about to give up unless I get
 some help!!

 Vivek
 (vivek@tis.telos.com)


===============================================================================
    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.
===============================================================================




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Mosaic and libpq
  1994-05-09 21:34 Mosaic and libpq Vivek Shivpuri <vivek@tis.telos.com>
@ 1994-05-09 22:29 ` Paul M. Aoki <aoki@postgres.Berkeley.EDU>
  0 siblings, 0 replies; 3+ messages in thread

From: Paul M. Aoki @ 1994-05-09 22:29 UTC (permalink / raw)
  To: Vivek Shivpuri <vivek@tis.telos.com>; +Cc: legacy

Vivek Shivpuri <vivek@tis.telos.com> writes:
>  postgres. For some reason the program just hangs on
>    PQexec("begin");
> 
>    Before I make this call the program has succesfully executed
>    PQtrace();
>    PQsetdb("dbname");
>    buff=PQdb();
> 
>    I have tried removing all traces of the www interface and the program ran 
>    succesfully, so that's why I think the problem lies there.
> 
>  Unfortuately no one replied to this. I am having the exact same problem.

not knowing anything about how www clients work, it's a bit hard to 
suggest anything, but i can make the following observations:
	- somewhere in PQexec is the first attempt to make a network
	connection.
	(e.g., a child process of mosaic or httpd may not have the 
	environment set up as you might expect, which is one factor
	that may bollix the attempt to make a network connection.)
	- you have both the libpq source and a debugger; it can't be 
	*that* hard to figure out exactly what operation is blocking..?
	(i.e., run gdb on a client compiled with -g, get to the call in
	PQexec and just keeping hitting "step")

(does stderr have a place to go?  can you see what it is?)
--
  Paul M. Aoki  |  CS Div., Dept. of EECS, UCB  |  aoki@postgres.Berkeley.EDU
                |  Berkeley, CA 94720           |  ...!uunet!ucbvax!aoki

===============================================================================
    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.
===============================================================================




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Mosaic and libpq
@ 1994-05-10 11:55 Suresh Srinivasan <suresh@nlm.nih.gov>
  0 siblings, 0 replies; 3+ messages in thread

From: Suresh Srinivasan @ 1994-05-10 11:55 UTC (permalink / raw)
  To: legacy



----- 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.
===============================================================================




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~1994-05-10 11:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1994-05-09 21:34 Mosaic and libpq Vivek Shivpuri <vivek@tis.telos.com>
1994-05-09 22:29 ` Paul M. Aoki <aoki@postgres.Berkeley.EDU>
1994-05-10 11:55 Re: Mosaic and libpq Suresh Srinivasan <suresh@nlm.nih.gov>

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