Re: [SQL] [GENERAL] Data audit trail techniques in postgresql

2009-08-27 Thread Rob Sargent
Alvaro Herrera wrote: Rob Sargent escribió: tablelog doesn't appear any more lively than the OPs audittrail2. Perhaps, but I have heard of people using it successfully recently, whereas Nathaniel reported that audittrail2 seems to have obvious bugs. Fair enough. -- Sent via p

Re: [SQL] [GENERAL] Data audit trail techniques in postgresql

2009-08-27 Thread Alvaro Herrera
Rob Sargent escribió: > tablelog doesn't appear any more lively than the OPs audittrail2. Perhaps, but I have heard of people using it successfully recently, whereas Nathaniel reported that audittrail2 seems to have obvious bugs. -- Alvaro Herrerahttp://www.Comman

Re: [SQL] [GENERAL] Data audit trail techniques in postgresql

2009-08-27 Thread Rob Sargent
tablelog doesn't appear any more lively than the OPs audittrail2. Alvaro Herrera wrote: Nathaniel Smith wrote: What do others use to accomplish this? Do most pg users just write triggers by hand? Or is there some nice auditing module that Google just isn't revealing to me? I think ta

Re: [SQL] [GENERAL] Data audit trail techniques in postgresql

2009-08-27 Thread Alvaro Herrera
Nathaniel Smith wrote: > What do others use to accomplish this? Do most pg users just write > triggers by hand? Or is there some nice auditing module that Google > just isn't revealing to me? I think tablelog (to be found in pgfoundry too) is the most commonly used audit module. -- Alvaro Herre

[SQL] Data audit trail techniques in postgresql

2009-08-27 Thread Nathaniel Smith
Howdy, (cross-posted to the pg.sql and pg.general lists) I'm looking to set up an audit trail system--ie, logging every INSERT/UPDATE/DELETE on a given table and tracking how the data changes over time. I know I could do it by hand using triggers, but was hoping to save a little time using someth

Re: re[SQL] solved: WITH RECURSIVE: ARRAY[id] All column datatypes must be hashable

2009-08-27 Thread Rob Sargent
In so much as id-ma-pa is near and dear to my heart, I would really appreciate and performance metrics you might be able to share. Especially size of person table, typical pedigree size and pedigree retrieval time (tainted by hardware specs of course). Thanks rjs rawi wrote: me again...

Re: re[SQL] solved: WITH RECURSIVE: ARRAY[id] All column datatypes must be hashable

2009-08-27 Thread Tom Lane
rawi writes: > The Error was caused because I used UNION in place of UNION ALL. > I still don't understand why the ARRAY (path) could not be grouped... Yeah, it's an unimplemented feature --- there's no hashing support for arrays. I hope to get that done for 8.5. In the meantime you have to us

re[SQL] solved: WITH RECURSIVE: ARRAY[id] All column datatypes must be hashable

2009-08-27 Thread rawi
me again... I figured it out... The Error was caused because I used UNION in place of UNION ALL. I still don't understand why the ARRAY (path) could not be grouped... Bye rawi -- View this message in context: http://www.nabble.com/WITH-RECURSIVE%3A-ARRAY-id--All-column-datatypes-must-be-hash

[SQL] WITH RECURSIVE: ARRAY[id] All column datatypes must be hashable

2009-08-27 Thread rawi
Hello I try to build a SQL for isolating hole pedigrees/families form a table with persons. Each person may have father_id and mother_id set to their parents as foreign keys on the same persons table. I was inspired by http://akretschmer.blogspot.com/2008/10/waiting-for-84.html and I tryed to de

Re: [SQL] Howto automatically define collumn names for a function result.

2009-08-27 Thread Jorge Godoy
Have you tried returning SETOF RECORD[] and using the OUT specification? CREATE OR REPLACE FUNCTION bla(integer, date, OUT date, OUT integer) RETURNS SETOF RECORD[] AS $_$ SELECT date AS output_date, $1+2 AS next_record FROM table WHERE id = $1 AND start_date >= $2; $_$ LANGUAGE SQL; (Just an

[SQL] Howto automatically define collumn names for a function result.

2009-08-27 Thread Andreas
Hi, wouldn't it be great to have functions return "setof something" as result where "something" was determined out of the result of a SELECT within the function? like CREATE OR REPLACE FUNCTION coffee(integer, timestamp, timestamp) RETURNS SETOF AS $BODY$ SELECT staff_id, name, room, COUN