Skip site navigation (1) Skip section navigation (2)

Re: Timestamp not working

From: "codeWarrior" <gpatnude(at)hotmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Timestamp not working
Date: 2005-11-15 16:01:03
Message-ID: dld0j2$h5u$1@news.hub.org (view raw or flat)
Thread:
Lists: pgsql-admin
CREATE TABLE mytable (

    id serial not null primary key,

    myvalue varchar(50),

    create_dt timestamp not null default now()

);

INSERT INTO mytable (myvalue) VALUES ('When was this record inserted ?');
SELECT * FROM mytable;


"Si" <si(at)hotmail(dot)com> wrote in message
news:88odf(dot)2261$fN5(dot)887(at)newsfe6-gui(dot)ntli(dot)net(dot)(dot)(dot)
>I have added a field to one of my PostgreSQL tables in the "Timestamp"
>datatype, but when I add a row to that table I don't get the date and time
>inserted into that column? Do I need to put a default value into the column
>too?
>





pgsql-admin by date

Next:From: Kevin GrittnerDate: 2005-11-15 16:29:38
Subject: Re: ERROR: could not read block
Previous:From: Jim C. NasbyDate: 2005-11-15 15:55:08
Subject: Re: Major Problem, need help! Can't run our website!

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group