Re: Read-only column

From: Claudio Succa <claudio(dot)succa(dot)ml(at)pertel(dot)it>
To: pgsql-general(at)postgresql(dot)org
Cc: Doug McNaught <doug(at)mcnaught(dot)org>
Subject: Re: Read-only column
Date: 2003-12-13 15:19:57
Message-ID: 1071328797.696.19.camel@master.to1.pertel.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Il ven, 2003-12-12 alle 20:11, Doug McNaught ha scritto:
> Claudio Succa <claudio(dot)succa(dot)ml(at)pertel(dot)it> writes:
>
> > Given a table like the following:
> >
> > CREATE TABLE mytable (
> > progr integer PRIMARY KEY,
> > record_creation_date date DEFAULT current_date,
> > ...
> > other columns
> > ...
> > );
> >
> > is there a way to deny any modifications to 'record_creation_date'
> > without using a view?
>
> Sure, you can use a trigger.
>
> -Doug

Thanks a lot Doug.

(Not to reinvent the wheel, do you know where I could find a suitable
function to use in the trigger?)

Claudio

--
Claudio Succa
PERTEL - Torino - Italy
+39-011-437.4141
http://www.pertel.it
http://www.uniassist.it

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Doug McNaught 2003-12-13 15:24:16 Re: Read-only column
Previous Message Chris Travers 2003-12-13 14:48:24 Re: Read-only column

Browse pgsql-hackers by date

  From Date Subject
Next Message Doug McNaught 2003-12-13 15:24:16 Re: Read-only column
Previous Message Chris Travers 2003-12-13 14:48:24 Re: Read-only column