disallow updates on column or whole table - Mailing list pgsql-general

From Peter Billen
Subject disallow updates on column or whole table
Date
Msg-id 493F9C41.6040108@clueless.be
Whole thread Raw
In response to Re: quit milis  (Richard Huxton <dev@archonet.com>)
Responses Re: disallow updates on column or whole table
List pgsql-general
Hi all,

What is the best way to disallow updates on a column of a table, or even
on a whole table itself?

I can write a BEFORE UPDATE trigger which compares old.column_name(s) to
new.column_name(s) and raise an exception if these values are different.

Are there better ways?

Certain properties cannot be changed once inserted. I would like to
enforce that in my database schema.

Thanks in advance. Kind regards,

Peter

pgsql-general by date:

Previous
From: Maximilian Tyrtania
Date:
Subject: tcp_keepalives_idle setting
Next
From: Erwin Moller
Date:
Subject: noobquestion: How does Postgres delete 'smart' when deleting with FK contraints?