Re: [GENERAL] Oracle to PostgreSQL

2017-11-09 Thread Felix Kunde
On Thu, 2017-11-09 at 17:01 +0530, Brahmam Eswar wrote: > You can create a composite type in PostgreSQL: > CREATE TYPE complex AS (r integer, i integer); > You would use an array in this case: > DECLARE > carr complex[]; I've once faced the same thing, and did as Laurenz suggested. You will like

Re: [GENERAL] Trigger based logging alternative to table_log

2017-03-27 Thread Felix Kunde
> I have some code which uses table_log > (http://pgfoundry.org/projects/tablelog/) to keep a log of changes to > selected tables.  > I don't use the restore part, just the logging part.   > It creates a new table for each table being logged, with several additional > columns, and adds

Re: [GENERAL] Getting a delta of two json-typed objects? (a breeze w/ hstore)

2015-01-22 Thread Felix Kunde
Hi, not so long ago, I've asked myself the same question. I've written two fuction that do this: SELECT build_json(array_agg(to_json(old.key)), array_agg(old.value)) FROM json_each($1) old LEFT OUTER JOIN json_each($2) new ON old.key = new.key WHERE old.value::text new.value::text OR new.key

Re: [GENERAL] table versioning approach (not auditing)

2014-10-01 Thread Felix Kunde
Brusselback adambrusselb...@gmail.com An: Felix Kunde felix-ku...@gmx.de Cc: pgsql-general@postgresql.org pgsql-general@postgresql.org Betreff: Re: [GENERAL] table versioning approach (not auditing) Felix, I'd love to see a single, well maintained project. For example, I just found yours

Re: [GENERAL] table versioning approach (not auditing)

2014-09-30 Thread Felix Kunde
: Abelard Hoffman abelardhoff...@gmail.com An: Felix Kunde felix-ku...@gmx.de Cc: pgsql-general@postgresql.org pgsql-general@postgresql.org Betreff: Re: [GENERAL] table versioning approach (not auditing) Thank you Felix, Gavin, and Jonathan for your responses.   Felix Jonathan: both of you mention just

Re: [GENERAL] table versioning approach (not auditing)

2014-09-29 Thread Felix Kunde
Hey   i've also tried to implement a database versioning using JSON to log changes in tables. Here it is: https://github.com/fxku/audit I've got two versioning tables, one storing information about all transactions that happened and one where i put the JSON logs of row changes of each table.

[GENERAL] memory issues with BYTEAs in JSON and hstore

2014-05-27 Thread Felix Kunde
Hey, I've developed a database auditing/versioning using the JSON data type (http://github.com/fxku/audit) and doing some tests now. Unfortunately I'm facing some problems when dealing with tables that store images as BYTEA. Some of them are around 15 MB big. My tool logs changes to JSON and

[GENERAL] comparing two JSON objects in 9.3

2014-05-12 Thread Felix Kunde
solution? Did i trapped into some YouShouldNots? Regards! Felix Kunde

Re: [GENERAL] Temporary table already exists

2014-01-31 Thread Felix Kunde
I had a similar problem once. The pool is reusing connections and the temporary tables are still there. Now I always create new temporary tables with a unique name like this: tmpTableId = TMP + Math.abs(generateUUID().hashCode()); if (tmpTableId.length() 15) tmpTableId =

[GENERAL] Audit database to recreate former states using JSON functions

2014-01-14 Thread Felix Kunde
Hello last december Ive delvoped a few PL/pgSQL functions to log all changes in my database and recreate former database states. I used row_to_json to log and json_populate_recordset to reproduce my tables. I think its cool feature and I like to share and discuss it with you. I would be