Search Postgresql Archives

Re: Altering field passed as parameter to plpgsql trigger

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

 



Richard Huxton wrote:
Steve Crawford wrote:

What is the correct syntax for the line:
new.field_to_alter = some_computed_value;

Can't be done in plpgsql - it's too static a language. On first call, that assignments basically gets compiled into a planned query and from then on you're stuck.

You can use pl/tcl or pl/perl etc. since they're more dynamic.
Great. I'll use another approach.

Also, does plpgsql have a preferred way to identify the table that fired the trigger. I see the syntax for C but not for plpgsql.

TG_RELNAME / TG_TABLE_NAME - it's in the plpgsql/triggers section of the manual.

Thanks. I did find that after another cup of coffee. :)

Cheers,
Steve


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
      message can get through to the mailing list cleanly

[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