| From: | Jeremy Schneider <schneider(at)ardentperf(dot)com> |
|---|---|
| To: | Rashmi V Bharadwaj <rvbharad(at)in(dot)ibm(dot)com>, pgsql-general(at)postgresql(dot)org |
| Subject: | Re: PostgreSQL on Amazon RDS |
| Date: | 2019-05-08 16:54:59 |
| Message-ID: | 68e89318-e125-0ca0-515d-fe96a0c9486e@ardentperf.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Mitar | 2019-05-08 17:11:54 | Re: Relaxing NaN/Infinity restriction in JSON fields |
| Previous Message | Ravi Krishna | 2019-05-08 15:55:15 | Re: Oracle Migration Approach (Open source vs Vendor Specific) |