Selective Auto-Timestamp [using triggers?]

Поиск
Список
Период
Сортировка
От Dan Lyke
Тема Selective Auto-Timestamp [using triggers?]
Дата
Msg-id 14941.57361.537181.77366@wynand.flutterby.com
обсуждение исходный текст
Ответ на Selective Auto-Timestamp [using triggers?]  (Rajit Singh <singh.raj@studychoice.com>)
Список pgsql-general
Rajit Singh writes:
> The thing is, I also want to be able to update the timestamp field
> if I want to...

Here's my solution:

CREATE FUNCTION updated_stamp () RETURNS OPAQUE AS
'    BEGIN
    IF NEW.updated ISNULL THEN
        NEW.updated := ''now'';
    END IF;
        RETURN NEW;
    END;
' LANGUAGE 'plpgsql';

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: "Cluster" means "tangle" for me
Следующее
От: Lamar Owen
Дата:
Сообщение: Re: PostgreSQL v7.1BETA3 Bundled and Available ...