Re: [GENERAL] Allowing update of column only from trigger

2005-01-31 Thread Shawn Harrison
Shawn Harrison wrote [01/28/05 3:53 PM]: I have a table like this: create table objects ( id serial primary key, name varchar not null, parent integer references objects(id) default 1 not null, urivarchar not null ) without oids; The uri column is a denormalization f

Re: [GENERAL] Allowing update of column only from trigger

2005-01-31 Thread Shawn Harrison
Shawn Harrison wrote [01/31/05 12:56 PM]: Shawn Harrison wrote [01/28/05 3:53 PM]: create or replace rule objects__update as on update to objects do instead ( update objects_data set name = new.name, typename = new.typename, parent = new.parent,

Re: [GENERAL] Allowing update of column only from trigger

2005-01-31 Thread Shawn Harrison
PFC wrote [01/28/05 7:08 PM]: First you should use a ltree type for the uri field : Yes, it would be very good if I could use ltree rather than rolling my own, but ltree doesn't meet my use requirements. - you write it foo.bar instead of /foo/bar That is the problem: The point is to make look

Re: [GENERAL] Allowing update of column only from trigger

2005-01-31 Thread Shawn Harrison
Andrey V. Semyonov wrote [01/29/05 12:45 PM]: isn't it possible to restrict UPDATE by access rights based on the DB's user? Create table with owner set to the administrator of the database (NOT PostgreSQL SERVER!!!) and grant only the needed rights (or none of them) to the user from which the u

Re: [GENERAL] Allowing update of column only from trigger

2005-01-29 Thread Andrey V. Semyonov
isn't it possible to restrict UPDATE by access rights based on the DB's user? Create table with owner set to the administrator of the database (NOT PostgreSQL SERVER!!!) and grant only the needed rights (or none of them) to the user from which the usual processing of the database will be perfo

Re: [GENERAL] Allowing update of column only from trigger

2005-01-28 Thread PFC
First you should use a ltree type for the uri field : - you write it foo.bar instead of /foo/bar - there are operators on ltree types to express "is parent of", "is children of" - these operators are indexed Check the readme : http://www.sai.msu.su/~megera/postgres/gist/ltree/ If you h

[GENERAL] Allowing update of column only from trigger

2005-01-28 Thread Shawn Harrison
I have a table like this: create table objects ( id serial primary key, namevarchar not null, parent integer references objects(id) default 1 not null, uri varchar not null ) without oids; The uri column is a denormalization for performance, storing a "