pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Vick Khera <vivek@khera.org>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: How to schema-qualify "IS DISTINCT FROM" on trigger definition? (I created a db that cannot be dump/restored)
Date: Wed, 21 Feb 2024 16:27:07 -0500
Message-ID: <154270.1708550827@sss.pgh.pa.us> (raw)
In-Reply-To: <CALd+dcf0vAfGKOLEjoh3Qsg5GaLnwrq_iti6Kind1dERZfy-9g@mail.gmail.com>
References: <CALd+dcf0vAfGKOLEjoh3Qsg5GaLnwrq_iti6Kind1dERZfy-9g@mail.gmail.com>

Vick Khera <vivek@khera.org> writes:
> I've created a database which my vendor (Supabase) cannot
> dump/restore/upgrade. Ultimately, it comes down to this trigger statement,
> and the fact that the underlying operations needed to perform the `IS
> DISTINCT FROM` comparison in the WHEN clause need to be found in the
> `public` schema. During the restore, the search path is empty, so it fails.

Yeah.  We've had some discussions about inventing a version of IS
DISTINCT FROM (and some other SQL-spec syntaxes with the same problem)
that supports schema-qualification of the underlying operator.  But
it hasn't gotten further than preliminary discussion.

For the moment, I think the only feasible solution is for your trigger
function to set the search path it needs by adding a "SET search_path
= whatever" clause to the function's CREATE command.

			regards, tom lane





view thread (5+ messages)  latest in thread

Message-ID: <154270.1708550827@sss.pgh.pa.us>
Permalink:  ../154270.1708550827@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/154270.1708550827@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-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, vivek@khera.org
  Subject: Re: How to schema-qualify "IS DISTINCT FROM" on trigger definition? (I created a db that cannot be dump/restored)
  In-Reply-To: <154270.1708550827@sss.pgh.pa.us>
  References: <CALd+dcf0vAfGKOLEjoh3Qsg5GaLnwrq_iti6Kind1dERZfy-9g@mail.gmail.com> <154270.1708550827@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