Problems with default date and time

From: "Hutton, Rob" <HuttonR(at)plymart(dot)com>
To: "'pgsql-sql(at)postgresql(dot)org'" <pgsql-sql(at)postgresql(dot)org>
Subject: Problems with default date and time
Date: 1999-08-13 13:44:18
Message-ID: 11EFC736FB68D111B9DD00805FAD7C6D1E0C35@plymartpdc.internal.plymart.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I have created a table with date and time fields by using what I read as
being the correct default statements, but I get the date and time the DB was
created at each insert instead of the current date and time.

+----------------------------------+----------------------------------+-----
--+
| Field | Type |
Length|
+----------------------------------+----------------------------------+-----
--+
| ord_id | int4 not null default nextval ( |
4 |
| req_id | int4 not null default nextval ( |
4 |
| ord_description | varchar() |
1500 |
| ord_priority | varchar() |
1500 |
| ord_pri_order | int4 |
4 |
| ord_time | time default text 'now' |
8 |
| ord_date | date default text 'now' |
4 |
| ord_timestamp | timestamp default text 'now' |
4 |
| ord_tech | varchar() |
1500 |
| ord_stat | varchar() |
2 |
| ord_notes | varchar() |
1500 |
| ord_whse | int4 |
4 |
+----------------------------------+----------------------------------+-----
--+

The insert statements for the following records were executed about 30
seconds apart.

|09:34:22|08-13-1999|1999-08-13 09:34:22-04|test3 | | |
96| 95| | |
|09:34:22|08-13-1999|1999-08-13 09:34:22-04|test4 | | |
97| 96| | |
|09:34:22|08-13-1999|1999-08-13 09:34:22-04|test4 | | |

[PostgreSQL 6.5.0 on i686-pc-linux-gnu, compiled by gcc egcs-2.91.66] on
Redhat Linux 6.0, Kernel 2.2.10

Thanks in advance for the help,
Rob

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Patrik Kudo 1999-08-13 14:04:36 Re: [SQL] Problems with default date and time
Previous Message Bart Ogryczak 1999-08-13 09:07:18 Re: [SQL] Searching Text Fields - Case Sensitive?