Postgresql-Perl -->PQexec() -- there is no connection to the backend

Started by JESUS AVILA MOLINAalmost 28 years ago2 messagesgeneral
Jump to latest
#1JESUS AVILA MOLINA
avimolje@tuguri.eupmt.es

Hello PostgreSQL LIST!

My name is Jesus Avila and I'm studying Telematics Engineering.
Nowadays I'm doing the final project of the speciality and
it consists of managing the PostgreSQL through PERL language
using the Apache Server in RedHat.
The problem I have is the following:
* Everytime I try to access to the database, in a file where I
keep all the traces I find this:

UW PICO(tm) 2.9 File: pgtrace.out

PQexec() -- There is no connection to the backend.

The system is the following. I have a form in an .html file who
calls the CGI 'proba.pl' to insert the data into the data base.
The program who makes the error is attached (it's name is proba.pl).
The same error appears when I do "INSERT" and also when I do "SELECT".
In it you can see the path from the pgtrace.out and how I create it.
Could you help me? I'm desperate! I don't know how can i solve
the problem! Thank you very much in advance!

The Following things are some data that I've considered
in order to help to try to solve my problem. I have only two
weeks left to finish the project and I need the database
functioning for yesterday. So please, could you help me.
I'll be very grateful for your help.
Thank you very much in advance.

Version of the programs I use!!!
-----------------------------------

PosgreSQL version 6.3 (postgresql-6.3.2.tar.gz)
PERL version 5.004 patch 1
RedHat 5.0
Server version Apache/1.2.4.

* Accessing to the database typing "psql proba" functions, I can
INSERT, DELETE, CREATE TABLE, ...
* The database "postgres" is created.
* When I type postgres, those are the things that appears on the screen:

[postgres@localhost pgsql]$ postgres

---debug info---
Quiet = f
Noversion = f
timings = f
dates = Normal
bufsize = 64
sortmem = 512
query echo = f
DatabaseName = [postgres]
----------------

InitPostgres()..

POSTGRES backend interactive interface
$Revision: 1.67 $ $Date: 1998/02/26 04:36:31 $

-> What is the meaning of that?
-> and Which are the things you can do with that?

The configuration of the file ".bash_profile"!!!
------------------------------------------------
PATH=$PATH:$HOME/bin
ENV=$HOME/.bashrc
USERNAME="postgres"

export USERNAME ENV PATH

PATH=$PATH:/usr/local/pgsql/bin
MANPATH=$MANPATH:/usr/local/pgsql/man
PGLIB=/usr/local/pgsql/lib
PGDATA=/usr/local/pgsql/data
export PATH MANPATH PGLIB PGDATA

nohup postmaster -d > server.log 2>&1 &

If I open the file "server.log" the things I find are the folliwing:
--------------------------------------------------------------------

FindBackend: searching PATH ...
FindBackend: found "/usr/local/pgsql/bin/postgres" using PATH

The implementation of the database i try to access!!!
-----------------------------------------------------

Database    = proba
 +------------------+----------------------------------+----------+
 |  Owner           |             Relation             |   Type   |
 +------------------+----------------------------------+----------+
 | postgres         | dada                             | table    |
 +------------------+----------------------------------+----------+
Table    = dada
+----------------------------------+-----------------------------+-------+
|              Field               |              Type           | Length|
+----------------------------------+-----------------------------+-------+
| nom                              | varchar()                   |    40 |
| cog1                             | varchar()                   |    40 |
| cog2                             | varchar()                   |    40 |
| edat                             | int2                        |     2 |
| sexe                             | varchar()                   |     4 |
+----------------------------------+-----------------------------+-------+

GRANT select,insert,delete,update ON dada TO nobody;

Thank you very much another time !!!
--------------------------------

Attachments:

proba.pltext/plain; name=proba.plDownload
#2Dwight Johnson
dwj@aaronsrod.com
In reply to: JESUS AVILA MOLINA (#1)
Re: [SQL] Postgresql-Perl -->PQexec() -- there is no connection to the backend

On Mon, 15 Jun 1998, JESUS AVILA MOLINA wrote:

PQexec() -- There is no connection to the backend.

I am no expert, but I believe you must install the two
Perl modules DBI and DBD-Pg and also use them in your
Perl script. Also, look at Linux Journal, February 1998,
page 22.

Good luck,
Dwight