timestamps

Поиск
Список
Период
Сортировка
От strawman@plexi.com
Тема timestamps
Дата
Msg-id 36D3801C.7F016EEA@plexi.com
обсуждение исходный текст
Список pgsql-general
I'm trying to create a column that defaults to the current time and date. I
tried the SQLServer like syntax below but potgresql choked:

CREATE TABLE clicks (
    avo_userid varchar (10) NOT NULL ,
    link_id int NOT NULL ,
    the_time timestamp NOT NULL CONSTRAINT df_now DEFAULT (timestamp('now'))
);
NOTICE:  there is more than one function named "timestamp"
NOTICE:  that satisfies the given argument types. you will have to
NOTICE:  retype your query using explicit typecasts.
ERROR:  function timestamp(unknown) does not exist

Is "timestamp" not both a type and a function? How can I look it up?

And one more question: How does one construct a foreign key relationship in
postgres?


Thanks for any help.



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [GENERAL] Transaction logging
Следующее
От: Bob VonMoss
Дата:
Сообщение: restricting select statements