Re: cast record type to array?

From: Gerardo Herzig <gherzig(at)fmed(dot)uba(dot)ar>
To: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: cast record type to array?
Date: 2010-05-28 20:14:19
Message-ID: 4C00241B.3020604@fmed.uba.ar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Jasen Betts wrote:
> On 2010-05-26, Gerardo Herzig <gherzig(at)fmed(dot)uba(dot)ar> wrote:
>> Hi all. Im not being able to cast a record variable into an array.
>>
>> Im writing a trigger, and i would like to store NEW (and OLD) as text[].
>> There is a way to do it in plpgsql? (w/o any contrib modules)
>
> why not store them as text instead?
>
> new::text
>
> is a valid cast.
>
>
Hi Jasen. Storing the record in text format will difficult furter
analisis (p.e.searching columns with differences between OLD and NEW).

It will not be easy to play with NEW as string for obtaining each column
values (string_to_array will not work, the values for NEW can be anything)

As this trigger will save information for audit, it is important to get
it right.
Even worst, im *strongly encouraged* not to use any other language
except plpgsql, so i cant use plpythonu, in wich will be trivial to do so.

thanks for your time, Jasen

Gerardo

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jasen Betts 2010-05-29 10:27:59 Re: Extending Regular Expression bounds limit of 255.
Previous Message Brent DeSpain 2010-05-28 15:44:28 Re: Extending Regular Expression bounds limit of 255.