Search Postgresql Archives

Re: PostgreSQL on Amazon RDS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeremy Schneider - Thanks for that psqlrc file.  Pretty informative. :-)

On Wed, May 8, 2019 at 11:55 AM Jeremy Schneider <schneider@xxxxxxxxxxxxxx> wrote:
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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux