Re: plpgsql - Inserting DEFAULT Value.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Vams <vmudrageda(at)charter(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: plpgsql - Inserting DEFAULT Value.
Date: 2004-06-20 19:37:51
Message-ID: 7403.1087760271@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Vams <vmudrageda(at)charter(dot)net> writes:
> Important point: I need this to be a generic function. I got multiple
> tables that have a id column, each with their own unique sequences,
> and I want to use the same function for all of them. So NEW.id :=
> nextval('some_sequence') can't work.

Nonetheless, that is the direction you want to go.

Consider passing the appropriate sequence name to the function as a
trigger parameter.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adam Smith 2004-06-21 02:50:53 Is this a "Stupid Question" ?
Previous Message Tom Lane 2004-06-20 19:23:52 Re: Using Large Object in PostgreSQL