Search Postgresql Archives

About array in PlPgsql trigger function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

In PostgreSQL 8.0.1 (plpgsql), I was trying to use array in the trigger function.

DECLARE
      clear_id_colValueArr    VARCHAR[100];
BEGIN
      clear_id_colValueArr[1] := NEW.clear_id1;
      clear_id_colValueArr[2] := NEW.clear_id2;
      clear_id_colValueArr[3] := NEW.clear_id3;
....
      clear_id_colValueArr[100] := NEW.clear_id100;
...
END;

I always get NULL for clear_id_colValueArr. Also, I tried to run
raise notice '%', clear_id_colValueArr[0], I got an compile error.

Could someone tell me how to use array in a trigger function please?

Also, is there a way that I can get NEW.ColValues by specifying column number but not NEW.ColumnName?

Thanks a lot,
Ying




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux