I may be missing something here but why can't UUID be handled by
allowing function calls or expressions for default values?

On Wed, Dec 17, 2008 at 11:58 AM, Roy Lyseng <[email protected]> wrote:
>
>
> Monty Taylor wrote:
>>
>> Brian Aker wrote:
>>>
>>> Hi!
>>>
>>> On Dec 17, 2008, at 12:50 AM, Roy Lyseng wrote:
>>>
>>>> IMHO, the data type should not implicitly define any insert/update
>>>> semantics around it, unless it makes no sense to support user-level
>>>> operations (which may be the case for UUID?).
>>>
>>> Having a column which is UUID that generates one as default is my
>>> interest.  Whether that is by pass NULL in or just not listing it in
>>> VALUES.... that is the open question to me.
>>
>> From a purist perspective, I would say that just not listing it in
>> values is better. However, from a practical perspective, if you have a
>> table with 10 columns and the _only_ one you aren't providing is the
>> auto-gen uuid column, it would be great if you could skip giving the
>> column list and just do the insert into table values (NULL, 1,2,3); form
>>
>> I saw mention somewhere of a DEFAULT keyword that I've never used
>> before... if we used that ... insert into table values (DEFAULT, 1,2,3);
>>  it would do the same thing and also be clear.
>
> Yepp. And if you define semantics corresponding to an ON INSERT trigger, you
> can specify anything in the INSERT statement, and still have the UUID
> generator create the column value.
>
> And referring to Roland's recent mail, if you want to use a UUID column in a
> foreign key reference, it must be possible to turn off the ON INSERT
> trigger.
>
> Thanks,
> Roy
>
> _______________________________________________
> Mailing list: https://launchpad.net/~drizzle-discuss
> Post to     : [email protected]
> Unsubscribe : https://launchpad.net/~drizzle-discuss
> More help   : https://help.launchpad.net/ListHelp
>



-- 
Eric Bergen
[email protected]
http://www.provenscaling.com

_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to