I'm building a database for a site and I keep getting an incorrect syntax error for this portion of it:
CREATE TABLE posts (
pid SERIAL PRIMARY KEY,
title VARCHAR(255),
body VARCHAR,
user_id INT REFERENCES users(uid),
author VARCHAR REFERENCES users(username),
date_created TIMESTAMP
like_user_id INT[] DEFAULT ARRAY[]::INT,
likes INT DEFAULT
);
When I put a comma after TIMESTAMP, it then switches the error message to after the INT [] on the like_user_id line.
user_idandauthorwith two references to the same table using different columsn?