[Nitro] Re: Og default values

Michael Neumann mneumann at ntecs.de
Thu Feb 24 11:26:32 EST 2005


George Moschovitis wrote:
> Hello Michael, 
> 
> I am trying to implement your 'default values' sugestion.
> The problem is Og precalculates the insert code for each object,
> so Og *has* to emmit something for each property. If I emmit NULL
> the RDBMS will use the DEFAULT value?

No, it will not use the default value (at least not on Postgres). It 
will raise an error if the column is NOT NULL. But the default value is 
NULL if no value was given and no default was specified.

Hm, could you show how this pregenerated code looks like? Maybe this 
could be modified to be more dynamic (not sure how this would affect 
performance, but I guess it will not be noticable)?

If this is not feasible, then it's better to use NULL as default value 
for *every* column/type. If you haven't specified a value, and a column 
is NOT NULL, this will raise an error.

Regards,

   Michael



More information about the Nitro-general mailing list