How to access service using LAN

Lists: pgsql-novice
From: santoso berkah <im_id(at)yahoo(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: How to access service using LAN
Date: 2003-09-15 05:04:34
Message-ID: 20030915050434.11740.qmail@web40709.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

Dear Friends,

I have a crucial problem, I try to develop an
application using Python and PostgreSQL. I try to make
a GUI using Python and i've planned to SELECT, INSERT
and UPDATE the data on the database server. For
justifications :

PC1<----------------------------> PC2
192.168.0.3/24 192.168.0.2/24
Mandrake Linux 8.2 Mandrake Linux 8.2
PostgreSQL 7.2 server Python 2.2 + GUI
Python 2.2
database: mindik attribute :
table: name, id name, id

But my problem was the Python interpreter still can't
access table in the PC1. I've open the default port:
5432 on Postgresql.conf in /var/lib/pgsql/data
I try to set up the pg_hba.conf:

localhost mindik 192.168.0.3 trust

I try the interpreter in PC1:
>>>import pg
>>>select=database_query("SELECT name FROM mindik
WHERE id=(13920)")
The message from the Python interpreter :
There is an error setting on the file pg_hba.conf.

Is there anyone who can help my problems, please ?
Thank's for those who able to help me.

Best regards,

Santoso

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: santoso berkah <im_id(at)yahoo(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: How to access service using LAN
Date: 2003-09-15 05:17:32
Message-ID: 3616.1063603052@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

santoso berkah <im_id(at)yahoo(dot)com> writes:
> The message from the Python interpreter :
> There is an error setting on the file pg_hba.conf.

[blink] I'm pretty certain there is no Postgres-related code that would
produce an error message spelled just that way. Could we see the exact
error message, not a translation, please? Also it would be useful for
you to look into the postmaster's stderr log to see what is reported
there.

regards, tom lane


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: santoso berkah <im_id(at)yahoo(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: How to access service using LAN
Date: 2003-09-15 05:45:37
Message-ID: 3825.1063604737@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

santoso berkah <im_id(at)yahoo(dot)com> writes:
> I try to set up the pg_hba.conf:

> localhost mindik 192.168.0.3 trust

BTW, this is certainly wrong... PG 7.2 supports these two syntaxes:

# Unix sockets:
local all trust
# TCP sockets:
host all 127.0.0.1 255.255.255.255 trust

You might perhaps also want
host all 192.168.0.3 255.255.255.255 trust
or
host all 192.168.0.0 255.255.255.0 trust
depending on your local network setup.

regards, tom lane


From: santoso berkah <im_id(at)yahoo(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: How to set up postgres user
Date: 2003-09-18 23:38:29
Message-ID: 20030918233829.42164.qmail@web40711.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

Hello Tom,

I try to follow your instruction to set up the
pg_hba.conf and it was worked. Thanks for your help.

And i have some trouble :
When i try to connect the Python file and PostgreSQL
service (under postgres user), it was works, but when
i try the GUI application using Tkinter, there was an
error messages:

bash-2.05$ python InputBiodataAdministrasiwithDB.py
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

Traceback (most recent call last):
File "InputBiodataAdministrasiwithDB.py", line 24, in
?
root = Tk()
File "/usr/lib/python2.2/lib-tk/Tkinter.py", line
1487, in __init__
Tclerror: couldn't connect to display ":0"

Can you tell me how to fix the problem:
1. To make the user postgres have the authority for
acessing xserver (Xwindow).
2. To make the other user such as John to have an
access as same as the user postgres.

Thank you very much for your help.

Best Regards,

Santoso

--- Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> santoso berkah <im_id(at)yahoo(dot)com> writes:
> > I try to set up the pg_hba.conf:
>
> > localhost mindik 192.168.0.3 trust
>
> BTW, this is certainly wrong... PG 7.2 supports
> these two syntaxes:
>
> # Unix sockets:
> local all
> trust
> # TCP sockets:
> host all 127.0.0.1 255.255.255.255
> trust
>
> You might perhaps also want
> host all 192.168.0.3 255.255.255.255
> trust
> or
> host all 192.168.0.0 255.255.255.0
> trust
> depending on your local network setup.
>
> regards, tom lane
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to
majordomo(at)postgresql(dot)org

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com


From: santoso berkah <im_id(at)yahoo(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: How to set up postgres user
Date: 2003-09-20 23:14:30
Message-ID: 20030920231430.30793.qmail@web40705.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice


Hello Friends,

I try to follow your instruction to set up the
pg_hba.conf and it was worked. Thanks for your help.

And i have some trouble :
When i try to connect the Python file and PostgreSQL
service (under postgres user), it was works, but
when
i try the GUI application using Tkinter, there was
an
error messages:

bash-2.05$ python InputBiodataAdministrasiwithDB.py
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

Traceback (most recent call last):
File "InputBiodataAdministrasiwithDB.py", line 24,
in
?
root = Tk()
File "/usr/lib/python2.2/lib-tk/Tkinter.py", line
1487, in __init__
Tclerror: couldn't connect to display ":0"

Can you tell me how to fix the problem:
1. To make the user postgres have the authority for
acessing xserver (Xwindow).> 2. To make the other
user such as John to have an
access as same as the user postgres.

Thank you very much for your help.

Best Regards,

Santoso

> --- Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > santoso berkah <im_id(at)yahoo(dot)com> writes:
> > > I try to set up the pg_hba.conf:
> >
> > > localhost mindik 192.168.0.3 trust
> >
> > BTW, this is certainly wrong... PG 7.2 supports
> > these two syntaxes:
> >
> > # Unix sockets:
> > local all
>
> > trust
> > # TCP sockets:
> > host all 127.0.0.1
> 255.255.255.255
> > trust
> >
> > You might perhaps also want
> > host all 192.168.0.3
> 255.255.255.255
> > trust
> > or
> > host all 192.168.0.0 255.255.255.0
>
> > trust
> > depending on your local network setup.
> >
> > regards, tom lane
> >
> > ---------------------------(end of
> > broadcast)---------------------------
> > TIP 1: subscribe and unsubscribe commands go to
> majordomo(at)postgresql(dot)org
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site
> design software
> http://sitebuilder.yahoo.com
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please
> send an appropriate
> subscribe-nomail command to
> majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list
cleanly

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com