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.