Re: Can't delete Null value from a not null field

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Can't delete Null value from a not null field
Дата
Msg-id 4304.959119701@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Can't delete Null value from a not null field  ("Bryan White" <bryan@arcamax.com>)
Список pgsql-general
"Bryan White" <bryan@arcamax.com> writes:
> I get the output:
>     ERROR:  ExecutePlan: (junk) `ctid' is NULL!
> I get the same error if I try to update the null row.
> At this point I figured I would outsmart it and use the oid.  However it
> appears the oid is null as well.

Wow, that's bizarre.  It shouldn't be *possible* for oid or ctid to be
null --- AFAIK they don't have a null-value bit.  There must be
something really hosed up about that tuple's header.

> Any suggestions?  At this point the only thing I can see to do is dump the
> table and run the dump through a filter for the bad record and then reload
> it.

Slightly faster than a dump and reload:

RENAME broken table to something else;

CREATE TABLE new-table;

INSERT INTO new-table SELECT * FROM broken-table WHERE custid IS NOT NULL;

then recreate the indexes wanted on new-table...

            regards, tom lane

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

Предыдущее
От: Marten Feldtmann
Дата:
Сообщение: Re: Re: [HACKERS] Postgresql OO Patch
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Explain auth/access/priv system??