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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Bryan White" <bryan(at)arcamax(dot)com>
Cc: "pgsql-general" <pgsql-general(at)postgreSQL(dot)org>
Subject: Re: Can't delete Null value from a not null field
Date: 2000-05-23 22:08:21
Message-ID: 4304.959119701@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Bryan White" <bryan(at)arcamax(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2000-05-23 22:16:01 Re: Explain auth/access/priv system??
Previous Message Francisco Hernandez 2000-05-23 21:46:34 postgresql on macosx server?