agora inbox for postgres@postgres.berkeley.edu
help / color / mirror / Atom feedNCSA and postgres dont like each other
5+ messages / 3 participants
[nested] [flat]
* NCSA and postgres dont like each other
@ 1995-07-11 04:06 Casey Claiborne <mskc@io.com>
1995-07-11 08:03 ` Re: NCSA and postgres dont like each other Stefan Golder <golder@informatik.uni-wuerzburg.de>
1995-07-11 08:40 ` Re: NCSA and postgres dont like each other Kacper Nowicki <Kacper.Nowicki@fuw.edu.pl>
0 siblings, 2 replies; 5+ messages in thread
From: Casey Claiborne @ 1995-07-11 04:06 UTC (permalink / raw)
To: legacy
Hello everyone-
I am currently using a postgres database with a NCSA httpd server.
I thought that everything was OK until I ran this piece of code below.
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.
Problem is:
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? My goal is to take data from an HTML form
and place it into the postgres database. I would like to accomplish
this from C code. Below is the way that I have approaced the problem.
Is there a better way to do this because obviously, the approch below
does not work.
Does anyone have any suggestions?
Casey => mskc@io.com
....
sprintf(final, "append (ccnamelast = \"%s\", ccnamemiddle = \'%c\',
ccnamefirstp = \"%s\" ",
customerinfo -> ccnamelast,
customerinfo -> ccnamemiddle,
customerinfo -> ccnamefirstp);
PQsetdb("DB");
PQexec("begin");
res = PQexec(final);
if (*res == 'I' )
{
printf("non-fatal error occurred ");
PQexec("end"); <= causes an error with NCSA server
return FATAL_ERROR;
}
if (*res == 'E' )
{
printf("fatal error occurred");
PQexec("end"); <= causes an error with NCSA server
return NON_FATAL_ERROR;
}
PQexec("end"); <= causes error with NCSA server
PQfinish();
return SUCCESS;
}
Casey Claiborne mskc@io.com
One must note the importance of setting reasonable and achievable goals for
"If you aim for nothing, you'll hit it every time"
============================================================================
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: NCSA and postgres dont like each other
1995-07-11 04:06 NCSA and postgres dont like each other Casey Claiborne <mskc@io.com>
@ 1995-07-11 08:03 ` Stefan Golder <golder@informatik.uni-wuerzburg.de>
1 sibling, 0 replies; 5+ messages in thread
From: Stefan Golder @ 1995-07-11 08:03 UTC (permalink / raw)
To: legacy
> 5) at the point when either 'PQexec("end")' or 'PQfinish()' are executed,
> the NCSA server screen is displayed with an error code of 500.
>
>
You should have a look at the file ~http/logs/error_log, the file where your
http-daemon reports the error messages. Usually errors are described more
exactly in this file.
Stefan Golder
golder@informatik.uni.wuerzburg.de
==============================================================================
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/
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: NCSA and postgres dont like each other
1995-07-11 04:06 NCSA and postgres dont like each other Casey Claiborne <mskc@io.com>
@ 1995-07-11 08:40 ` Kacper Nowicki <Kacper.Nowicki@fuw.edu.pl>
1 sibling, 0 replies; 5+ messages in thread
From: Kacper Nowicki @ 1995-07-11 08:40 UTC (permalink / raw)
To: Casey Claiborne <mskc@io.com>; +Cc: legacy
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/
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: NCSA and postgres dont like each other
@ 1995-07-12 05:49 Casey Claiborne <mskc@io.com>
0 siblings, 0 replies; 5+ messages in thread
From: Casey Claiborne @ 1995-07-12 05:49 UTC (permalink / raw)
To: Stefan Golder <golder@informatik.uni-wuerzburg.de>; legacy
Thank you for responding - that was it. I found that the server was
calling the database with a user of "nobody". I tried to change the database
acl list to add that but it didn't work. I then tried to "create" a user of
nobody
(thinking that this was the problem) but "adduser" wouldn't let me do it
so - I just wound up changing one of the config files for the server (the one
that indicates what userid the server runs at). Initially it was nobody, I
changed
it to one of the user names entered into my database and everything worked.
Thanks again! :^)
At 10:03 AM 7/11/95 DST), Stefan Golder wrote:
>> 5) at the point when either 'PQexec("end")' or 'PQfinish()' are executed,
>> the NCSA server screen is displayed with an error code of 500.
>>
>>
>You should have a look at the file ~http/logs/error_log, the file where your
>http-daemon reports the error messages. Usually errors are described more
>exactly in this file.
>
>Stefan Golder
>golder@informatik.uni.wuerzburg.de
>
>
>==============================================================================
> 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/
>
>
Casey Claiborne mskc@io.com
One must note the importance of setting reasonable and achievable goals for
"If you aim for nothing, you'll hit it every time"
==============================================================================
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/
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: NCSA and postgres dont like each other
@ 1995-07-12 05:53 Casey Claiborne <mskc@io.com>
0 siblings, 0 replies; 5+ messages in thread
From: Casey Claiborne @ 1995-07-12 05:53 UTC (permalink / raw)
To: Kacper Nowicki <Kacper.Nowicki@fuw.edu.pl>; +Cc: legacy
Hi-
thanks for responding. I found out that the NCSA server was being
ran with a user of "nobody". This user was not entered into the my dbase
acl list. When I changed the user in one of the NCSA config files from
"nobody" to a valid user in my database, everything worked fine :^)
Casey
At 10:40 AM 7/11/95 DST), Kacper Nowicki wrote:
>
>
>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/
>
>
Casey Claiborne mskc@io.com
One must note the importance of setting reasonable and achievable goals for
"If you aim for nothing, you'll hit it every time"
==============================================================================
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/
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~1995-07-12 05:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1995-07-11 04:06 NCSA and postgres dont like each other Casey Claiborne <mskc@io.com>
1995-07-11 08:03 ` Stefan Golder <golder@informatik.uni-wuerzburg.de>
1995-07-11 08:40 ` Kacper Nowicki <Kacper.Nowicki@fuw.edu.pl>
1995-07-12 05:49 Re: NCSA and postgres dont like each other Casey Claiborne <mskc@io.com>
1995-07-12 05:53 Re: NCSA and postgres dont like each other Casey Claiborne <mskc@io.com>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox