Re: How to determine field names in a trigger?
От | Justin Clift |
---|---|
Тема | Re: How to determine field names in a trigger? |
Дата | |
Msg-id | 40E10DE1.4000201@telstra.net обсуждение исходный текст |
Ответ на | Re: How to determine field names in a trigger? (Alvaro Herrera <alvherre@dcc.uchile.cl>) |
Ответы |
Re: How to determine field names in a trigger?
|
Список | pgsql-general |
Alvaro Herrera wrote: <snip> > I think you can do this very easily with PL/Tcl. For a somewhat > unrelated example, see General Bits issue #47, > > http://www.varlena.com/GeneralBits/47.php > > _I think_ there are examples closer to what you want to achieve in the > archives. The array of column names in a trigger is $TG_relatts. Thanks Alvaro. Didn't find any good examples in the archives (looked there before asking here), even though there are a few people over time asking the same question. In PL/pgSQL at present (PG 7.4.3), I'm thinking the only approach may be to get the name of the table (TG_RELNAME) and then go and look up it's structure in pg_attribute or something (the same as shown by information_schema.columns). Not sure how to do that either yet, and a better solution would be nifty. PL/TCL does seem to provide that extra bit of info to functions/triggers that I need, whereas PL/pgSQL doesn't. I'd prefer not to have to load further PL's into the database, but it's worth looking at anyway. :) Regards and best wisehs, Justin Clift > Hope this helps, >
В списке pgsql-general по дате отправления: