Re: PostgreSQL on Amazon RDS - Mailing list pgsql-general

From Jeremy Schneider
Subject Re: PostgreSQL on Amazon RDS
Date
Msg-id 68e89318-e125-0ca0-515d-fe96a0c9486e@ardentperf.com
Whole thread Raw
Responses Re: PostgreSQL on Amazon RDS
List pgsql-general
On 5/6/19 23:27, Rashmi V Bharadwaj wrote:
> Is there a SQL query or a database parameter setting that I can use from
> an external application to determine if the PostgreSQL database is on
> cloud (like on Amazon RDS or IBM cloud) or on a non-cloud on-prem
> environment?

Here's my psqlrc file which has pretty solid logic for detecting between
Community PostgreSQL, RDS PostgreSQL and Aurora PostgreSQL.  Note that
it just assumes "community/oss" as a default if it doesn't detect the
other two.  Should be easy enough to add detection of other hosted
environments into the query with the "priority" column (as long as
there's a reliable way to detect).

https://gist.github.com/ardentperf/52bd418e44b1be26d7b63af21331cece

This psqlrc also detects read-write versus read-only (e.g. hot standby),
and the usual username/database/superuser info and builds everything
into the prompt in a way that suits me.

-Jeremy

-- 
http://about.me/jeremy_schneider



pgsql-general by date:

Previous
From: Ravi Krishna
Date:
Subject: Re: Oracle Migration Approach (Open source vs Vendor Specific)
Next
From: Mitar
Date:
Subject: Re: Relaxing NaN/Infinity restriction in JSON fields