Re: [GENERAL] Logging access to data in database table

2012-01-25 Thread Ivan Radovanovic
On 01/25/12 20:02, Misa Simic napisa: Thanks Bill, Make sense... db_link is probably then solution... Everything depends on concrete problem... But I still think security should be reconsidered (I would use db_link just in case there is no other options - if we must let users to have direct ac

Re: [GENERAL] Logging access to data in database table

2012-01-25 Thread Ivan Radovanovic
On 01/25/12 18:38, Greg Sabino Mullane napisa: You would need to break out of the transaction somehow within that function and make a new call to the database, for example using dblink or plperlu. I've done the latter before and it wasn't too painful. The general idea is: - --- $dbh = DBI->conn

Re: [GENERAL] Logging access to data in database table

2012-01-25 Thread Misa Simic
Thanks Bill, Make sense... db_link is probably then solution... Everything depends on concrete problem... But I still think security should be reconsidered (I would use db_link just in case there is no other options - if we must let users to have direct access to DB)... I mean, in that case when

Re: [GENERAL] Logging access to data in database table

2012-01-25 Thread Bill Moran
In response to Misa Simic : > > But maybe it would be better to reorganise security on the way that users > who do not need to have access to some data - simply do not have it > (instead of to give them data and latter check log to confirm they have > taken it...) In many cases that's not enough.

Re: [GENERAL] Logging access to data in database table

2012-01-25 Thread Bill Moran
In response to Misa Simic : > > But maybe it would be better to reorganise security on the way that users > who do not need to have access to some data - simply do not have it > (instead of to give them data and latter check log to confirm they have > taken it...) In many cases that's not enough.

Re: [GENERAL] Logging access to data in database table

2012-01-25 Thread Misa Simic
Well, You could use dblink in your access_function() to log it... But maybe it would be better to reorganise security on the way that users who do not need to have access to some data - simply do not have it (instead of to give them data and latter check log to confirm they have taken it...) Dep

Re: [GENERAL] Logging access to data in database table

2012-01-25 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 > If this protected data is read only using postgres function , and if in > the same function I add something like "insert into log_table (blah blah > blah)", somebody could simply do > begin; > select * from access_function(); /* assuming acc

[GENERAL] Logging access to data in database table

2012-01-25 Thread Ivan Radovanovic
Hello, I need to log access to certain data in database in some log (I prefer to have that both in syslog and table in database), and I find it easy to write to syslog, but I can't solve the problem of writing this to database table. If this protected data is read only using postgres functio