Coder Social home page Coder Social logo

table_log's Introduction

table_log

Fork of the old table_log module, supporting PostgreSQL 9.1+.

Please see README.table_log for a detailed description of the module.

table_log's People

Contributors

psoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

credativ

table_log's Issues

Strange problem with single quotes on Postgresql 9.2

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

Won't compile on Postrgresql 11

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);
^

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.