calculated default

From: "SunWuKung" <Balazs(dot)Klein(at)t-online(dot)hu>
To: pgsql-general(at)postgresql(dot)org
Subject: calculated default
Date: 2006-11-16 08:48:08
Message-ID: 1163666888.533735.163930@m73g2000cwd.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a table with a sequence as its primary key.
On insert I would like to have all its fields (except the primary key)
default to the last one in the table (order by id desc limit 1).
I guess I should use a trigger to do this but I don't know how.

Thanks for the help.
SWK

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2006-11-16 08:58:47 Re: ORDER BY
Previous Message Tom Lane 2006-11-16 06:54:37 Re: Recovering deleted or updated rows