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

2003-09-04 Thread Josué Maldonado
Hi Jan, You are right, that's why the loop doesn't goes through all the columns. Thanks. Jan Wieck wrote: 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 wi

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

2003-09-04 Thread Jan Wieck
close the connection and reconnect to get a fresh backend that doesn't cache anything. Jan Josué Maldonado wrote: Hello list, The TCL trigger that uses NEW and OLD arrays failed after after I removed a unused column, now I got this error: pltcl: Cache lookup for attribute 'pg.dropped

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

2003-09-04 Thread Jan Wieck
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 [EMAIL PROTECT

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

2003-09-04 Thread Ian Harding
It seems to work for me... create table foobar ( col1varchar, col2varchar) ; create function testfunc() returns trigger language pltcl as ' foreach id [array names NEW] { elog NOTICE $NEW($id) } '; create trigger testtrig after insert or update on foobar for each row exec

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

2003-09-04 Thread Josué Maldonado
Alvaro, Actually I build a new table from the old one, so the table in metion is a new table with the same structure as before, the way I droped the column was right click on it from pgadmin III then delete, why should that matter? Thanks Alvaro Herrera Munoz wrote: On Thu, Sep 04, 2003 at

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

2003-09-04 Thread Tom Lane
Alvaro Herrera Munoz <[EMAIL PROTECTED]> writes: > It would help if you send the complete example, including the part > where you actually drop a column from the table. Oh, I forgot about that part (should read the Subject: line again ;-)). I do see a failure after dropping a column. I've applie

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

2003-09-04 Thread Alvaro Herrera Munoz
On Thu, Sep 04, 2003 at 09:01:08AM -0600, Josu? Maldonado wrote: > Tom, > > This is my table definition: [etc] It would help if you send the complete example, including the part where you actually drop a column from the table. -- Alvaro Herrera (<[EMAIL PROTECTED]>) "La victoria es para quien s

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

2003-09-04 Thread Josué Maldonado
Tom, This is my table definition: -- Table: public.tinv -- DROP TABLE public.tinv; CREATE TABLE public.tinv ( dep_codigo varchar(6) NOT NULL, dep_nombre varchar(35), dep_cantid int4, dep_fecadq date, dep_vidaut int4, dep_pordep int4, dep_valdep float4, dep_acumul float4, dep_t

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

2003-09-04 Thread Tom Lane
=?ISO-8859-1?Q?Josu=E9_Maldonado?= <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Hard to believe. Could you give us a complete example, not a partial >> one? > This is the code in the trigger function: I tried this with a table created like so: regression=# create table tinv ( regression(# f

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

2003-09-04 Thread Josué Maldonado
Hi Tom, Tom Lane wrote: =?ISO-8859-1?Q?Josu=E9_Maldonado?= <[EMAIL PROTECTED]> writes: Noticed that the loop does not go through all fields: Hard to believe. Could you give us a complete example, not a partial one? This is the code in the trigger function: -- Function: public.audit_log() --

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

2003-09-03 Thread darren
>From what i am seeing / thinking did you drop it from the table ??? I am assuming yes and therefore you should recreate the function and the trigger and you should be fine. Using 7.3.x use the CREATE OR REPLACE FUNCTION to replace the function so it will still have the same OID. Next drop the

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

2003-09-03 Thread Josué Maldonado
Hi Ian, Ian Harding wrote: Is the column you deleted one that you referred explicitly by name in your function? No, the column I deleted does not get refered explicitly in the function. What version are you using? 7.3.3, and I'm planning to upgrade to 7.3.4 later today maybe that can help. Th

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

2003-09-03 Thread Josué Maldonado
Hi Darren, [EMAIL PROTECTED] wrote: From what i am seeing / thinking did you drop it from the table ??? I am assuming yes and therefore you should recreate the function and the trigger and you should be fine. Using 7.3.x use the CREATE OR REPLACE FUNCTION to replace the function so it will sti