From: Dan Wilson <phpPgAdmin@acucore.com>
To: Laukó Péter <plauko@freemail.hu>
To: pgsql-php@postgresql.org
Subject: Re: Connection problem
Date: Mon, 26 Nov 2001 07:59:26 -0700
Message-ID: <000a01c1768a$f2a5a170$8e1fadcf@danwilson> (raw)
References: <freemail.20011024233612.47743@fm3.freemail.hu>
What exactly are you trying to do here?
Depending on what you really want to do here, you need to change your
connection string to fit what you want.
In order to connect to postgres, you must specify a database. If you do not
want to connect to a database immediately, then you can use the default
database (which is usually "template1"). Otherwise, if you don't indicate a
database to which to connect, it will assume you are trying to connect to
the user's database, which by default is the same name as the user. I'm
assuming that your web server is running under the "www-data" user account.
If you explain more in detail what you want to accomplish, we will be able
to help better.
-Dan
: Hi,
: I try to connect to a PostgreSQL database from my php script, and get the
following error:
:
: Warning: Unable to connect to PostgreSQL server: FATAL 1: Database
"www-data" does not exist in the system
: catalog. in /home/lao/proj/hajnalcsillag/www/classes/DBConnection.php on
line 10
:
: The code is:
: <?
:
: class DBConnection
: {
: var $con_string;
:
: function DBConnection()
: {
: $con_string = "dbname=hajnalcsillag user=lao password=abc123
host=localhost port=5432";
: $ret = pg_connect( $this->con_string );
: }
: }
:
: ?>
:
: I could solve part of the problem by creating a user and database called
'www-data'.
: Since I have several sites on the same server, I need more independent
db-s, so this solution is not enough.
: This seems to be a configuration problem, but I don't know where to turn
off this (security?) option.
:
: The versions are:
: PHP Version 4.1.0RC1
: PostgreSQL 7.1.3
: Apache/1.3.22
: Debian sid
:
: Could anyone help me please?
: Thanks, Peter
:
: ---------------------------(end of broadcast)---------------------------
: TIP 5: Have you checked our extensive FAQ?
:
: http://www.postgresql.org/users-lounge/docs/faq.html
:
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-php@postgresql.org
Cc: phpPgAdmin@acucore.com, plauko@freemail.hu
Subject: Re: Connection problem
In-Reply-To: <000a01c1768a$f2a5a170$8e1fadcf@danwilson>
References: <freemail.20011024233612.47743@fm3.freemail.hu> <000a01c1768a$f2a5a170$8e1fadcf@danwilson>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox