DEFAULT TEXT 'now'

Поиск
Список
Период
Сортировка
От Roberto Joao Lopes Garcia
Тема DEFAULT TEXT 'now'
Дата
Msg-id 3.0.5.32.19990323155824.007fa8c0@pop.hipernet.com.br
обсуждение исходный текст
Ответы Re: [SQL] DEFAULT TEXT 'now'  (Howie <caffeine@toodarkpark.org>)
Список pgsql-sql
Hi

I´m have a table like bellow:

CREATE TABLE conex (
    id int4 PRIMARY KEY DEFAULT NEXTVAL('seq_conex'),

    inicio datetime DEFAULT TEXT 'now',
    ultimo datetime DEFAULT TEXT
'now',
                 .
                 .
                 .
)

insert into conex (ip) values(´200.200.200.200´)

Will result every time the same data and time for ´inicio´ and ´ultimo´!

I want to insert the current date and time. Is that code correct and the
result a bug???
Is there an way to make the DEFAULT work???

I know I can insert like:

insert into conex (ip, inicio, ultimo) values(´200.200.200.200´, ´now´, ´now´)

but I would like to use DEFAULT.

PostgreSQL 6.4 - Solaris 2.5 sparc

Thank you

Roberto



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

Предыдущее
От: Forgacs Tamas
Дата:
Сообщение: transaction-lock?
Следующее
От: Howie
Дата:
Сообщение: Re: [SQL] DEFAULT TEXT 'now'