[GENERAL] database size changed after restoring using pg_restore

2017-11-08 Thread Dylan Luong
Hi
I am upgrading some databases from a PostgreSQL 9.2 server to a new PostgreSQL 
9.6 server.

I used pg_dump and pg_restore for the upgrade.

This is the command I used to dump the database. I ran the command from the 9.6 
server.
pg_dump -h 9.2server -j 16 --format=directory -f 
/pg_backup/backup/dump/mydb-20171108.dmp -U postgres -W mydb

This is the command I used to restore the database on the 9.6server.
pg_restore -j 16 -C -d postgres /pg_backup/backup/dump/mydb-20171108.dmp

Everything appears ok, the dump and restore completed without and errors.

But when I listed the size of the database (postgres=# \l+) between the 9.2 and 
the upgraded 9.6, they were different.

on 9.2 it was 3776 MB
on 9.6 it was 1570 MB

I also did a few more databases using the same steps and they all appeared to 
be smaller. Is that normal?

Regards
Dylan


Re: [GENERAL] pg_rewind - restore new slave failed to startup during recovery

2017-08-21 Thread Dylan Luong
Thanks Michael.

> First things first. What is the version of PostgreSQL involved here?

The PostgreSQL is version 9.6.

>4 is the number of the last timeline the promoted standby has been using, 
>right?

The history file in pg_xlog, is dated at the time of promotion on the standby 
(current master)
-rw---. 1 postgres postgres  131 Aug 21 13:26 0004.history

$ more 0004.history
1   20/5C98 no recovery target specified

2   76/F898 no recovery target specified

3   9C/7CC50680 no recovery target specified

> What are the contents of /pg_backup/backup/archive_sync/?

The archive folder is /pg_backup/backup/archive, I ftp'ed all the contents from 
the /pg_backup/backup/archive folder from the new  master to the 
/pg_backup/backup/archive_sync on the new slave.

-Original Message-
From: Michael Paquier [mailto:michael.paqu...@gmail.com] 
Sent: Tuesday, 22 August 2017 10:37 AM
To: Dylan Luong <dylan.lu...@unisa.edu.au>
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] pg_rewind - restore new slave failed to startup during 
recovery

On Tue, Aug 22, 2017 at 9:52 AM, Dylan Luong <dylan.lu...@unisa.edu.au> wrote:
> I have 1 master and 1 slave wal streaming replication setup and the 
> Application connects via a load balancer (LTM) where the all 
> connections are redirected to the master member (master db).
>
> We have archive_mode enabled.

First things first. What is the version of PostgreSQL involved here?

> I am trying to test to use pg_rewind to restore the new slave (old 
> master) after a failover while the system is under load.

Don't worry. pg_rewind works :)

> Here are the steps I take to test:
>
> 1.   Disable the master ltm member (all connections redired to slave
> member)
> 2.   Promote slave (touch promote.me)
> 3.   Stop the master db (old master)
> 4.   Do pg_rewind on the new slave (old master)
> 5.   Start the new slave.

That flow looks correct to me. No I think that you should trigger manually a 
checkpoint after step 2 on the promoted standby so as its control file gets 
forcibly updated correctly with its new timeline number. This is a small but 
critical point people usually miss. The documentation of pg_rewind does not 
mention this point when using a live source server, and many people have fallen 
into this trap up to now... We should really mention that in the docs. What do 
others think?

> Checking the on the new master, I see that the check point that its 
> trying to restore is the file 0004009C006F, but the file 
> does not exist anywhere on the new master. Not in the pg_xlog or the 
> archive folder. (as specified in the postgresql.conf)

4 is the number of the last timeline the promoted standby has been using, right?

> Please see attached  psql.jpg.
>
> Here is my recovery.conf :
> standby_mode = 'on'
> primary_conninfo = 'host=10.69.19.18  user=replicant’
> trigger_file = '/var/run/promote_me'
> restore_command = 'cp /pg_backup/backup/archive_sync/%f "%p"'
>
> does anyone know why?

What are the contents of /pg_backup/backup/archive_sync/? Are you sure that the 
promoted standby has archived correctly the first segment of its new timeline 
for example?

> Under what conditions will pg_rewind wont’ work?

Only one WAL segment missing would prevent any base backup or rewound node to 
reach a consistent point. You need to be careful about the contents of your 
archives. Now a failover done correctly is a tricky thing, which could likely 
fail if you don't issue a checkpoint immediately on the promoted standby if 
pg_rewind is kicked in the process before an automatic checkpoint happens 
(because of timeout or volume, whichever).
--
Michael

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


[GENERAL] enable PostgreSQL SSL from RPM package installation

2017-06-22 Thread Dylan Luong
Hi
I have installed PostgreSQL from the following RPMs onto the server. And I 
would like to enable SSL.

postgresql96-devel-9.6.2-2PGDG.rhel7.x86_64
postgresql96-libs-9.6.2-2PGDG.rhel7.x86_64
postgresql96-contrib-9.6.2-2PGDG.rhel7.x86_64
postgresql96-server-9.6.2-2PGDG.rhel7.x86_64
postgresql96-9.6.2-2PGDG.rhel7.x86_64

>From the PostgreSQL documentation, 
>https://www.postgresql.org/docs/current/static/ssl-tcp.html  it says that 
>PostgreSQL SSL support needs to be enable at build time.

Just wondering if these RPMs are compiled with SSL enabled?

Thanks.

Regards
Dylan



[GENERAL] pg_rewind - enable wal_log_hints or data-checksums

2017-06-04 Thread Dylan Luong
Hi

In the PostgreSQL documentation for pg_rewind:

pg_rewind requires that the target server either has the wal_log_hints option 
enabled in postgresql.conf or data checksums enabled when the cluster was 
initialized with initdb.


What is the difference between the two options?
What are the advantages and disadvantages between the two?
Which one is the the preferred option?

Thanks
Regards
Dylan



Re: [GENERAL] issue performing a switchover with repmgr

2017-05-22 Thread Dylan Luong
Thanks for you answer. So is there a way to remove this -w from the repmgr 
switchover process?

-Original Message-
From: Adrian Klaver [mailto:adrian.kla...@aklaver.com] 
Sent: Monday, 22 May 2017 10:27 PM
To: Dylan Luong <dylan.lu...@unisa.edu.au>; pgsql-general@postgresql.org
Subject: Re: [GENERAL] issue performing a switchover with repmgr

On 05/22/2017 01:15 AM, Dylan Luong wrote:
> Hi
> 
> I have setup a master/standby on PostgreSQL95 on two test servers and 
> trialing out repmgr. (https://github.com/2ndQuadrant/repmgr/)
> 
> I am testing a switchover using the following:
> 
> -bash-4.1$ repmgr -f /etc/repmgr/9.5/repmgr.conf -C 
> /etc/repmgr/9.5/repmgr.conf standby switchover -L DEBUG -v
> 
> The switchover appears to hang at the last part of the switchover process
> 
> /NOTICE: restarting server using '/usr/pgsql-9.5/bin/pg_ctl  -w -D 
> /var/lib/pgsql/9.5/data -m fast restart'/
> 
> /pg_ctl: PID file "/var/lib/pgsql/9.5/data/postmaster.pid" does not 
> exist/
> 
> /Is server running?/
> 
> /starting server anyway/
> 
> It appears to have worked though as when I run the cluster show 
> command on both servers it showing the switchover.
> 
> /-bash-4.1$ repmgr -f /etc/repmgr/9.5/repmgr.conf cluster show/
> 
> /Role  | Name   | Upstream   | Connection String/
> 
> /--+||
> ---/
> 
> /* master  | itupl-postgen2 || host=10.70.3.252 
> dbname=repmgr user=repmgr/
> 
> /  standby | itupl-postgen1 | itupl-postgen2 | host=10.70.3.251 
> dbname=repmgr user=repmgr/
> 
> It is also showing correctly in repl_nodes table of the two databases.
> 
> Why is it hanging?? Thank you for your help...

You are using -w

https://www.postgresql.org/docs/9.5/static/app-pg-ctl.html

"-w

 Wait for the startup or shutdown to complete. Waiting is the default 
option for shutdowns, but not startups. When waiting for startup, pg_ctl 
repeatedly attempts to connect to the server. When waiting for shutdown, pg_ctl 
waits for the server to remove its PID file. This option allows the entry of an 
SSL passphrase on startup. 
pg_ctl returns an exit code based on the success of the startup or shutdown.
"

So pg_ctl was trying to connect the server and did not find it at first:

"pg_ctl: PID file "/var/lib/pgsql/9.5/data/postmaster.pid" does not exist. Is 
server running?"

but continued with the process:

"starting server anyway"

FYI in Postgres 10+ -w is the default for pg_ctl.



> 
> Here is the complete output:
> 
> /--- /
> 



--
Adrian Klaver
adrian.kla...@aklaver.com


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


[GENERAL] issue performing a switchover with repmgr

2017-05-22 Thread Dylan Luong
Hi

I have setup a master/standby on PostgreSQL95 on two test servers and trialing 
out repmgr. (https://github.com/2ndQuadrant/repmgr/)

I am testing a switchover using the following:

-bash-4.1$ repmgr -f /etc/repmgr/9.5/repmgr.conf -C /etc/repmgr/9.5/repmgr.conf 
standby switchover -L DEBUG -v

The switchover appears to hang at the last part of the switchover process

NOTICE: restarting server using '/usr/pgsql-9.5/bin/pg_ctl  -w -D 
/var/lib/pgsql/9.5/data -m fast restart'
pg_ctl: PID file "/var/lib/pgsql/9.5/data/postmaster.pid" does not exist
Is server running?
starting server anyway

It appears to have worked though as when I run the cluster show command on both 
servers it showing the switchover.
-bash-4.1$ repmgr -f /etc/repmgr/9.5/repmgr.conf cluster show
Role  | Name   | Upstream   | Connection String
--+||---
* master  | itupl-postgen2 || host=10.70.3.252 dbname=repmgr 
user=repmgr
  standby | itupl-postgen1 | itupl-postgen2 | host=10.70.3.251 dbname=repmgr 
user=repmgr

It is also showing correctly in repl_nodes table of the two databases.

Why is it hanging?? Thank you for your help...

Here is the complete output:
---
-bash-4.1$ repmgr -f /etc/repmgr/9.5/repmgr.conf -C /etc/repmgr/9.5/repmgr.conf 
standby switchover -L DEBUG -v
NOTICE: using configuration file "/etc/repmgr/9.5/repmgr.conf"
NOTICE: switching current node 2 to master server and demoting current master 
to standby...
DEBUG: connecting to: 'host=10.70.3.252 dbname=repmgr user=repmgr 
fallback_application_name='repmgr''
DEBUG: is_standby(): SELECT pg_catalog.pg_is_in_recovery()
INFO: retrieving node list for cluster 'repmgr_cluster'
DEBUG: get_master_connection():
  SELECT id, conninfo,  CASE WHEN type = 'master' THEN 1 ELSE 2 END AS 
type_priorityFROM "repmgr_repmgr_cluster".repl_nodesWHERE cluster = 
'repmgr_cluster'  AND type != 'witness' ORDER BY active DESC, 
type_priority, priority, id
INFO: checking role of cluster node '1'
DEBUG: connecting to: 'host=10.70.3.251 dbname=repmgr user=repmgr 
fallback_application_name='repmgr''
DEBUG: is_standby(): SELECT pg_catalog.pg_is_in_recovery()
DEBUG: get_master_connection(): current master node is 1
DEBUG: get_node_record():
SELECT id, type, upstream_node_id, name, conninfo,slot_name, priority, 
active  FROM "repmgr_repmgr_cluster".repl_nodes  WHERE cluster = 
'repmgr_cluster'AND id = 1
DEBUG: remote node name is "itupl-postgen1"
DEBUG: test_ssh_connection(): executing ssh -o Batchmode=yes  10.70.3.251 
/bin/true 2>/dev/null
DEBUG: get_pg_setting(): SELECT name, setting   FROM pg_catalog.pg_settings 
WHERE name = 'data_directory'
DEBUG: get_pg_setting(): returned value is "/var/lib/pgsql/9.5/data"
DEBUG: master's data directory is: /var/lib/pgsql/9.5/data
DEBUG: remote_command(): ssh -o Batchmode=yes  10.70.3.251 ls 
'/var/lib/pgsql/9.5/data/PG_VERSION' >/dev/null 2>&1 && echo 1 || echo 0
DEBUG: remote_command(): output returned was:
1
DEBUG: PG_VERSION found in /var/lib/pgsql/9.5/data
DEBUG: remote_command(): ssh -o Batchmode=yes  10.70.3.251 ls 
'/usr/pgsql-9.5/bin/pg_rewind' >/dev/null 2>&1 && echo 1 || echo 0
DEBUG: remote_command(): output returned was:
1
DEBUG: guc_set():
SELECT true FROM pg_catalog.pg_settings  WHERE name = 'full_page_writes' AND 
setting = 'off'
DEBUG: guc_set():
SELECT true FROM pg_catalog.pg_settings  WHERE name = 'wal_log_hints' AND 
setting = 'on'
INFO: looking for file "/etc/repmgr/9.5/repmgr.conf" on remote server 
"10.70.3.251"
DEBUG: remote_command(): ssh -o Batchmode=yes  10.70.3.251 ls 
'/etc/repmgr/9.5/repmgr.conf' >/dev/null 2>&1 && echo 1 || echo 0
DEBUG: remote_command(): output returned was:
1
INFO: remote configuration file "/etc/repmgr/9.5/repmgr.conf" found on remote 
server
DEBUG: remote_archive_config_dir: /tmp/repmgr-itupl-postgen1-archive
DEBUG: Executing:
/usr/pgsql-9.5/bin/repmgr standby archive-config -f 
'/etc/repmgr/9.5/repmgr.conf' 
--config-archive-dir='/tmp/repmgr-itupl-postgen1-archive'
DEBUG: remote_command(): ssh -o Batchmode=yes  10.70.3.251 
/usr/pgsql-9.5/bin/repmgr standby archive-config -f 
'/etc/repmgr/9.5/repmgr.conf' 
--config-archive-dir='/tmp/repmgr-itupl-postgen1-archive'

WARNING:  nonstandard use of escape in a string literal
LINE 1: ...config_file,  regexp_replace(config_file, '^.*\/',''...
 ^
HINT:  Use the escape string syntax for escapes, e.g., E'\r\n'.
NOTICE: 3 files copied to /tmp/repmgr-itupl-postgen1-archive
DEBUG: remote_command(): output returned was:
DEBUG: remote_command(): ssh -o Batchmode=yes  10.70.3.251 
/usr/pgsql-9.5/bin/pg_ctl -D '/var/lib/pgsql/9.5/data' -m fast -W stop 
>/dev/null 2>&1 && echo 1 || echo 0
DEBUG: remote_command(): output returned was:
1
DEBUG: remote_command(): ssh -o Batchmode=yes  10.70.3.251 ls 

[GENERAL] controlled switchover with repmgr

2017-03-14 Thread Dylan Luong
Hi

In a controlled switchover from master to slave with repmgr, what is the 
downtime timeframe? Seconds?
What is the internal process involved in a switchover with repmgr? Is the 
process all automated?  Will there be data loss?

Regards
Dylan


[GENERAL] Postgres HA

2017-02-22 Thread Dylan Luong
Hi

I am a DBA at the University of South Australia. For PostgreSQL High 
Availability, we currently have setup a Master/Slave across two datacenters 
using PostgreSQL (WAL) streaming replication. We use an LTM (load balancer) 
server that sits between the application servers and the PostgreSQL server that 
directs connections to the Master (and the Slave if failover occurs). We also 
have watchdog processes on the PostgreSQL servers that polls the LTM to 
determine who is Master and perform automatic failover if required. I am 
looking at options to improve our high availability.
I would like to know how other organizations in different industries (other 
than education) setup High Availability on their PostgreSQL environments.
What  tools do you use. Are they commercial licensed products? How is the 
architecture setup and how do you do recovery of new slave.
Your information is greatly appreciated.

Regards
Dylan

Dylan Luong
Information Strategy & Technology Services
University of South Australia
A Building, Room E2-07, Mawson Lakes Campus
MAWSON LAKES
South Australia  5095

Email:dylan.lu...@unisa.edu.au<mailto:dylan.lu...@unisa.edu.au>
Phone:+61 8 83023629
Fax: +61 8 83023577
WWW:http://www.unisa.edu.au



[GENERAL] pgaudit_analyze process filling up audit log file

2016-12-21 Thread Dylan Luong
Hi
I have installed and configured pgAudit extension and the pgAudit Analyzer
https://github.com/pgaudit/pgaudit/tree/REL9_5_STABLE
https://github.com/pgaudit/pgaudit_analyze

I have several databases in the PostgreSQL instance and created the extension 
and setup the pgaudit analyzer for these database, including the postgres 
database.

After starting the pgAudit Analyze as a daemon process, ./pgaudit_analyze 
--daemon /pg_logs/data/pg_log
the log file and the csv file are filling up very fast (1mb per sec) 
continuously.
The files are filling up with the following continuously:
2016-12-22 15:47:36 ACDT [12735]: [146339-1] db=postgres,user=postgres 
app=[unknown],host=[local] LOG:  duration: 0.106 ms
2016-12-22 15:47:36 ACDT [12735]: [146340-1] db=postgres,user=postgres 
app=[unknown],host=[local] LOG:  duration: 0.021 ms
2016-12-22 15:47:36 ACDT [12735]: [146341-1] db=postgres,user=postgres 
app=[unknown],host=[local] LOG:  duration: 0.086 ms
2016-12-22 15:47:36 ACDT [12735]: [146342-1] db=postgres,user=postgres 
app=[unknown],host=[local] LOG:  duration: 0.022 ms
2016-12-22 15:47:36 ACDT [12735]: [146343-1] db=postgres,user=postgres 
app=[unknown],host=[local] LOG:  duration: 0.167 ms
2016-12-22 15:47:36 ACDT [12735]: [146344-1] db=postgres,user=postgres 
app=[unknown],host=[local] LOG:  duration: 0.030 ms

It only stops when I kill -9 the pgaudit_analyze process.
What is causing this?

Regards
Dylan



[GENERAL] pgAudit_Analyze - parse error in pgaudit_analyze.log

2016-12-14 Thread Dylan Luong
Hi

I have configured pgAudit extension on my DEV PostgreSQL instance.
I am trying to configure the pgAudit_Analyze to read the audit logs and loads 
them into a database table.
Following the steps in https://github.com/pgaudit/pgaudit_analyze I have perl 
script pgaudit_analyze running as a daemon process. I can see csv files in my 
log directory, however, in the pgaudit_analyze.log I am seeing the following 
errors consistently.

reading postgresql-14-12-16-13-56.csv
reading postgresql-14-12-16-14-00.csv
reading postgresql-14-12-16-14-30.csv
reading postgresql-14-12-16-15-00.csv
reading postgresql-14-12-16-15-30.csv
reading postgresql-14-12-16-16-00.csv
reading postgresql-14-12-16-16-30.csv
Can't call method "parse" on an undefined value at ./pgaudit_analyze line 509, 
<$hFile> line 282.
at ./pgaudit_analyze line 44
main::__ANON__('Can\'t call method "parse" on an undefined value at 
./pgaudit...') called at ./pgaudit_analyze line 509
main::auditWrite('5850e4ff.6355', 'postgres', 4, 'AUDIT: 
SESSION,1,1,MISC,SET,,,"\x{a}SET DateStyle=ISO;\x{a}SET client...') called at 
./pgaudit_analyze line 474
main::logWrite('5850e4ff.6355', 'postgres', '2016-12-14 16:51:51.265 
ACDT', 4, 'set', 'log', 0, '5/20971', 0, ...) called at ./pgaudit_analyze 
line 696
eval {...} called at ./pgaudit_analyze line 643

reading postgresql-14-12-16-13-56.csv
reading postgresql-14-12-16-14-00.csv
reading postgresql-14-12-16-14-30.csv
reading postgresql-14-12-16-15-00.csv
reading postgresql-14-12-16-15-30.csv
reading postgresql-14-12-16-16-00.csv
reading postgresql-14-12-16-16-30.csv
Can't call method "parse" on an undefined value at ./pgaudit_analyze line 509, 
<$hFile> line 282.
at ./pgaudit_analyze line 44
main::__ANON__('Can\'t call method "parse" on an undefined value at 
./pgaudit...') called at ./pgaudit_analyze line 509
main::auditWrite('5850e4ff.6355', 'postgres', 4, 'AUDIT: 
SESSION,1,1,MISC,SET,,,"\x{a}SET DateStyle=ISO;\x{a}SET client...') called at 
./pgaudit_analyze line 474
main::logWrite('5850e4ff.6355', 'postgres', '2016-12-14 16:51:51.265 
ACDT', 4, 'set', 'log', 0, '5/20971', 0, ...) called at ./pgaudit_analyze 
line 696
eval {...} called at ./pgaudit_analyze line 643

Please help.

My DEV server is Red Hat 6. PostgreSQL9.5

Regards
Dylan



Re: [GENERAL] Install pgAudit extension

2016-12-12 Thread Dylan Luong
Hi 

Thanks for your reply. I have managed to get pgAudit install and I believe is 
working as I can see audit logs in my log files.
I like to now install the PostgreSQL Audit Log Analyzer. Is there a similar rpm 
for the PostgreSQL Audit Log Analyser?

Regards
Dylan

-Original Message-
From: Devrim Gündüz [mailto:dev...@gunduz.org] 
Sent: Tuesday, 6 December 2016 5:44 PM
To: Dylan Luong <dylan.lu...@unisa.edu.au>; pgsql-general@postgresql.org
Subject: Re: [GENERAL] Install pgAudit extension


Hi,

On Tue, 2016-12-06 at 05:44 +, Dylan Luong wrote:
> I need some advice on installing the pgAudit extension as I am new to 
> PostgreSQL extenstions.

Looks like you installed PostgreSQL via community RPMS, so:

https://yum.postgresql.org/9.5/redhat/rhel-6-x86_64/pgaudit_95-1.0.4-1.rhel6.x8
6_64.rpm

it means, 

yum install pgaudit_95

will do the trick for installing. Then you can create the extension with:

CREATE EXTENSION pgaudit;

You will need to add some lines to postgresql.conf. Sample ones are here:

https://github.com/devrimgunduz/pgextensionconfig/blob/master/9.5/pgaudit.conf

-HTH

Regards,
--
Devrim GÜNDÜZ
EnterpriseDB: http://www.enterprisedb.com PostgreSQL Danışmanı/Consultant, Red 
Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR

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


[GENERAL] Install pgAudit extension

2016-12-05 Thread Dylan Luong
Hi

I need some advice on installing the pgAudit extension as I am new to 
PostgreSQL extenstions.

I currently have Postgres95 on Linux Redhat 6.8 running on the server and I 
need to test out the pgAudt extension.
I downloaded the file pgaudit-REL9_5_STABLE.zip from 
https://github.com/pgaudit/pgaudit/tree/REL9_5_STABLE
In the Readme file, under "Compile and Install" the instructions are:


1.   Clone the PostgreSQL repository:
git clone https://github.com/postgres/postgres.git

2.   Checkout REL9_5_STABLE branch:
git checkout REL9_5_STABLE

3.   Make PostgreSQL:
./configure
make install -s

4.   Change to the contrib directory:
cd contrib

5.   Clone the pgAudit extension:
git clone https://github.com/pgaudit/pgaudit.git

6.   Change to pgAudit directory:
cd pgaudit

7.   Build pgAudit and run regression tests:
make -s check

8.   Install pgAudit:
make install

My problem is that I can't find the contrib directory anywhere on the server. ( 
assume this is because the install steps refers to the old Postfres 8???)
There is default directory for extensions in my current 9.5 install:
/usr/pgsql-9.5/share/extension/

As I have Postrgres9.5 installed and downloaded the zip file 
(pgaudit-REL9_5_STABLE.zip), I assume I only have to perform steps 7 and 8.
Do I just unzip the content into a directory 
/usr/pgsql-9.5/share/extension/pgaudit and then run the steps 7 and 8??? Or do 
I even need to run the make steps as all the files appears to be there. Ie 
.control, .sql, .conf, etc.

The makefile in pgaudit-REL9_5_STABLE.zip refers to .../contrib/pgaudit/. 
?

# contrib/pg_audit/Makefile

MODULE_big = pgaudit
OBJS = pgaudit.o $(WIN32RES)

EXTENSION = pgaudit
DATA = pgaudit--1.0.sql
PGFILEDESC = "pgAudit - An audit logging extension for PostgreSQL"

REGRESS = pgaudit
REGRESS_OPTS = --temp-config=$(top_srcdir)/contrib/pgaudit/pgaudit.conf

ifdef USE_PGXS
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
subdir = contrib/pgaudit
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
endif

Thanks for your help.
Regards
Dylan


[GENERAL] pgpool fail to load balance after database restart

2016-10-11 Thread Dylan Luong
er_command = ''
   # Executes this command after master failover
   # Special values:
   #   %d = node id
   #   %h = host name
   #   %p = port number
   #   %D = database cluster path
   #   %m = new master node id
   #   %H = hostname of the new master node
   #   %M = old master node id
   #   %P = old primary node id
   #   %r = new master port number
   #   %R = new master database cluster path
   #   %% = '%' character

#--
# HEALTH CHECK
#--

health_check_period = 40
   # Health check period
   # Disabled (0) by default
health_check_timeout = 10
   # Health check timeout
   # 0 means no timeout
health_check_user = 'postgres'
   # Health check user
health_check_password = 'xx'
   # Password for health check user
health_check_database = ''
   # Database name for health check. If '', 
tries 'postgres' frist, then 'template1'

health_check_max_retries = 3
   # Maximum number of times to retry a failed 
health check before giving up.
health_check_retry_delay = 1
   # Amount of time to wait (in seconds) 
between retries.
connect_timeout = 1
   # Timeout value in milliseconds before 
giving up to connect to backend.
   # Default is 
1 ms (10 second). Flaky network user may want to increase
   # the value. 
0 means no timeout.
   # Note that 
this value is not only used for health check,
   # but also 
for ordinary conection to backend.

Thanks.

  Dylan Luong
  Information Strategy & Technology Services
  University of South Australia
  A Building, Room A2-05, Mawson Lakes Campus
MAWSON LAKES
South Australia  5095

Email:dylan.lu...@unisa.edu.au<mailto:dylan.lu...@unisa.edu.au>
Phone:  +61 8 83023629
Fax:+61 8 83023577
WWW: http://www.unisa.edu.au