• Stars
    star
    168
  • Rank 225,507 (Top 5 %)
  • Language PLpgSQL
  • Created over 12 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PostgreSQL extension which provides persistent logging within transactions and functions.

Build Status PGXN version

pg_jobmon

pg_jobmon is a PostgreSQL extension designed to add autonomous logging capabilities to transactions and functions. The logging is done in a NON-TRANSACTIONAL method, so that if your function/transaction fails for any reason, any information written to that point will be kept in the log tables rather than rolled back.

For more information on how to use pg_jobmon, please see pg_jobmon/doc/pg_jobmon.md

INSTALLATION

Requirements: PostgreSQL 9.2+, dblink extension

In the directory where you downloaded pg_jobmon run

make
make install

Log into PostgreSQL and run the following commands: (Note: You can change the schema name to be whatever you wish, but it cannot be changed after installation.)

CREATE SCHEMA jobmon;
CREATE EXTENSION pg_jobmon SCHEMA jobmon;

This extension uses dblink to connect back to the same database that pg_jobmon is running in (this is how the non-transactional magic is done). To allow non-superusers to use dblink, you'll need to enter role credentials into the dblink_mapping_jobmon table that pg_jobmon installs.

INSERT INTO jobmon.dblink_mapping_jobmon (username, pwd) VALUES ('rolename', 'rolepassword');

Ensure you add the relevant line to the pg_hba.conf file for this role. It will be connecting back to the same postgres database locally.

# TYPE  DATABASE       USER            ADDRESS                 METHOD
local   dbname         rolename                                md5

The following permissions should be given to the above role (substitute relevant schema names as appropriate):

grant usage on schema jobmon to rolename;
grant usage on schema dblink to rolename;
grant select, insert, update, delete on all tables in schema jobmon to rolename;
grant execute on all functions in schema jobmon to rolename;
grant all on all sequences in schema jobmon to rolename;

If you're running PostgreSQL on a port other than the default (5432), you can also use the dblink_mapping_jobmon table to change the port that dblink will use.

INSERT INTO jobmon.dblink_mapping_jobmon (port) VALUES ('5999');

Be aware that the dblink_mapping_jobmon table can only have a single row, so if you're using a custom host, role or different port, you will need to enter those values within a single row. None of the columns are required, so just use the ones you need for your setup.

INSERT INTO jobmon.dblink_mapping_jobmon (host, hostaddr, username, pwd, port) VALUES ('host', 'hostaddr', 'rolename', 'rolepassword', '5999');

UPGRADE

Make sure all the upgrade scripts for the version you have installed up to the most recent version are in the $BASEDIR/share/extension folder.

ALTER EXTENSION pg_jobmon UPDATE TO '<latest version>';

For detailed change logs of each version, please see the top of each update script.

LICENSE AND COPYRIGHT

pg_jobmon is released under the PostgreSQL License, a liberal Open Source license, similar to the BSD or MIT licenses.

Copyright (c) 2015-2018 OmniTI, Inc.

Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.

IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE AUTHOR HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

More Repositories

1

jsend

JSend is a specification for a simple, no-frills, JSON based format for application-level communication.
1,468
star
2

pg_amqp

AMQP Support for Postgres
C
203
star
3

omnipitr

Advanced WAL File Management Tools for PostgreSQL
Perl
177
star
4

pg_extractor

PG Extractor - Advanced PostgreSQL Dump Filter
Python
161
star
5

pgtreats

Tasty treats for PostgreSQL
Perl
111
star
6

ansible-dk

An omnibus-based toolkit for working on Ansible-based infrastructure code.
Ruby
85
star
7

mimeo

Extension for specialized, per-table replication between PostgreSQL instances
PLpgSQL
78
star
8

jlog

JLog - Journaled Log
C
53
star
9

zetaback

Zetaback is a thin-agent based ZFS backup tool. It is designed to help simplify the task of backing up thousands of filesystems on hundreds of machines across and organization. It simplifies the task of automatically picking up newly created ZFS filesystems for backup purposes and restoring any given backup (host/FS/timestamp) to a target ZFS capable host.
Perl
39
star
10

omnios-build

Build system for OmniOS - Note, this is a quasi-private archive for OmniTI, you probably want https://omniosce.org
Shell
39
star
11

curo

postgres command-line tools
Shell
38
star
12

portableumem

This is a port of the Solaris umem memory allocator to other popular operating systems, such as Linux, Windows and BSDish systems (including Darwin/OSX).
C
30
star
13

Net--RabbitMQ

Perl bindings to the librabbitmq-c AMQP library.
C
25
star
14

resmon

Resmon is a lightweight utility for local host monitoring that can be queried by tools such as nagios over http. One of the main design goals is portability: that resmon should require nothing more than a default install of Perl. Built with the philosophy that "we are smart because we are dumb," that is, local requirements should be minimal to ease deployment on multiple platforms.
Perl
25
star
15

pg_query_statsd

Send query statistics to statsd
C
19
star
16

chef-solo-helper

Helper scripts for running chef-solo with a git backed repository
Shell
16
star
17

system_monitoring

Script for system monitoring
Perl
13
star
18

circus2

Various helper tools making use of the circonus v2 api
Python
6
star
19

db-failover

Postgres Failover Script
Perl
6
star
20

kayak

Kayak (PXE-enabled network imaging of OmniOS) - Note, this is a quasi-private archive for OmniTI, you probably want https://omniosce.org
Shell
6
star
21

circus

Python API client app and library for Circonus v1 API
Python
5
star
22

pgbrew

Pg Brew
Shell
4
star
23

pgOtter

PostgreSQL query log analyzer
Perl
4
star
24

svr42pkgsrc

SVR4 to pkgsrc conversion tools.
Shell
4
star
25

omnifab

Library of useful helper functions for fabric
Python
3
star
26

template-maker

Script to help automate the creation of configuration management templates from raw configuration files
Python
2
star
27

spreadlogd

Spreadlogd is a simple tool to log messages received via the Spread Group Communication system. It is primary used in conjuction with mod_log_spread to journal a centralized log file for a cluster of Apache servers.
C
2
star
28

chef-sudo

Cookbook to manage sudoers file
Ruby
1
star
29

revealjs_omniti_template

Template for creating OmniTI reveal.js themed presentations
JavaScript
1
star
30

openssh-securid

OpenSSH with SecurID integration
1
star
31

omniti-ms

OmniTI OmniOS package repo build scripts
Shell
1
star
32

mungo-PSGI

Perl
1
star