Re: [SQL] NULL becomes default

2006-08-21 Thread Andrew Sullivan
On Sun, Aug 20, 2006 at 11:34:48AM +0100, Julian Scarfe wrote: > So thinking about this a little more, it requires me to be able to change a > column value to DEFAULT (unless I implement the default from scratch in the > trigger, but that feels messy). I don't have much experience of triggers:

Re: [SQL] NULL becomes default

2006-08-20 Thread Julian Scarfe
Thus I would like NULLs in such INSERTs to be treated as DEFAULT rather than violating the constraint. Is there an easy way to do that at the database level? From: "Markus Schaber" <[EMAIL PROTECTED]> Did you try a "before insert" trigger that checks new_id for null values, and replaces it wi

Re: [SQL] NULL becomes default

2006-08-19 Thread Markus Schaber
Hi, Julian, Julian Scarfe wrote: > A surrogate key has been introduced on a table with modifiers: > > Column|Type | Modifiers > -+-+ > > new_id| integer

Re: [SQL] NULL becomes default

2006-08-17 Thread Sumeet
Hi Julian u need to reset your sequence, i had run through the same problem. On 8/17/06, Julian Scarfe <[EMAIL PROTECTED] > wrote:A surrogate key has been introduced on a table with modifiers:    Column|Type |Modifiers-+-+-

[SQL] NULL becomes default

2006-08-17 Thread Julian Scarfe
A surrogate key has been introduced on a table with modifiers: Column|Type | Modifiers -+-+ new_id| integer | not null default nextval(('som