Обсуждение: How to get description of table field in trigger

Поиск
Список
Период
Сортировка

How to get description of table field in trigger

От
"Andrey Y. Mosienko"
Дата:
Hello All!

There is a table:

CREATE TABLE "base" (
    "id" int4 DEFAULT nextval('base_id_seq'::text) NOT NULL,
    "field" text NOT NULL,
    "field_m" text NOT NULL,
    "field_n" text NOT NULL
);

COMMENT ON TABLE base IS 'base table';
COMMENT ON COLUMN base.field_m IS 'monitor';


CREATE FUNCTION archive() RETURNS opaque AS '
    END;
    ' LANGUAGE 'plpgsql';

CREATE TRIGGER "archive" AFTER UPDATE
    ON base FOR EACH ROW
    EXECUTE PROCEDURE archive();

Is there a method to get descriptions of the fields in TABLE base in my function archive?

I found col_description(tableOID, columnnumber) but I can't understand how to use it.
How to get tableOID in my function?

--
with respection Andrey Feofilactovich.
e-mail: feo@ttn.ru, feo@feo.org.ru
ICQ: 28073807