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

Advertisements

November 13, 2011 - Posted by | PgSQL |

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: