Re: Connecting to Postgresql without IP address

From: Ben Madin <ben(at)ausvet(dot)com(dot)au>
To: "sivapostgres(at)yahoo(dot)com" <sivapostgres(at)yahoo(dot)com>
Cc: Postgresql General Group <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Connecting to Postgresql without IP address
Date: 2021-07-01 00:45:18
Message-ID: CA+weYr2utSA0yNSK3Bs7zwhm3GOH1Wi9_fbCSar5GRWegA0hzg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Your connection string will work as long as there is a DNS entry for
PGServer.

Your pg_hba.conf will however need to have an IP address/netmask. So if you
are connecting from within your local network, you can put something like:

hostssl all all 192.168.0.0/16 md5

Hth?

On Wed, 30 Jun 2021 at 15:54, sivapostgres(at)yahoo(dot)com <sivapostgres(at)yahoo(dot)com>
wrote:

> Hello,
>
> Using PostgreSQL 11
>
> Currently connecting PostgreSQL database from our Powerbuilder application
> using the IPAddress as Server Name through ODBC driver. Would like to know
> whether we can connect naming the computername instead of IP Address ? If
> yes, what info to be entered in pg_hba.config file ?
>
> My connection string is :
> "ConnectString='Driver=PostgreSQL
> Unicode;Database=dbname;Server=192.168.1.21;Port=5432;UID=user;PWD=pass;',DisableBind=1"
>
> Here Server is assigned with IP Address of the computer where PostgreSQL
> is installed.
> I think of doing it with
> "ConnectString='Driver=PostgreSQL Unicode;Database=dbname;Server=
> *PGServer*;Port=5432;UID=user;PWD=pass;',DisableBind=1"
>
> Is it possible ?
>
> Happiness Always
> BKR Sivaprakash
>
> --
--

Sent from my iPhone.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2021-07-01 02:41:57 Re: Ubuntu 14.04 (trusty) Postgres 13 deb package
Previous Message Bhavesh Mistry 2021-07-01 00:40:29 Re: Ubuntu 14.04 (trusty) Postgres 13 deb package