Re: Feature: Use DNS SRV records for connecting - Mailing list pgsql-hackers

From Graham Leggett
Subject Re: Feature: Use DNS SRV records for connecting
Date
Msg-id 191719E9-6D3B-4E43-82F3-E7CC7871F173@sharp.fm
Whole thread Raw
In response to Feature: Use DNS SRV records for connecting  (Feike Steenbergen <feikesteenbergen@gmail.com>)
List pgsql-hackers
On 13 Aug 2019, at 11:50, Feike Steenbergen <feikesteenbergen@gmail.com> wrote:

I'd like to get some feedback on whether or not implementing a DNS SRV feature
for connecting to PostgreSQL would be desirable/useful.

A big +1.

We currently use SRV records to tell postgresql what kind of server it is. This way all of our postgresql servers have an identical configuration, they just tailor themselves on startup as appropriate:

_postgresql-master._tcp.sql.example.com.

The above record in our case declares who the master is. If the postgresql startup says “hey, that’s me” it configures itself as a master. If the postgresql startup says “hey, that’s not me” it configures itself as a slave of the master.

We also use TXT records to define the databases we want (with protection against DNS security issues, we never remove a database based on a TXT record, but signed DNS records will help here).

_postgresql.sql.example.com TXT "v=PGSQL1;d=mydb;u=myuser"

We use a series of systemd “daemons” that are configured to run before and after postgresql to do the actual configuration on bootup, but it would be great if postgresql could just do this out the box.

Regards,
Graham

Attachment

pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: Bison state table
Next
From: Amit Kapila
Date:
Subject: Re: POC: Cleaning up orphaned files using undo logs