Is is possible with PostgreSql without a trigger to not allow the update of a column, just the insertion is allowed.
You must revoke SELECT access on the table and provide column access with only columns you want the user to access. Column access to particular columns will not work if users already have SELECT access on the whole table.
First, specify the name of the table to which the column you want to change belongs in the ALTER TABLE clause. Second, give the name of column whose data type will be changed in the ALTER COLUMN clause. Third, provide the new data type for the column after the TYPE keyword.
PostgreSQL ROLLBACK command is used to undo the changes done in transactions.
For modifying the column's default value, we can use the ALTER TABLE ALTER COLUMN SET DEFAULT or DROP DEFAULT command. ALTER TABLE table_name ALTER COLUMN column_name [SET DEFAULT value | DROP DEFAULT]; We will use ALTER TABLE ADD CONSTRAINT command for adding a constraint.
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;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With