On 3/13/06 6:19 AM, "Joao Miguel Ferreira" <jmf(at)estg(dot)ipvc(dot)pt> wrote:
> Hello all,
>
> is it possible to have Pg automatically insert a Date or Time value on a
> record if the INSERT comand does not include one ?
>
> Something similar to AUTO INCREMENT for INTs ?!?!
>
> This way the program that does the INSERT wouldn't have to worry about
> the correct Date/Time value nor format....
Look at setting defaults and set the default to something like 'now()'.
Create table .... (
mydate date default 'now()',
);
Sean