Re: on update restrict - Mailing list pgsql-sql

From Mister ics
Subject Re: on update restrict
Date
Msg-id F91jkO22ZhCl8aii08N00007fba@hotmail.com
Whole thread Raw
In response to on update restrict  ("Mister ics" <mister_ics@hotmail.com>)
Responses Re: on update restrict
List pgsql-sql
>
>     The behaviour is correct according to the SQL specifications.
>     RESTRICT (as well as NO ACTION) means, you cannot change  the
>     primary key value of the referenced row. All other values can
>     be changed of course.
>
>     So an attempt to
>
>         UPDATE t1 SET id = 2 WHERE id = 1;
>
>     is the thing prevented in your above example.
>
>
>Jan
>


Hi Jan,

Thank you , i  understand now.

Do you know a method to block the update of certain rows in a table not 
using the triggers ? I explain better:
I have the needing to prevent the updating of a set of rows in a table. The 
first solution i can find is to use a boolean column (es. "Blocked") and 
rising a trigger on updating the table. The trigger checks if the row is 
updatable or not (checking the "Blocked" column).
Is this the only (or better) way to do this ?

Thanks,

Silvio

_________________________________________________________________
Scarica GRATUITAMENTE MSN Explorer all'indirizzo 
http://explorer.msn.it/intl.asp



pgsql-sql by date:

Previous
From: Randall Skelton
Date:
Subject: Re: psql connection being reset during function?
Next
From: Alan Gutierrez
Date:
Subject: Re: Re: DateDiff, IsNull?