Re: Making server name part of the startup message

From: Satyanarayana Narlapuram <Satyanarayana(dot)Narlapuram(at)microsoft(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Making server name part of the startup message
Date: 2017-06-21 19:38:39
Message-ID: DM2PR03MB416323EBDB6ED9BD015198691DA0@DM2PR03MB416.namprd03.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

PgBouncer for example assumes that the database names are unique across the database clusters it is serving. Our front-end Gateways can serve tens of thousands of Postgres servers spanning multiple customers, and organizations, and enforcing the database names being unique is not possible for the users of the service.

> For the original idea in this thread, using something like dbname(at)server seems a more logical choice than username(at)server(dot)

We considered this option but connecting to the database from the GUI tools is not very intuitive / possible. Also /c switch in Psql requires including full cluster_name every time user connect to a different database.

Thanks,
Satya
From: Magnus Hagander [mailto:magnus(at)hagander(dot)net]
Sent: Thursday, June 15, 2017 9:24 AM
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>; Satyanarayana Narlapuram <Satyanarayana(dot)Narlapuram(at)microsoft(dot)com>; pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] Making server name part of the startup message

On Thu, Jun 15, 2017 at 5:57 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us<mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us>> wrote:
Alvaro Herrera <alvherre(at)2ndquadrant(dot)com<mailto:alvherre(at)2ndquadrant(dot)com>> writes:
> Tom Lane wrote:
>> This makes no sense at all. The client is telling the server what the
>> server's name is?

> I think for instance you could have one pgbouncer instance (or whatever
> pooler) pointing to several different servers. So the client connects
> to the pooler and indicates which of the servers to connect to.

I should think that in such cases, the end client is exactly not what
you want to be choosing which server it gets redirected to. You'd
be wanting to base that on policies defined at the pooler. There are
already plenty of client-supplied attributes you could use as inputs
for such policies (user name and application name, for instance).
Why do we need to incur a protocol break to add another one?

The normal one to use for pgbonucer today is, well, "database name". You can then have pgbouncer map different databases to different backend servers. It's fairly common in my experience to have things like "dbname" and "dbname-ro" (for example) as different database names with one mapping to the master and one mapping to a load-balanced set of standbys, and things like that. ISTM that using the database name is a good choice for that.

For the original idea in this thread, using something like dbname(at)server seems a more logical choice than username(at)server(dot)

TBH, so maybe I'm misunderstanding the original issue?

--
Magnus Hagander
Me: https://www.hagander.net/<https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.hagander.net%2F&data=02%7C01%7CSatyanarayana.Narlapuram%40microsoft.com%7Cf43f90262f6d40ee419b08d4b40ae033%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636331406193392642&sdata=eA8FqyXqqKKc7xTjciwjp4TWY8LqxJIJihD2t3hGO9M%3D&reserved=0>
Work: https://www.redpill-linpro.com/<https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.redpill-linpro.com%2F&data=02%7C01%7CSatyanarayana.Narlapuram%40microsoft.com%7Cf43f90262f6d40ee419b08d4b40ae033%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636331406193392642&sdata=UwV7vawHILPH%2FbNCSonDx6vhIkYc8jX3Z6t%2BhuiEpFw%3D&reserved=0>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Satyanarayana Narlapuram 2017-06-21 19:42:48 Re: Making server name part of the startup message
Previous Message Peter Eisentraut 2017-06-21 19:17:20 Re: Logical replication launcher never been restarted when terminated