pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
PostgreSQL on Amazon RDS
4+ messages / 4 participants
[nested] [flat]

* PostgreSQL on Amazon RDS
@ 2019-05-07 06:27 Rashmi V Bharadwaj <rvbharad@in.ibm.com>
  2019-05-07 07:49 ` Re: PostgreSQL on Amazon RDS Nicklas Avén <nicklas.aven@jordogskog.no>
  2019-05-08 16:54 ` Re: PostgreSQL on Amazon RDS Jeremy Schneider <schneider@ardentperf.com>
  0 siblings, 2 replies; 4+ messages in thread

From: Rashmi V Bharadwaj @ 2019-05-07 06:27 UTC (permalink / raw)
  To: pgsql-general

<font face="Verdana,Arial,Helvetica,sans-serif" size="2"><div>Hi,</div><div><br></div><div>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?</div><div><br></div><div>Thanks,</div><div>Rashmi<br></div></font><BR>






^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: PostgreSQL on Amazon RDS
  2019-05-07 06:27 PostgreSQL on Amazon RDS Rashmi V Bharadwaj <rvbharad@in.ibm.com>
@ 2019-05-07 07:49 ` Nicklas Avén <nicklas.aven@jordogskog.no>
  1 sibling, 0 replies; 4+ messages in thread

From: Nicklas Avén @ 2019-05-07 07:49 UTC (permalink / raw)
  To: ; +Cc: Rashmi V Bharadwaj <rvbharad@in.ibm.com>; pgsql-general@lists.postgresql.org

On 5/7/19 9:25 AM, Rashmi V Bharadwaj wrote:
> Hi,
>
> That query will only give the PostgreSQL database server's IP address 
> right? That is true while we do a remote access to the non-cloud 
> database from another machine also.
> I want to know if there is anything specific that can be used to 
> determine a cloud environment.
>
> -Rashmi
>
> -----"Nicklas Avén" <nicklas.aven@jordogskog.no 
> <mailto:nicklas.aven@jordogskog.no>> wrote: -----
> To: Rashmi V Bharadwaj <rvbharad@in.ibm.com <mailto:rvbharad@in.ibm.com>>
> From: "Nicklas Avén" <nicklas.aven@jordogskog.no 
> <mailto:nicklas.aven@jordogskog.no>>
> Date: 07/05/2019 12:46PM
> Subject: Re: PostgreSQL on Amazon RDS
>
> Hi
>
>
> You can resolv the ip-address
>
>
> select inet_server_addr();
>
>
> /Nicklas
>
>
>
> On 5/7/19 8:27 AM, Rashmi V Bharadwaj wrote:
>> Hi,
>>
>> 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?
>>
>> Thanks,
>> Rashmi
>>
>


Sorry I didn't reply to list last time, and I top posted. I will be 
banned :-)


Well, that is true that you will get an ip-address in both cases, but in 
one case the ip-address will point to a cloud server and in the other 
case to some other server.

What you define as a cloud server is up to you.


I don't fully understand what you are want to get. I mean the postgresql 
installation doesn't have any definition about what is a cloud server 
and what is not.

Some vendors probably have some special settings that can be detected, 
but you can install postresql on any server, hosted by you, a company, a 
company named Amazon or whatever.

 From the ip-address you might be able to find out if it seems to be an 
rds server.

But I see that it seems to only give the private address in Amazon rds. 
So then it might be difficult.

So, back to your original question.

I don't think there are anything specific for a cloud installation since 
a cloud server is just a server like any other server.

If there is something special it is vendor specific.


/Nicklas

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: PostgreSQL on Amazon RDS
  2019-05-07 06:27 PostgreSQL on Amazon RDS Rashmi V Bharadwaj <rvbharad@in.ibm.com>
@ 2019-05-08 16:54 ` Jeremy Schneider <schneider@ardentperf.com>
  2019-05-18 22:33   ` Re: PostgreSQL on Amazon RDS Alex Aquino <alexaquino@gmail.com>
  1 sibling, 1 reply; 4+ messages in thread

From: Jeremy Schneider @ 2019-05-08 16:54 UTC (permalink / raw)
  To: Rashmi V Bharadwaj <rvbharad@in.ibm.com>; 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





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: PostgreSQL on Amazon RDS
  2019-05-07 06:27 PostgreSQL on Amazon RDS Rashmi V Bharadwaj <rvbharad@in.ibm.com>
  2019-05-08 16:54 ` Re: PostgreSQL on Amazon RDS Jeremy Schneider <schneider@ardentperf.com>
@ 2019-05-18 22:33   ` Alex Aquino <alexaquino@gmail.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Alex Aquino @ 2019-05-18 22:33 UTC (permalink / raw)
  To: Jeremy Schneider <schneider@ardentperf.com>; +Cc: Rashmi V Bharadwaj <rvbharad@in.ibm.com>; pgsql-general

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

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

^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2019-05-18 22:33 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-05-07 06:27 PostgreSQL on Amazon RDS Rashmi V Bharadwaj <rvbharad@in.ibm.com>
2019-05-07 07:49 ` Nicklas Avén <nicklas.aven@jordogskog.no>
2019-05-08 16:54 ` Jeremy Schneider <schneider@ardentperf.com>
2019-05-18 22:33   ` Alex Aquino <alexaquino@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox