From: | "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: "Constant" fields in a table |
Date: | 2007-06-15 08:32:38 |
Message-ID: | 20070615083238.GH14492@a-kretschmer.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
am Fri, dem 15.06.2007, um 10:24:26 +0200 mailte Adrian von Bidder folgendes:
> Hi,
>
> I want to tighten down my db schema as much as possible against accidential
> corruption. For this, I'd like to have fields that can only inserted and
> not later changed (think some sort of "id", account names, etc., which are
> often not only stored in the database but also in external places so
> changing is just a definitive DON'T).
>
> Obviously I can check this with triggers, but it occured me that some kind
> of "CONSTANT" field attribute would be nice. Perhaps such a construct
> already exists? Or perhaps somebody has come up with a generic way to do
> this without having to write 30 or 50 small triggers all over the place?
You can use RULE for this:
http://www.postgresql.org/docs/techdocs.7
Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net
From | Date | Subject | |
---|---|---|---|
Next Message | Gregory Stark | 2007-06-15 08:49:31 | Re: pg_restore out of memory |
Previous Message | Adrian von Bidder | 2007-06-15 08:24:26 | "Constant" fields in a table |