Selective sequence..

From: "Timo Tuomi" <timo(dot)tuomi(at)sllpilots(dot)fi>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Selective sequence..
Date: 2002-12-06 17:14:26
Message-ID: 004c01c29d4a$eec4c990$7e00a8c0@bonham
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


Hello Gurus,

I would like to have a table 'members' with columns 'memberid' and
'member_role' implemented so that when I add a member it automatically
inserts a nextval('memberid') into the memberid field ONLY if
member_role='a_particular_role' otherwise 0.

I have a strong feeling that it's not too complicated at all, but I could
use a hint.

Thanks,
Timo

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Josh Berkus 2002-12-06 19:28:44 Re: Test to see if currval will fail?
Previous Message Vijay Deval 2002-12-06 15:44:54 Re: tcl script