Tue Jan 12 22:52:07 PST 2016
- Previous message: [Slony1-general] log insert/update query executed on subscriber
- Next message: [Slony1-general] log insert/update query executed on subscriber
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
No, it doesn't. Take a look:
# \d emp
Table "public.emp"
Column | Type | Modifiers
---------+---------+-----------
empname | text | not null
salary | integer |
Triggers:
_b24v2_denyaccess BEFORE INSERT OR DELETE OR UPDATE ON emp FOR EACH
ROW EXECUTE PROCEDURE _b24v2.denyaccess('_b24v2')
Triggers firing always:
__audit BEFORE INSERT OR DELETE OR UPDATE ON emp FOR EACH ROW
EXECUTE PROCEDURE save_query()
-- with disabled trigger denyaccess
# insert into emp values ('TEST dasdasdas',123123);
INSERT 0 1
# select * from audit.slon_audit;
operation | stamp | userid
| query
-----------+----------------------------+----------+---------------------------------------------------
I | 2016-01-13 06:46:15.417799 | postgres | insert into emp
values ('TEST dasdasdas',123123);
(1 row)
-- enabling trigger denyaccess
# alter table emp enable trigger _b24v2_denyaccess;
ALTER TABLE
# insert into emp values ('test2',31337);
ERROR: Slony-I: Table emp is replicated and cannot be modified on a
subscriber node - role=0
# select * from audit.slon_audit;
operation | stamp | userid
| query
-----------+----------------------------+----------+---------------------------------------------------
I | 2016-01-13 06:46:15.417799 | postgres | insert into emp
values ('TEST dasdasdas',123123);
(1 row)
Nothing happend. Any other ideas?
--
Pozdrawiam,
Krzysztof Jakowczyk
Administrator Systemów Unix
Grupa Unity | ul. Przedmiejska 6-10, 54-201 Wrocław
ul. Conrada 55B, 31-357 Kraków | ul. Złota 59, 00-120 Warszawa
On 13.01.2016 03:43, Steve Singer wrote:
> On Tue, 12 Jan 2016, Krzysztof Jakowczyk wrote:
>
>> Hello,
>>
>> Is it possible to log query with parameters executed on subscriber node?
>> I've tried to add __audit trigger before insert or update, but when
>> denyaccess trigger is enabled, nothing is logged. Below is my try for
>> table emp:
>>
>
>>
>> CREATE TRIGGER __audit
>> BEFORE INSERT OR UPDATE OR DELETE ON emp
>> FOR EACH ROW EXECUTE PROCEDURE save_query();
>
> Setting the trigger to fire always should work.
>
> ALTER TABLE foo ENABLE ALWAYS TRIGGER __audit;
>
> http://www.postgresql.org/docs/9.1/interactive/sql-altertable.html
>
>
>
>>
>> --
>> Pozdrawiam,
>>
>> Krzysztof Jakowczyk
>> Administrator Systemów Unix
>>
>> Grupa Unity | ul. Przedmiejska 6-10, 54-201 Wrocław
>> ul. Conrada 55B, 31-357 Kraków | ul. Złota 59, 00-120 Warszawa
>>
>>
>>
>> _______________________________________________
>> Slony1-general mailing list
>> Slony1-general at lists.slony.info
>> http://lists.slony.info/mailman/listinfo/slony1-general
- Previous message: [Slony1-general] log insert/update query executed on subscriber
- Next message: [Slony1-general] log insert/update query executed on subscriber
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-general mailing list