COPY FROM ... WHERE fails for negated operators - Mailing list pgsql-hackers

From Nathan Bossart
Subject COPY FROM ... WHERE fails for negated operators
Date
Msg-id asPZRTci4oBvxR9A@nathan
Whole thread
Responses Re: COPY FROM ... WHERE fails for negated operators
List pgsql-hackers
The following steps produce a "cache lookup failed for function" error:

    CREATE TABLE t (a int);
    COPY t FROM stdin WHERE NOT (a > 0);
    1
    0
    \.

I think what's happening is that negate_clause() is calling get_negator()
with a 0 argument because DoCopy() neglects to call fix_opfuncids() (like
RelationGetIndexPredicate() does).  The attached patch fixes this.

-- 
nathan

Attachment

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: pg_*_advice: tsv load failure, etc.
Next
From: Tom Lane
Date:
Subject: Re: COPY FROM ... WHERE fails for negated operators