Re: Insert into a date field

Поиск
Список
Период
Сортировка
От Shoaib Mir
Тема Re: Insert into a date field
Дата
Msg-id bf54be870702020545p1d755059g2f6a5d2cbb78ab59@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Insert into a date field  (Richard Huxton <dev@archonet.com>)
Ответы Re: Insert into a date field  ("Ezequias Rodrigues da Rocha" <ezequias.rocha@gmail.com>)
Список pgsql-sql
Just tried the following way, that might help you:

postgres=# create table testing (a date);
CREATE TABLE
postgres=# insert into testing values (to_date('1963-09-01', 'YYYY-MM-DD'));
INSERT 0 1
postgres=# select * from testing;
     a
------------
 1963-09-01
(1 row)

--
Shoaib Mir
EnterpriseDB (www.enterprisedb.com)

On 2/2/07, Richard Huxton <dev@archonet.com> wrote:
Ezequias Rodrigues da Rocha wrote:
> Hi list,
>
> I am trying to insert a record in a table with a date field but the
> postgresql reports me the following error:
>
> ERROR: column "data_nascimento" is of type date but expression is of type
> integer
> SQL state: 42804
> Hint: You will need to rewrite or cast the expression.
>
>
> I tryed like this:
>
>
> '1963-09-01'
> '1963-09-01'::date
> 1963-09-01

Show us the whole statement - this doesn't look like the error to me.

--
   Richard Huxton
   Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

В списке pgsql-sql по дате отправления:

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Insert into a date field
Следующее
От: "Ezequias Rodrigues da Rocha"
Дата:
Сообщение: Duplicate records