Selective Auto-Timestamp [using triggers?] - Mailing list pgsql-general

From Dan Lyke
Subject Selective Auto-Timestamp [using triggers?]
Date
Msg-id 14941.57361.537181.77366@wynand.flutterby.com
Whole thread Raw
In response to Selective Auto-Timestamp [using triggers?]  (Rajit Singh <singh.raj@studychoice.com>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: "Cluster" means "tangle" for me
Next
From: Lamar Owen
Date:
Subject: Re: PostgreSQL v7.1BETA3 Bundled and Available ...