Re: pg7.3.4: pg_atoi: zero-length string

Поиск
Список
Период
Сортировка
От Rob Fielding
Тема Re: pg7.3.4: pg_atoi: zero-length string
Дата
Msg-id 3FA7C329.5060205@dsvr.net
обсуждение исходный текст
Ответ на Re: pg7.3.4: pg_atoi: zero-length string  (Andrew Sullivan <andrew@libertyrms.info>)
Список pgsql-general
> For the record, it _never_ treated it as NULL.  It treated it as
> "empty string".  '' != NULL.  In fact, !(NULL=NULL) & !(NULL!=NULL).
> SQL uses three-valued logic.


You're absolutely right.  That explains why, when I quickly looked, some
are zero's and some are NULLs - the NULLs where NULLs and the zeros
where empty strings.

Two different bad-programming examples.  If I actually used these
columns for anything whenever they didn't have non zero or null data in
them then I'd have probably been alot more careful about what went in them.

I presume that an 32bit integer of zero and a NULL are represented
differently in the database ?  I suppose internally you aren't
representing a NULL within the context of a 32bit integer field and it
would just probably be magic pointer to the next field - some sort of
exercise in space squashing?  I don't know anything about the internal
stucture of the tuples.

Dependant on the above, it would probably make sense to clean up the
database, especially considering these columns are also indexed.


Cheers

--

Rob Fielding
Development
Designer Servers Ltd


В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Problem with Pg_dumpall
Следующее
От: Ron St-Pierre
Дата:
Сообщение: Re: Constraint Problem