mada
mada

Reputation: 1565

PostgreSql : Disallow the update of a column : how?

Is is possible with PostgreSql without a trigger to not allow the update of a column, just the insertion is allowed.

Upvotes: 9

Views: 5239

Answers (1)

Martin Smith
Martin Smith

Reputation: 453037

Completely untested but as Postgres SQL supports column level permissions it looks like it might be. http://www.postgresql.org/docs/current/static/sql-grant.html

Does this work?

GRANT SELECT (col1, col2), INSERT(col1, col2), UPDATE (col1) ON mytable TO userX;

Upvotes: 20

Related Questions