PGObject::Util::Replication::SMO - Replication Server Management Objects!
Version 1
This is intended to be a base class for server management objects for specific roles (master, standby, etc). It consolidates the PostgreSQL logic for these. It is not currently intended to be directly used though it could for basic configuration.
use PGObject::Util::Replication::SMO; my $server = PGObject::Util::Replication::SMO->new(); # local pg $server->slots(); # replication slots my $config = $server->config;
This module provides a wrapper around the config handlers and replication slots.
Hostname or IP address
defaults to 5432
Username for the connection string. If not provided, dbi defaults to the username for the system user of the script running this module
Password for connecting, if needed based on pg_hba.conf settings
Database name for connecting. Defaults to postgres
Whether to autocommit statements. This defaults to true.
If set, save the connection for repeated use. Defaults to off which means we reconnect for each operation.
Set to true if you are doing a lot of operations.
This is the variables we read or write. It is intended to be unmodified as it is.
Returns a DBI connection to the database and checks to make sure we are not in recovery. If we are in recovery, an exception is thrown.
Disconnect, if using persist_connect
Returns true if the database is in recovery mode and false if not. Typically in replication environments, standby databases will always be in recovery mode while master systems should generally not be.
Returns true if the user credentials allow us to create and manage replication slots.
This requires either superuser or replication attributes for the user.
Lists all replication slots, their lags, etc.
Returns info from a single named slot
Adds a named replication slot
Deletes a named replication slot
Reads all settings from the pg instance.
Adds one more config setting to the managed list and sets it to the default
Sets a config value for later config file writing.
Returns a file of the structure of the config file, based on all managed values.
Chris Travers, <chris.travers at adjust.com>
<chris.travers at adjust.com>
Please report any bugs or feature requests to bug-pgobject-util-replication-smo at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=PGObject-Util-Replication-SMO. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-pgobject-util-replication-smo at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc PGObject::Util::Replication::SMO
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=PGObject-Util-Replication-SMO
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/PGObject-Util-Replication-SMO
CPAN Ratings
http://cpanratings.perl.org/d/PGObject-Util-Replication-SMO
Search CPAN
http://search.cpan.org/dist/PGObject-Util-Replication-SMO/
Copyright 2017 Adjust.com
This program is distributed under the (Revised) BSD License: http://www.opensource.org/licenses/BSD-3-Clause
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of Adjust.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
To install PGObject::Util::Replication::SMO, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PGObject::Util::Replication::SMO
CPAN shell
perl -MCPAN -e shell install PGObject::Util::Replication::SMO
For more information on module installation, please visit the detailed CPAN module installation guide.