Patrick Samson <[EMAIL PROTECTED]> writes:
> Attribute names beginning with a dot are filtered
> just in one place, in pltcl_trigger_handler().
> (version 7.3.5)

I am not sure why that code is there.  It is *not* there to prevent the
loop from touching dropped attributes, because the same code is in the
original 1.1 version of pltcl.c, long before we could drop attributes.
Jan, do you remember why you put this into pltcl_trigger_handler()?

     * Ignore pseudo elements with a dot name
    if (*(ret_values[i]) == '.') {
        i += 2;

It's not documented behavior that I can see, and it doesn't seem to have
any use other than making pltcl triggers fail if a user chooses a field
name starting with a dot :-(

> Attached is a patch to :
> - Add a filter in two other places, in relation
>   with the mentioned error message:
>    pltcl_set_tuple_values()
>    pltcl_build_tuple_argument()

This is already done in 7.4, although for some reason
pltcl_trigger_handler got overlooked - I will fix that.

> - Add the same filter in the build of TG_relatts.
>   This will prevent a tcl script which loops on
>   TG_relattrs to fail in trying to use a dropped
>   column.

This is deliberately *not* done in 7.4, because it would break the
documented behavior of TG_relatts:


     A Tcl list of the table column names, prefixed with an empty list
     element. So looking up a column name in the list with 
     Tcl's lsearch command returns the element's number starting with 1
     for the first column, the same way the 
     columns are customarily numbered in PostgreSQL. 

I think we need to preserve the relationship to column numbers.  People
who just want a list of the live columns can get it from the OLD or NEW

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to