Thread: Time Stamp auto Field
hi can we make a field auto incrementing field using Time Stamp data type
am Tue, dem 05.12.2006, um 17:31:53 +0530 mailte deepak pal folgendes: > hi can we make a field auto incrementing field using Time Stamp data type On INSERT: set the default value for this field to now() For Update: create a trigger to do this. Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47215, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net
On Tue, Dec 05, 2006 at 17:31:53 +0530, deepak pal <deepak.05pal@gmail.com> wrote: > hi can we make a field auto incrementing field using Time Stamp data type You can use a column default that uses current_timestamp for its expression. If you also want to handle updates or override cases where people supply values for that column, then you should look at using before triggers.