pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: COPY FROM ... WHERE fails for negated operators
Date: Mon, 05 Oct 2026 13:48:44 -0400
Message-ID: <1087919.1791222524@sss.pgh.pa.us> (raw)
In-Reply-To: <asPZRTci4oBvxR9A@nathan>
References: <asPZRTci4oBvxR9A@nathan>

Nathan Bossart <nathandbossart@gmail.com> writes:
> 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.

Ugh.  We really ought to get rid of fix_opfuncids() in favor of
insisting that operator clauses be filled in fully from the start.
But that's not happening right now, so I concur with this fix
for the moment.

			regards, tom lane






view thread (3+ messages)  latest in thread

Message-ID: <1087919.1791222524@sss.pgh.pa.us>
Permalink:  ../1087919.1791222524@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1087919.1791222524@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, nathandbossart@gmail.com
  Subject: Re: COPY FROM ... WHERE fails for negated operators
  In-Reply-To: <1087919.1791222524@sss.pgh.pa.us>
  References: <asPZRTci4oBvxR9A@nathan> <1087919.1791222524@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox