As someone else said a serial is probably easier, but
a trigger is probably a better bet than a rule for this purpose.
Using a plpgsql before insert trigger will do it.
On Wed, 10 Jan 2001, Andrew Higgs wrote:
> Hi all,
>
> I have looked at some previous posting and thought that I had found
Andrew Higgs wrote:
>
> Hi all,
>
> I have looked at some previous posting and thought that I had found
> exactly what I need. What I need is to insert an id (from a sequence)
> when a new record is inserted. The following example almost does what I
> need :
>
> CREATE TABLE topics (id int, to
Hi all,
I have looked at some previous posting and thought that I had found
exactly what I need. What I need is to insert an id (from a sequence)
when a new record is inserted. The following example almost does what I
need :
CREATE TABLE topics (id int, topic varchar(50), descriotion text);