Search Postgresql Archives

how to tell master from replica

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

 



Assuming a master & replica set up using streaming replication, hot standby, 9.3.

I'd like to have a single script on both machines distinguish whether it's running on the machine with the master or replica, and take different actions accordingly.

Is the way to do this to check for the presence of wal sender process vs wal receiver process? Or is there a query that could executed against sys tables to find current running config of the local postmaster?

-- 
Scott Ribe
scott_ribe@xxxxxxxxxxxxxxxx
http://www.elevated-dev.com/
(303) 722-0567 voice






-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general





[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