Trigger function on Warm Standby

Started by ning chanalmost 13 years ago2 messagesgeneral
Jump to latest
#1ning chan
ninchan8328@gmail.com

Hi all,

I have a Primary Standby setup with streaming replication.
Trigger is created on a table, and all it does it to log a message.

The trigger works as expected on Primary, however, I don't see the same on
standby.

I alter the table to have ENABLE ALWAYS TRIGGER, I verified the setting on
both Primary and Standby which is set to A.

Standby:
-bash-4.1$ psql -c "select tgrelid, tgname, tgenabled from pg_trigger where
tgname='processnodeafter'"
tgrelid | tgname | tgenabled
---------+------------------+-----------
19218 | processnodeafter | A

Primary:
postgres=# select tgrelid, tgname, tgenabled from pg_trigger where
tgname='processnodeafter';
tgrelid | tgname | tgenabled
---------+------------------+-----------
19218 | processnodeafter | A
(1 row)

Can someone tell me if the trigger will never happen on the Standby server?
Is it expected or am I missing some other settings?

Thanks~
Ning

#2Jerry Sievers
gsievers19@comcast.net
In reply to: ning chan (#1)
Re: Trigger function on Warm Standby

ning chan <ninchan8328@gmail.com> writes:

Hi all,

I have a Primary Standby setup with streaming replication.
Trigger is created on a table, and all it does it to log a message.

The trigger works as expected on Primary, however, I don't see the same on standby.

I alter the table to have ENABLE ALWAYS TRIGGER, I verified the setting on both Primary and Standby which is set to A.

Standby:
-bash-4.1$ psql -c "select tgrelid, tgname, tgenabled from pg_trigger where tgname='processnodeafter'"
?tgrelid |????? tgname????? | tgenabled
---------+------------------+-----------
?? 19218 | processnodeafter | A

Primary:
postgres=# select tgrelid, tgname, tgenabled from pg_trigger where tgname='processnodeafter';
?tgrelid |????? tgname????? | tgenabled
---------+------------------+-----------
?? 19218 | processnodeafter | A
(1 row)

Can someone tell me if the trigger will never happen on the Standby server? Is it expected or am I missing some other
settings?

It will not fire on a standby.

Thanks~
Ning

--
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres.consulting@comcast.net
p: 312.241.7800

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