Re: [ADMIN] Rules/Triggers executio order

2006-10-18 Thread Jim C. Nasby
On Wed, Oct 18, 2006 at 06:42:21PM -0600, Benjamin Krajmalnik wrote: > I have a partitioned table to which I route data using a trigger. > I am changing it to use a set of rules which executes "INSTEAD" on > insert. > The parent table currently has a trigger. > > The system is a live system. I w

Re: [ADMIN] Rules on a view overwrite default values. Any way to

2005-01-03 Thread Bradley Kieser
Thanks Tom and Stephan! This works perfectly! Brad Tom Lane wrote: Bradley Kieser <[EMAIL PROTECTED]> writes: The problem is that rules on a view mean that the default values for NOT NULL columns (used extensively) no longer trigger! The way you're supposed to fix this is to attach default

Re: [ADMIN] Rules on a view overwrite default values. Any way to

2005-01-03 Thread Stephan Szabo
On Mon, 3 Jan 2005, Bradley Kieser wrote: > Hi, > > I use views extensively to implement security on tables. This requires > each table to have a view. All updates, inserts and deletes take place > through the view. The view has rules for each of these operations > defining security for that table

Re: [ADMIN] Rules on a view overwrite default values. Any way to reinstate them?

2005-01-03 Thread Tom Lane
Bradley Kieser <[EMAIL PROTECTED]> writes: > The problem is that rules on a view mean that the default values for NOT > NULL columns (used extensively) no longer trigger! The way you're supposed to fix this is to attach default values to the view itself. ALTER TABLE myview ALTER COLUMN updated_t

Re: [ADMIN] Rules on a view overwrite default values. Any way to

2005-01-03 Thread Bradley Kieser
Hmm... I have tested this and it works a treat for cols that I ONLY want to put the default values into, but sadly the coalesce function doesn't accept default as one of its parameters, so I can't use this for columns that I want to default only if null. :-( Scott Marlowe wrote: On Mon, 2005-01

Re: [ADMIN] Rules on a view overwrite default values. Any way to

2005-01-03 Thread Bradley Kieser
Hey Scott, that's ingenious, only thing is that I use NOT NULL for many data columns too, where the value may or may not be passed in. Will try with a COALESCE and will post back here. Thx again! Brad Scott Marlowe wrote: On Mon, 2005-01-03 at 11:02, Bradley Kieser wrote: Hi, I use views exte

Re: [ADMIN] Rules on a view overwrite default values. Any way to

2005-01-03 Thread Scott Marlowe
On Mon, 2005-01-03 at 11:02, Bradley Kieser wrote: > Hi, > > I use views extensively to implement security on tables. This requires > each table to have a view. All updates, inserts and deletes take place > through the view. The view has rules for each of these operations > defining security fo

Re: [ADMIN] rules

2004-05-19 Thread Jie Liang
Sorry, wrong question. -Original Message- From: Jie Liang Sent: Wednesday, May 19, 2004 10:20 AM To: Tom Lane Cc: postgres-list; [EMAIL PROTECTED] Subject: [ADMIN] rules According to the document of rule: CREATE RULE rulename AS ON delete TO mytablename DO ( delete from aaa where id=OL

RE: [ADMIN] rules problem

2000-05-08 Thread Nicolas Huillard
Here is my $0.02 : * when you create "id SERIAL", Postgres remembers to call function nextval on each insertion, * the rule's NEW.id item uses the function nextval itself instead of it's result This explains why the ID's are what you see : * first of all, you insert the log, calling nextval for t

Re: [ADMIN] Rules and clustering

1999-10-25 Thread Peter Eisentraut
In the CLUSTER description it says: "The table is actually copied to a temporary table in index order, then renamed back to the original name. For this reason, all grant permissions and other indexes are lost when clustering is performed." It sure seems to me that rules would get lost along the