Search Postgresql Archives

Simple row serialization?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'd like to implement some simple data logging via triggers on a small number of infrequently updated tables and I'm wondering if there are some helpful functions, plugins or idioms that would serialize a row (received for example in a AFTER INSERT trigger) into a string that I'd store in the log table. There's a limited number of field types involved: varchars, integers and booleans. I'm not looking for anything fancy, comma-separated string result would be just fine; even better, something like a dictionary ("field_name":"field_value",...) would be nice. The reason for trying to do it this way is that want to have a single log table to log many tables (again, they are infrequently updated). I need this for PostgreSQL 8.1.

I got suggestions to try composite types but I don't think they could be useful for this. What I need is possibly a generic "row" type ("any" and "record" generate syntax error in CREATE TABLE) - any ideas on where to start looking?



Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux