473,669 Members | 2,514 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Connexion to Postgresql using TCP/IP

Hello !

I use a PostgreSQL server 7.4 on Linux Mandrake 10 with IP 192.168.0.15,
a database gestix is created.
An PostegreSQL user "postgres" id defined on this server,
I add in the .bash_profile of this user the line :
PGDATA=$HOME/data; export PGDATA
My PC have IP 192.168.0.10.
in postgresql.conf I have :
tcpip_socket = true
in pg_hba.conf I add :
host all all 192.168.0.10 255.255.255.255 trust
(I know, I shoul'd use better identification, it's for testing)

When I log as postgres if I use :
pg_ctl start
the postmaster is coming up,
I can connect from the PC with PgAdmin3 under Windows XP.

On automatic startup, or when I use :
service postgresql start
I can't connect from the PC. I get the message :
FATAL : no pg_hba.conf entry for host "192.168.0. 10", user "postgres", database "gestix", SSL off

I don't understand my error (probably I made one ?)
I'm becoming mad !

What's the matter ?

Best regards.

Luc ROLLAND
Nov 23 '05 #1
3 2541
=?iso-8859-1?Q?Secr=E9tari at?= <et*@rolland-fr.com> writes:
I use a PostgreSQL server 7.4 on Linux Mandrake 10 with IP 192.168.0.15,
a database gestix is created.
An PostegreSQL user "postgres" id defined on this server,
I add in the .bash_profile of this user the line :
PGDATA=$HOME/data; export PGDATA When I log as postgres if I use :
pg_ctl start
the postmaster is coming up,
I can connect from the PC with PgAdmin3 under Windows XP. On automatic startup, or when I use :
service postgresql start
I can't connect from the PC.


It sounds like the service-start case is picking a different data
directory than you're expecting --- likely /var/lib/postgres, or
whatever the installation default is.

I'm not sure what's in Mandrake 10, but I can tell you that in the Red
Hat RPMs, putting a PGDATA definition into ~/.bash_profile did not work
until very very recently. The init script did
su - postgres -s /bin/sh -c "postmaster ..."
thus forcing /bin/sh to be used, and /bin/sh won't pay any attention
to ~/.bash_profile.

This is fixed in recent RPMs (basically by removing "-s /bin/sh"), or
you can dodge the problem by copying the variable definitions into
regular sh's ~/.profile.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddres sHere" to ma*******@postg resql.org)

Nov 23 '05 #2
----- Original Message -----
From: "Tom Lane" <tg*@sss.pgh.pa .us>
To: "Secrétaria t" <et*@rolland-fr.com>
Cc: <pg***********@ postgresql.org>
Sent: Friday, July 23, 2004 4:33 PM
Subject: Re: [GENERAL] Connexion to Postgresql using TCP/IP

=?iso-8859-1?Q?Secr=E9tari at?= <et*@rolland-fr.com> writes:
I use a PostgreSQL server 7.4 on Linux Mandrake 10 with IP 192.168.0.15,
a database gestix is created.
An PostegreSQL user "postgres" id defined on this server,
I add in the .bash_profile of this user the line :
PGDATA=$HOME/data; export PGDATA

When I log as postgres if I use :
pg_ctl start
the postmaster is coming up,
I can connect from the PC with PgAdmin3 under Windows XP.

On automatic startup, or when I use :
service postgresql start
I can't connect from the PC.


It sounds like the service-start case is picking a different data
directory than you're expecting --- likely /var/lib/postgres, or
whatever the installation default is.

I'm not sure what's in Mandrake 10, but I can tell you that in the Red
Hat RPMs, putting a PGDATA definition into ~/.bash_profile did not work
until very very recently. The init script did
su - postgres -s /bin/sh -c "postmaster ..."
thus forcing /bin/sh to be used, and /bin/sh won't pay any attention
to ~/.bash_profile.

This is fixed in recent RPMs (basically by removing "-s /bin/sh"), or
you can dodge the problem by copying the variable definitions into
regular sh's ~/.profile.

regards, tom lane


You are perfectly right !

I edit /etc/rc.d/init.d/postgresql,
and I replace the values for PGDATA with the path to my database.
Now I can connect the PC when I use :
service postgresql start

It was due to an update from PG 7.3 to PG 7.4 who has modified the init
script postgresql !
Is it possible to avaid this problem by using the :
/etc/sysconfig/pgsql
How ?

On Mandrake 9.2 & 10 putting PGDATA in the .bash_profile file,
works when using the pg_ctl command in the command line (if using bash for
this user).

Many thanks !
Luc Rolland
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #3
=?iso-8859-1?Q?Secr=E9tari at?= <et*@rolland-fr.com> writes:
I edit /etc/rc.d/init.d/postgresql,
and I replace the values for PGDATA with the path to my database.
Now I can connect the PC when I use :
service postgresql start It was due to an update from PG 7.3 to PG 7.4 who has modified the init
script postgresql !
That's exactly why it's considered a bad idea to edit an init script
directly --- since it's a package-supplied file, it'll be overwritten
any time you update the package.
Is it possible to avaid this problem by using the :
/etc/sysconfig/pgsql


That's what it's for --- you put the variable definitions in there
instead, and they'll not be touched in a package update.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5006
by: cyril | last post by:
Bonjour à tous, j'utilise Apache php et mysql sans probleme, j'ai voulu passer pour des raisons pro sur IIS PHP MS SQL.IIS et PHP fonctionne bien, j ai decommenté la ligne pour ms sql, copier la dll au bon endroit, crée un DSN qui fonctionne en ASP. Impossible de me connecter en php avec mon code : $connection = mssql_connect("nom_serveur","admin","pass"); if (!$connection) { echo "connexion impossible!"; exit; } Mon serveur SQL...
1
2166
by: Otis Green | last post by:
Vote for or against a new newsgroup proposal. To summarize what you need to do, just send an empty e-mail to postgresql-ballot@netagw.com You will receive a ballot by e-mail. Follow the instructions and vote. _______________________________________________________________________ FIRST CALL FOR VOTES (of 2)
1
2829
by: Mateusz [PEYN] Adamus | last post by:
Hi I'm a developer currently wondering which DB choose for my next project. I looked on the net found ofcourse Oracle but also came up with PostgreSQL. I heard quite few things about it, all good so I'm wondering how really it is. Till now I've been working on MSSQL and Interbase. So PostgreSQL and Oracle are pretty new to me. I would have to learn them from the start there for I have to make a wise decision :D
2
7203
by: elsC | last post by:
Bonjour, Je viens d'installer SQL Server 2000 Dev edition. J'ai créé des connexions sécurisées SQL Server et pourtant lorsque j'essaie de me connecter avec PHP (mssql_connect('localhost', 'uselsC', '333')) j'obtiens cette erreur:
13
7279
by: Zlatko Matiæ | last post by:
Is it possible to use Access as front-end for POstgreSQL and how ? What about Access Projects (.adp) and PostgreSQL ?
0
1052
by: ThomasB | last post by:
hello all, and first sorry for my bad english. I'm trying to implement a way to enable unique connexion for user to a web site with VWExpress, dotnet 2. I use profile to store user information, and so i try this : 1) when a user authenticate (in global.asax), i save the session ID to the profile if the old profile value is nothing, 2) if the old profile value isnot nothing, i try to delete the old/other session.
2
2421
by: Serge Fournier | last post by:
Hello everyone. How to give the connexion information to a crystal report at run time ? same question concerning the SQL string for data extraction ? Is it "a must" to disconnect the report at the end of its conception under VStudio ? Thanks for any advice.
1
1110
by: phil campaigne | last post by:
On Mon, 1 Mar 2004, phil campaigne wrote: >> Nigel J. Andrews wrote: >> > > >>> >On Mon, 1 Mar 2004, Phil Campaigne wrote: >>> > >>> >
0
1446
by: tsic | last post by:
Bonjour, Voilà, j'ai débuté recemment avec python et je veux faire une connexion client serveur (windows) par l'intermédiaire d'une interface QT Designer v 4. j'ai choisi ERIC v 4 comme IDE. l'interface QT contient 2 champs Edittext(recep , emmision) l'un est réservé aux messages emis par le client et l'autre pour les messages renvoyés par le serveur; et un bouton connexion(conec). le probléme, c'est qu'il y a eu une "petite" connexion...
0
8466
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8384
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8896
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8590
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8659
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7410
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4208
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4387
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1790
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.