Lists: | pgsql-sql |
---|
From: | "Brian Ward" <brian0(at)verizon(dot)net> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | timestamp |
Date: | 2002-10-06 14:41:36 |
Message-ID: | anphrbseanphrb$24se$1@news.hub.org@news.hub.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-sql |
How do I create a time stamp column in a table that default to the current
time
when a row is inserted?
I tried putting in now() as the default but I have something wrong
with the syntax or something I think
Any one have an example of a table creation script that has a timestamp
column?
From: | "Brian Ward" <brian0(at)verizon(dot)net> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: timestamp |
Date: | 2002-10-06 15:38:46 |
Message-ID: | anpl6ganpl6g$1i4$1@news.hub.orgi4anpl6g$1i4$1@news.hub.org@news.hub.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-sql |
I think I got it but I'm not sure if it's correct.
I put the default as CURRENT_TIMESTAMP but I though I had read that was
being taken out and only now was supported?
Does anyone know?
"Brian Ward" <brian0(at)verizon(dot)net> wrote in message
news:anphrb$24se$1(at)news(dot)hub(dot)org(dot)(dot)(dot)
> How do I create a time stamp column in a table that default to the current
> time
> when a row is inserted?
> I tried putting in now() as the default but I have something wrong
> with the syntax or something I think
> Any one have an example of a table creation script that has a timestamp
> column?
>
>
From: | Larry Rosenman <ler(at)lerctr(dot)org> |
---|---|
To: | Brian Ward <brian0(at)verizon(dot)net> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: timestamp |
Date: | 2002-10-07 12:25:08 |
Message-ID: | 1033993509.311.17.camel@lerlaptop |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-sql |
On Sun, 2002-10-06 at 09:41, Brian Ward wrote:
> How do I create a time stamp column in a table that default to the current
> time
> when a row is inserted?
> I tried putting in now() as the default but I have something wrong
> with the syntax or something I think
> Any one have an example of a table creation script that has a timestamp
> column?
"comment_timestamp" timestamp(0) with time zone DEFAULT now()
that's a live one from a table I have.
--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler(at)lerctr(dot)org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749
From: | Dan Langille <dan(at)langille(dot)org> |
---|---|
To: | Brian Ward <brian0(at)verizon(dot)net> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: timestamp |
Date: | 2002-10-07 12:35:08 |
Message-ID: | 20021007083035.V12832-100000@m20.unixathome.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-sql |
On Sun, 6 Oct 2002, Brian Ward wrote:
> How do I create a time stamp column in a table that default to the current
> time
> when a row is inserted?
> I tried putting in now() as the default but I have something wrong
> with the syntax or something I think
> Any one have an example of a table creation script that has a timestamp
> column?
When you have an example which does not do what you want, it is better to
provide that so we can see how to correct it.
I am using : firstlogin timestamp default current_timestamp
From: | Dan Langille <dan(at)langille(dot)org> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: timestamp |
Date: | 2002-10-07 12:44:32 |
Message-ID: | 20021007083950.R12832-100000@m20.unixathome.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-sql |
On Sun, 6 Oct 2002, Brian Ward wrote:
And Brian, since this *is* a mailing list, it would be polite to use a
valid email address. I suggest that you either unsubscribe or fix the
email address.
Mail to brian0(at)verizon(dot)net bounces with the message: '550 Invalid
recipient: <brian0(at)verizon(dot)net>'.