Re: IMMUTABLE columns in tables?

Поиск
Список
Период
Сортировка
От Chris Browne
Тема Re: IMMUTABLE columns in tables?
Дата
Msg-id 877hm0p9yw.fsf@cbbrowne-laptop.afilias-int.info
обсуждение исходный текст
Ответ на IMMUTABLE columns in tables?  (Adrian von Bidder <avbidder@fortytwo.ch>)
Ответы Re: IMMUTABLE columns in tables?  (Vick Khera <vivek@khera.org>)
Re: IMMUTABLE columns in tables?  (Joshua Tolley <eggyknap@gmail.com>)
Список pgsql-general
avbidder@fortytwo.ch (Adrian von Bidder) writes:
> Heyho!
>
> (Ok, seems to be feature wish day ...)
>
> I was wondering if others would find an IMMUTABLE (or whatever) column
> constraint useful as well.  Semantics would (obviously?) be to disallow
> changing the value of this column after insert.
>
> I realize that this is possible via triggers, and with the recent
> possibility of having triggers fire only on changes to certain columns it's
> even (presumably) not much runtime overhead, but creating triggers is very
> verbose and doesn't make the db schema very readable.

I'd like that feature, and I don't think it takes too much arguing to
get to the point that a declarative "IMMUTABLE" control is rather less
opaque than someone saying "oh, you could just create a trigger
running PL/LOLCODE to do that!"

I thought that this was on the Todo list, but I don't see it.
<http://wiki.postgresql.org/wiki/Todo>

If you're keen on getting it onto the ToDo list, the argumentation
process would be made easier if the material about this included
answers to a couple more questions:
  - What do other databases use as syntax for this?
  - Does SQL standard have anything to say about how this sort
    of thing ought to be declared?
--
select 'cbbrowne' || '@' || 'cbbrowne.com';
http://cbbrowne.com/info/internet.html
"MS  apparently now  has a  team dedicated  to tracking  problems with
Linux  and publicizing them.   I guess  eventually they'll  figure out
this back fires... ;)" -- William Burrow <aa126@DELETE.fan.nb.ca>

В списке pgsql-general по дате отправления:

Предыдущее
От: maarten
Дата:
Сообщение: integer to little endian conversion
Следующее
От: Janning
Дата:
Сообщение: Re: Disk performance