Your question, your audience. Choose who sees your identity—and your question—with question security.
create table test_table (id serial
, name character varying
, user_id_created
, user_id_modified
, datetime_created
, datetime_modified
)
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
DENY UPDATE ON test_table ( user_id_created) TO <users or group as you want>
to fill them on creation:
user name is a system function: current_user or user:
https://www.postgresql.org/docs/9.1/static/functions-info.html
and date/time functions:
https://www.postgresql.org/docs/9.1/static/functions-datetime.html
to specify the "default" in the syntax:
https://www.postgresql.org/docs/9.2/static/ddl-default.html
to update the "update" fields, use a trigger on the table:
https://www.postgresql.org/docs/9.4/static/sql-createtrigger.html