I have a database that is about Heroku. A field is filled automatically with the date. I try to use current_timestamp
, but it seems that it does not work.
Here is the schema of the database.
drop table if exists users;
create table users (
id int GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
name varchar,
email varchar,
username varchar,
password varchar,
register_date CURRENT_TIMESTAMP() not null
);
Here is the query:
cur.execute("INSERT INTO users(name, email, username, password) VALUES(%s, %s, %s, %s)", (name, email, username, password))
And here is the error:
ERROR: syntax error at or near "CURRENT_TIMESTAMP"
LINE 7: register_date CURRENT_TIMESTAMP() not null