Get / Set Composite Type Fields within triggers

Поиск
Список
Период
Сортировка
От Martin Durao
Тема Get / Set Composite Type Fields within triggers
Дата
Msg-id CAF+QOjg72k+PkmoS8YGOJG3bH4xkrtivW8RBOVedpXfbgyJ=6A@mail.gmail.com
обсуждение исходный текст
Ответы Re: Get / Set Composite Type Fields within triggers  (Ingmar Brouns <swingi@gmail.com>)
Список pgsql-general
Hi

This is my first question, so, forgive me if it's a newby issue but I couldn't find an answer googling.
I have a simple composite type 

CREATE TYPE info_base AS
   (by text,
    at timestamp without time zone);

I want to use it as the data type of created, modified and deleted fields. I already know hot to index, update and select a sub-field like

CREATE INDEX ix_created_by ON xxx.yyy ((created).by);
UPDATE xxx.yyy SET created.by = 'user';
select * from xxx.yyy where (created).by = 'that user';

My problem is inside triggers: How can I set or get type field values for NEW or OLD? (I need it to check users permissions at row level, etc.)

I tried NEW.((created).by), NEW.(created.by),  NEW.created.by and nothing works...

Could you help me please?

Thanks in advance.
Martin

В списке pgsql-general по дате отправления:

Предыдущее
От: Tatsuo Ishii
Дата:
Сообщение: postgres_fdw changes schema search path
Следующее
От: Albe Laurenz
Дата:
Сообщение: Re: File size consideration of file_fdw in PostgreSQL