Re: Calling function (table_name, schema_name) within event trigger

From: Andreas Kretschmer <andreas(at)a-kretschmer(dot)de>
To: susan(dot)hurst(at)brookhurstdata(dot)com, Melvin Davidson <melvin6925(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Calling function (table_name, schema_name) within event trigger
Date: 2015-12-27 19:12:00
Message-ID: 270483278.2003.1451243520245.JavaMail.open-xchange@oxweb01.ims-firmen.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Melvin Davidson <melvin6925(at)gmail(dot)com> hat am 27. Dezember 2015 um 19:55
> geschrieben:
>
>
> It's kind of difficult to figure out what is going on. Apparently, the
> function that is called "store.add_history_master()" thinks tg_table_name
> is a COLUMN in a table, as evidenced by
> "ERROR: column "tg_table_name" does not exist"
>
> Offhand, you probably want to assign TG_TABLE_NAME to a var and then call
> the function using the var.
> EG:
> DECLARE
> V_TABLE name := TG_TABLE_NAME;
>
> SELECT store.add_history_master($V_TABLE, ....
>
>
> Would you be so kind as to grace us with
> A. The VERSION of PostgreSQL you are working with
> B. The O/S you are working with.
> C. The complete called function IE: store.add_history_master(..)

The problem is, that tg_table_name isn't declared within a event trigger.
TG_TAG is defined, it contains the command, for instance CREATE TABLE.

And: the version is 9.4.4, as you (!) quoted it.

Please don't top-posting, it's hard to understand (as we can see here ...)

Sue: sorry, i haven't a solution, but it's an interesting question. I hope for a
solution.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2015-12-27 19:19:07 Re: Calling function (table_name, schema_name) within event trigger
Previous Message Melvin Davidson 2015-12-27 18:55:30 Re: Calling function (table_name, schema_name) within event trigger