UnixServerAdmin

Server Administration & Management

PgSQL query failed error

Error:

Warning: pg_query() [function.pg-query]: Query failed: ERROR: permission
denied for relation cg_ref_codes in /home/user/public_html/essencial.php on line 48

Warning: pg_num_rows(): supplied argument is not a valid PostgreSQL
result resource in /home/user/public_html/essencial.php on line 50

Fix:

1. Open the pgsql configuration file.

# vi /var/lib/pgsql/data/pg_hba.conf

local   all         all                                     md5
host    all         all      127.0.0.1  255.255.255.255     md5

2. Edit the file.

local   all         all                                     md5
host    all         all      127.0.0.1  255.255.255.255    password

3. Save it.

4. Restart the postgresql service.

# /etc/init.d/postgresql REstart

November 13, 2011 Posted by | PgSQL | | Leave a comment