Return-Path: owner-postman
Received: from localhost.Berkeley.EDU (localhost.Berkeley.EDU [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.10/8.6.3) with SMTP id BAA11218 for postgres-redist; Tue, 11 Jul 1995 01:41:23 -0700
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199507110841.BAA11218@nobozo.CS.Berkeley.EDU>
X-Authentication-Warning: nobozo.CS.Berkeley.EDU: Host localhost.Berkeley.EDU didn't use HELO protocol
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: owner-postman
Received: from sunic.sunet.se (sunic.sunet.se [192.36.125.2]) by nobozo.CS.Berkeley.EDU (8.6.10/8.6.3) with ESMTP id BAA11208 for <postgres@nobozo.CS.Berkeley.EDU>; Tue, 11 Jul 1995 01:41:20 -0700
Received: from cocos.fuw.edu.pl by sunic.sunet.se (8.6.8/2.03)
	id KAA03061; Tue, 11 Jul 1995 10:40:19 +0200
Received: from ccfs1.fuw.edu.pl by cocos.fuw.edu.pl (4.1/SMI-4.1)
	id AA09667; Tue, 11 Jul 95 10:40:00 +0200
Received: by ccfs1.fuw.edu.pl (4.1/SMI-4.1)
	id AA01457; Tue, 11 Jul 95 10:40:04 +0200
Date: Tue, 11 Jul 1995 10:40:03 +0200 (MET DST)
From: Kacper Nowicki <Kacper.Nowicki@fuw.edu.pl>
X-Sender: kacper@ccfs1
To: Casey Claiborne <mskc@io.com>
Cc: postgres@postgres.Berkeley.EDU
Subject: Re: NCSA and postgres dont like each other 
In-Reply-To: <199507110406.XAA24519@tristero.io.com>
Message-Id: <Pine.SUN.3.91.950711103300.545G-100000@ccfs1>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Resent-To: postgres-redist@postgres.Berkeley.EDU
Resent-Date: Tue, 11 Jul 95 01:41:22 -0700
Resent-XMts: smtp



On Mon, 10 Jul 1995, Casey Claiborne wrote:

> What is happening is as follows:
> 
> 1) HTML form is displayed
> 2) press "submit" button on HTML form
> 3) cgi-srcipt takes data fromt the form
> 4) data from the form is sent to routine listed below for placement
> 	into database.
> 5) at the point when either 'PQexec("end")' or 'PQfinish()' are executed,
> 	the NCSA server screen is displayed with an error code of 500.

...

> 	This database routine works just fine by itself - if I take the
> code below, place it into a C routine, compile and run it, I have no
> problems at all. Everything happens as it should - information goes into the db.
> After some troubleshooting, I have found that the error occurs when either
> of the following are executed: PQexec("end") OR PQfinish()
> 
> Question is:
> 	Why is this happening? 

Hi,

It happend several times to me and I think that problem lies in 
environment. When you test this program you are probably logged as user 
xxx which is registered as postgres user.

When httpd runs this program its environment is _strange_. User is 
probably www (is it user a valid postgres user ?). Check also USER env. 
variable which is used by libpq to authenticate connection.

Kacper

P.S. The nice idea is to set PQTTY variable to log POSTGRES errors on 
server side, or to pipe both stdout and stderr to httpd.

------------------------------------------------------------------------
Kacper Nowicki                         e-mail: Kacper.Nowicki@fuw.edu.pl
Warsaw University                      =================================
Physics Department Computer Center
Hoza 69, 00-681 Warszawa, Poland       fax:(48)(22)294309,(48)(2)6226154


==============================================================================
   To add/remove yourself to/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.
==============================================================================
              URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres/
