Fwd: Re: time to integer - Mailing list pgsql-general

From Soma Interesting
Subject Fwd: Re: time to integer
Date
Msg-id 5.0.2.1.0.20010306115739.02b1be10@pop.telus.net
Whole thread Raw
List pgsql-general
I should have mentioned that NEW.id is set to default to nextval('id_seq').


>this is my trigger and function:
>
>CREATE FUNCTION oned_member_num() RETURNS OPAQUE AS '
>         BEGIN
>                 NEW.member_num := NEW.id + date_part('epoch', timestamp
> 'now');
>                 RETURN new;
>         END;'
>LANGUAGE 'plpgsql';
>
>
>CREATE TRIGGER oned_member_num
>BEFORE INSERT
>ON members
>FOR EACH ROW
>EXECUTE PROCEDURE oned_member_num();
>
>I'm not 100% sure that a pl/pgsql function is the best/only solution here.
>Is it overkill, or my only option?



pgsql-general by date:

Previous
From: ryan@paymentalliance.net
Date:
Subject: PHP and PostgresSQL beta
Next
From: Soma Interesting
Date:
Subject: Re: time to integer