timestamps - Mailing list pgsql-general

From strawman@plexi.com
Subject timestamps
Date
Msg-id 36D3801C.7F016EEA@plexi.com
Whole thread Raw
List 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 by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] Transaction logging
Next
From: Bob VonMoss
Date:
Subject: restricting select statements