Is is possible with PostgreSql without a trigger to not allow the update of开发者_StackOverflow中文版 a column, just the insertion is allowed.
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;
精彩评论