Re: [HACKERS] Simple row serialization?

2008-01-27 Thread Ivan Voras
On 27/01/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Sat, Jan 26, 2008 at 07:32:35PM +0100, Ivan Voras wrote: > > Andrew Dunstan wrote: > [...] > > >Or you could use an hstore (see contrib). > > > > Doesn't seem applicable. > > Have a

Re: [HACKERS] Simple row serialization?

2008-01-26 Thread Ivan Voras
Tom Lane wrote: "Pavel Stehule" <[EMAIL PROTECTED]> writes: On 26/01/2008, Tom Lane <[EMAIL PROTECTED]> wrote: Although this won't work at the SQL level in 8.1, I think you might be able to accomplish the equivalent within plpgsql by assigning the rowtype value to a text variable. you lost n

Re: [HACKERS] Simple row serialization?

2008-01-26 Thread Ivan Voras
Andrew Dunstan wrote: Why not create the audit tables with composite types rather than strings? create table audit_foo_table as (who text, when timestamptz, old foo, new foo); Because this would lead to having a log/shadow/audit table for every table I wish to log. (or is there an opaque

Re: [HACKERS] Simple row serialization?

2008-01-26 Thread Ivan Voras
Pavel Stehule wrote: Hello, use plperl. I'd like something more light-weight to reduce complexity of deployment. Something in pgplsql would be ideal. Is there a way to simply iterate over the fields of a row and retrieve field names and values? PostgreSQL hasn't simple tool for it. Maybe

[HACKERS] Simple row serialization?

2008-01-26 Thread Ivan Voras
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