Re: TCL trigger doesn't work after deleting a column

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: darren(at)crystalballinc(dot)com
Cc: Josué Maldonado <josue(at)lamundial(dot)hn>, pgsql-general(at)postgresql(dot)org
Subject: Re: TCL trigger doesn't work after deleting a column
Date: 2003-09-04 19:45:39
Message-ID: 3F579663.3060001@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The arrays NEW and OLD only contain entries for attributes in the
respective rows that are not NULL. The list $TG_relatts contains a list
of all column names of the triggering relation with a leading empty
element (to make the index in that list reflect pg_attribute.attnum).

Jan

darren(at)crystalballinc(dot)com wrote:

> Not sure exactly why but put [array names NEW] in an elog and put [array
> names OLD] in an elog then make sure they are all there.
>
> If they are all there then the foreach will definately work
>
> Also the ID tiene $id) <--- if not in original code good otherwise should
> not be there
>
> Darren
>
> On Wed, 3 Sep 2003, Josué Maldonado wrote:
>
>> Noticed that the loop does not go through all fields:
>>
>> foreach id [array names NEW] {
>> elog NOTICE "ID tiene $id)"
>> elog NOTICE "OLD tiene $OLD($id)"
>> elog NOTICE "NEW tiene $NEW($id)"
>> }
>>
>> foreach id [array names OLD] {
>> elog NOTICE "ID tiene $id)"
>> elog NOTICE "OLD tiene $OLD($id)"
>> elog NOTICE "NEW tiene $NEW($id)"
>> }
>>
>> Both cases the loop skips some fields, any idea?
>>
>> Thanks.
>>
>>
>>
>> ---------------------------(end of broadcast)---------------------------
>> TIP 7: don't forget to increase your free space map settings
>>
>

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Josué Maldonado 2003-09-04 20:17:52 Re: TCL trigger doesn't work after deleting a column
Previous Message Jan Wieck 2003-09-04 19:40:11 Re: TCL trigger doesn't work after deleting a column