Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Jun 1999 12:57:44 -0400
From:      "Jim Freeze" <jim@freeze.org>
To:        <pgsql-novice@postgreSQL.org>, <freebsd-questions@FreeBSD.ORG>
Subject:   PostgreSQL query has permission denied error
Message-ID:  <000a01beaf74$88f55840$e06ec8d0@lexmark.com>

next in thread | raw e-mail | index | archive | help
I am using FreeBSD 3.1 and netscape on a standalone system.
I have the ports install of apache, php3 and postgreSQL installed.

I have created a database called mydb with a table tableone and
two fields, fieldone and fieldtwo. I have also added two rows of
information.
My goal is to access this database from a web page.
Although I can get the name of the database, I cannot perform
queries on the databse.

The following code

 <?php
 $dbName = pg_dbname($dbc);
 if (!$dbc)
 {
   echo "An error occured.\n";
   exit;
 }

 $result = pg_Exec($dbc, "SELECT * FROM tableone");
 if (!$result)
 {
   echo "An error occured.\n";
   exit;
 }
 ?>

produces the following error

 Warning: PostgresSQL query failed: ERROR: tableone: Permission denied. in
/usr/local/www/data/php1.php3 on line 17
 An error occured.

where line 17 is

17: $result = pg_Exec($dbc, "SELECT * FROM tableone");

Since I don't understand what is going on here, I tried logging
into my BSD account as root, pgsql and postgres, and accessing
the web page, but I received the same error.

In case it helps, the following is an excerpt of my passwd file.

nobody:*:65534:65534:Unprivileged user:/nonexistent:/sbin/nologin
jfreeze:*:1001:1001:User &Jim Freeze:/usr/jfreeze:/bin/csh
pgsql:*:70:70:PostgreSQL pseudo-user:/usr/local/pgsql:/bin/sh
postgres:*:1002:1002:User &PostgreSQL SuperUser:/usr/postgres:/bin/sh

I do not know how to list the pgsql users and privelages, if that info is
needed.


Thanks for any help.


==================
Dr Jim D. Freeze
jim@freeze.org
==================



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000a01beaf74$88f55840$e06ec8d0>