Folks,

Using the script attached, I'm getting this very odd result set below.

Audit records from COPY to the "foo bar" table aren't getting
recorded, but audit records from COPY to the baz table are.

Best,
David.

\i copy_oddity.sql 
CREATE TABLE
COMMENT
CREATE FUNCTION
CREATE FUNCTION
CREATE EVENT TRIGGER
COMMENT
psql:logging_infra.sql:165: NOTICE:  Adding log table(s) for public.foo bar
CREATE TABLE
INSERT 0 1
UPDATE 1
DELETE 1
COPY 5
           timestamp           |  user   |            action             | 
table_schema | table_name |        old_row        |        new_row        
-------------------------------+---------+-------------------------------+--------------+------------+-----------------------+-----------------------
 2017-07-08 01:36:52.368228-07 | shackle | 2017-07-08 01:36:52.368228-07 | 
public       | foo bar    |                       | {"t": null, "id": 1}
 2017-07-08 01:36:52.368228-07 | shackle | 2017-07-08 01:36:52.368228-07 | 
public       | foo bar    | {"t": null, "id": 1}  | {"t": "baz", "id": 1}
 2017-07-08 01:36:52.368228-07 | shackle | 2017-07-08 01:36:52.368228-07 | 
public       | foo bar    | {"t": "baz", "id": 1} | 
(3 rows)

psql:logging_infra.sql:180: NOTICE:  Adding log table(s) for public.baz
psql:logging_infra.sql:180: NOTICE:  relation "public_log" already exists, 
skipping
CREATE TABLE
COPY 5
           timestamp           |  user   |            action             | 
table_schema | table_name | old_row |  new_row   
-------------------------------+---------+-------------------------------+--------------+------------+---------+------------
 2017-07-08 01:36:52.368228-07 | shackle | 2017-07-08 01:36:52.368228-07 | 
public       | baz        |         | {"t": "a"}
 2017-07-08 01:36:52.368228-07 | shackle | 2017-07-08 01:36:52.368228-07 | 
public       | baz        |         | {"t": "b"}
 2017-07-08 01:36:52.368228-07 | shackle | 2017-07-08 01:36:52.368228-07 | 
public       | baz        |         | {"t": "c"}
 2017-07-08 01:36:52.368228-07 | shackle | 2017-07-08 01:36:52.368228-07 | 
public       | baz        |         | {"t": "d"}
 2017-07-08 01:36:52.368228-07 | shackle | 2017-07-08 01:36:52.368228-07 | 
public       | baz        |         | {"t": "e"}
(5 rows)
-- 
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

Attachment: logging_infra.sql
Description: copy_oddity.sql

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

Reply via email to