null and integer field

Поиск
Список
Период
Сортировка
Искать

null and integer field

От:
"Hamid Khoshnevis" <hamid@emarq.com>
Дата:
The content of an integer field when unassigned appears to be different from
pushing a null into that field.   Can someone please explain the difference
and show me how to push an 'unassigned' into that integer field.

I am using:
update table foo set integer_field=null where blah blah;

Thanks,

hamid


Re: [SQL] null and integer field

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
"Hamid Khoshnevis"  writes:
> The content of an integer field when unassigned appears to be different from
> pushing a null into that field.   Can someone please explain the difference
> and show me how to push an 'unassigned' into that integer field.

There is no such concept as 'unassigned' in SQL; whatever you are
observing, it's not that.  An integer field should indeed be NULL
if it hasn't got a default and you didn't provide a value when you
inserted the tuple.

Can you provide more details about the problem you're having?
		regards, tom lane

FAQ