Re: Pragma autonomous transactions in Postgres/ Certification based authentication in DB Links

Jonathan Katz <jonathan.katz@excoventures.com>

From: Jonathan Katz <jonathan.katz@excoventures.com>
To: aditya desai <admad123@gmail.com>
Cc: pgsql-sql <pgsql-sql@lists.postgresql.org>
Date: 2021-12-17T16:11:55Z
Lists: pgsql-sql

> On Dec 17, 2021, at 10:43 AM, aditya desai <admad123@gmail.com> wrote:
> 
> Hi,
> Is there any way to achieve autonomous transactions in Postgres? There is a way to do it by using DB Link. However DB Link involves user name and password which is a bit of a security threat.
> 
> How to use certificate based authentication in DB Links instead of hardcoding user name and password in it?

dblink lets you pass in a PostgreSQL connection string[1].
From there you can reference parameters to use certificates[2].

Jonathan

[1] https://www.postgresql.org/docs/current/contrib-dblink-connect.html <https://www.postgresql.org/docs/current/contrib-dblink-connect.html>
[2] https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS