DEFAULT now() ?

Поиск
Список
Период
Сортировка
От ty
Тема DEFAULT now() ?
Дата
Msg-id 000e01bfa922$03466330$a20efea9@indus
обсуждение исходный текст
Ответы Re: DEFAULT now() ?
Список pgsql-admin
May someone please show me the necessary code snippets that would allow the value of a column to take the current time ( ala now() ) by default on INSERT?
 
Indicative example:
 
CREATE TABLE foo (
    a INTEGER NOT NULL DEFAULT 0,
    b DATETIME NOT NULL DEFAULT now()
);
 
INSERT INTO foo (a) VALUES (123);
 
What happens here? Well, a row is inserted into table ``foo'' where ``a'' has the value 123 and b holds the date & time of when the create DDL statement was executed. I'm wondering how to get b to have the value of the time whenever any arbitrary insert statement is executed...
 
Ty
 

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

Предыдущее
От: Loïc TREGOUËT
Дата:
Сообщение: This Object side of postgresql
Следующее
От: Raul Carvalho
Дата:
Сообщение: RE: Maintenance