From: | Thomas Lockhart <lockhart(at)fourpalms(dot)org> |
---|---|
To: | frank_lupo <frank_lupo(at)email(dot)it> |
Cc: | pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: problem insert time into column timestamp |
Date: | 2002-08-01 13:21:11 |
Message-ID: | 3D4935C7.82389D9C@fourpalms.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
> When working with Ingres, it is possible to create a field "date"
> and insert into this a time value e.g. '10:12:12'
> the current date is assigned automatically by Ingres
> e.g. '31/07/2002 10:12:12'
Hmm. That is a big jump to assume that a date/time value missing *all*
date information should default those fields to "today". Not supported
in standards at all afaik.
What is the behavior if you try entering in *no* information at all? Do
you get today's date at midnight? Does anyone know if other databases
have the same behavior?
> When working with Postgres, I receive an error when trying to insert a
> time value into a timestamp field
> gedis30=# insert into pippo (aa) values('10:12:12')\g
> ERROR: Bad timestamp external representation '10:12:12'
Right. You can give it a hint:
lockhart=> select timestamp 'today 10:12:12';
timestamptz
------------------------
2002-08-01 10:12:12-07
But what is your use case? Do you have users entering in dates and you
want them to be able to skip the date fields if they know it is for
today? If so, you might think about having your application preload the
date fields with correct values??
- Thomas
From | Date | Subject | |
---|---|---|---|
Next Message | Jeff Eckermann | 2002-08-01 13:22:32 | Re: Regular expressions or LIKE ? HELP needed ! |
Previous Message | Fabiàn R.Breschi | 2002-08-01 12:45:05 | Re: MySQL or Postgres ? |