Re: Auto-updated fields
От | Andrew Dunstan |
---|---|
Тема | Re: Auto-updated fields |
Дата | |
Msg-id | 498AF451.4090601@dunslane.net обсуждение исходный текст |
Ответ на | Re: Auto-updated fields (Christopher Browne <cbbrowne@gmail.com>) |
Ответы |
Re: Auto-updated fields
|
Список | pgsql-hackers |
Christopher Browne wrote: >>> >>> I think this is a TODO, but not sure who is working on it or what needs to be >>> done. The generic version in pagila is perhaps not generic enough: >>> >>> CREATE FUNCTION last_updated() RETURNS trigger >>> AS $$ >>> BEGIN >>> NEW.last_update = CURRENT_TIMESTAMP; >>> RETURN NEW; >>> END $$ >>> LANGUAGE plpgsql; >>> >>> It requires you name your column last_update, which is what the naming >>> convention is in pagila, but might not work for everyone. Can someone work >>> with that and move forward? Or maybe give a more specific pointer to the >>> generic trigger stuff (I've not looked at it before) >>> >> Well, I thought it was a good idea, but no one seems to want to do the >> work. >> > > I'd like to see more options than that, which, it seems to me, > establishes a need for more design work. > > > At the very least it should not have a hard-coded field name in it. You should pass the field name to be set as a parameter in the trigger setup. That's probably a lot more doable if the trigger is written in C, and in any case I think any prepackaged triggers we provide should be written in C. cheers andrew
В списке pgsql-hackers по дате отправления: