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

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

2005-01-03 Thread Bradley Kieser
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. Under other conditions, the view also removes com