Fork of the old table_log module, supporting PostgreSQL 9.1+.
Please see README.table_log for a detailed description of the module.
Fork of the old table_log module, supporting PostgreSQL 9.1+
Dear, I'm very happy that someone is upgrading and maintaining table_log.
Great work!
Don't know if this is a problem only for me, but my Postgresql 9.2 on Ubuntu isn't able to store (and log) statements where the string contains a single quote char.
To reproduce I tried this creating a test-table on a brand new db:
-- Table: test_table CREATE TABLE test_table ( test_string character varying(100) ) WITH ( OIDS=FALSE ); ALTER TABLE test_table OWNER TO postgres; --ENABLE TABLE_LOG select table_log_init(5,'test_table'); --insert a string: OK insert into test_table values('a string'); --insert a string with apex: NOT OK insert into test_table values('a ''s string');
In the second insert (where I have the 's string) Postgresql is complaining:
CEST ERROR: syntax error at or near "s" at character 37 CEST STATEMENT: insert into test_table values('a \'s string'); CEST LOG: statement: insert into test_table values('a ''s string'); CEST ERROR: syntax error at or near "s" at character 128 CEST QUERY: INSERT INTO "public"."test_table_log" ("test_string", trigger_user, trigger_mode, trigger_tuple, trigger_changed) VALUES ('a \'s string', SESSION_USER, 'INSERT', 'new', NOW()); CEST STATEMENT: insert into test_table values('a ''s string');
Have you the same problem? Any ideas?
Many thanks
xximent
Hi. Don't know if anyone is still maintaining this, but it won't compile on v11. (v10 still does). I get these errors:
table_log.c: In function ‘count_columns’:
table_log.c:80:27: error: invalid type argument of ‘->’ (have ‘FormData_pg_attribute’)
if (!tupleDesc->attrs[i]->attisdropped)
^
table_log.c: In function ‘__table_log’:
table_log.c:339:56: error: invalid type argument of ‘->’ (have ‘FormData_pg_attribute’)
if (trigdata->tg_relation->rd_att->attrs[col_nr - 1]->attisdropped)
^
table_log.c:373:56: error: invalid type argument of ‘->’ (have ‘FormData_pg_attribute’)
if (trigdata->tg_relation->rd_att->attrs[col_nr - 1]->attisdropped)
^
Also, these warnings, in both 10 & 11:
table_log.c: In function ‘table_log_restore_table’:
table_log.c:859:3: warning: format ‘%i’ expects argument of type ‘int’, but argument 3 has type ‘uint64’ [-Wformat=]
elog(DEBUG2, "%i rows copied", SPI_processed);
^
table_log.c:918:2: warning: format ‘%i’ expects argument of type ‘int’, but argument 3 has type ‘uint64’ [-Wformat=]
elog(DEBUG2, "number log entries to restore: %i", SPI_processed);
^
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.