Archive

Archive for June, 2010

Remotely Access Postgresql from different clients

June 21, 2010 2 comments

Step 1:

Open pg_hba.conf and postgresql.conf using below commands.

$ sudo gedit /etc/postgresql/8.4/main/postgresql.conf

$ sudo gedit /etc/postgresql/8.4/main/pg_hba.conf

Setp 2:

change the line listen_addresses =’localhost’ in postgresql.conf to listen_addresses=’*’

save the file

Step 3:

insert a new line under IPv4 local connections

host        all        all        192.168.1.0 255.255.255.0         trust

and save the file. Above mention IP  is the IP range that will connect to postgresql server

Step 4:

restart the postgresql service using below command.

sudo /etc/init.d/postgresql-8.4 restart

Step 5:

from postgresql client connect with postgresql server using following information

host: postgresql server ip

port: 5432

username: postgresql server username

password: password of above mention user name

Note: if clients gives error then try to connect after setting firewall off at postgresql server or define a new profile for this above mention port and IP in firewall.

Categories: OpenERP, Postgresql

Python SyntaxError: Non-ASCII character ‘\xe2’ in file

June 10, 2010 14 comments

When executing a python script you get the following error:

SyntaxError: Non-ASCII character ‘\xe2’ in file pro.py on line 11, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

Solution:

Add the below line at top of the .py file

# coding: utf-8

Categories: Python