Re: plpgsql - Inserting DEFAULT Value. - Mailing list pgsql-general

From Tom Lane
Subject Re: plpgsql - Inserting DEFAULT Value.
Date
Msg-id 7403.1087760271@sss.pgh.pa.us
Whole thread Raw
In response to plpgsql - Inserting DEFAULT Value.  (Vams <vmudrageda@charter.net>)
Responses Re: plpgsql - Inserting DEFAULT Value.
List pgsql-general
Vams <vmudrageda@charter.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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Using Large Object in PostgreSQL
Next
From: t_murtagh@vodafone.ie (Thomas)
Date:
Subject: PostGres ODBC MFC Application