pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Lele Gaifax <lele@metapensiero.it>
To: pgsql-general@postgresql.org
Subject: Re: Cannot restore dump when using IS DISTINCT FROM on a HSTORE column
Date: Thu, 5 Sep 2019 07:30:39 -0700
Message-ID: <e6284cec-7c2d-950d-33e2-cdf7d4e9d9bc@aklaver.com> (raw)
In-Reply-To: <87woem4ymk.fsf@metapensiero.it>
References: <87woem4ymk.fsf@metapensiero.it>

On 9/5/19 7:16 AM, Lele Gaifax wrote:
> Hi all,
> 
> I'm hitting a problem very similar to the one described here[1]: one of my
> databases have the following trigger
> 
>     CREATE TRIGGER trg_dn_customer_contents_950_reset_usable
>       BEFORE UPDATE
>       ON dn.customer_contents
>       FOR EACH ROW
>           WHEN (OLD.usable IS NOT NULL AND OLD.usable = NEW.usable
>                 AND (OLD.customer_content_category_id IS DISTINCT FROM NEW.customer_content_category_id
>                      OR OLD.title IS DISTINCT FROM NEW.title
>                      OR OLD.summary IS DISTINCT FROM NEW.summary
>                      OR OLD.description IS DISTINCT FROM NEW.description
>                      OR OLD.active IS DISTINCT FROM NEW.active
>                      OR OLD.languages IS DISTINCT FROM NEW.languages
>                      OR OLD.address_id IS DISTINCT FROM NEW.address_id
>                      OR OLD.schedule IS DISTINCT FROM NEW.schedule
>                      OR OLD.price IS DISTINCT FROM NEW.price))
>           EXECUTE FUNCTION dn.reset_customer_content_usable()
> 
> where several of those columns are HSTOREs. Trying to restore a dump I get the
> same error: "ERROR:  operator does not exist: public.hstore = public.hstore".
> The source and target PG versions are the same, 11.5.
> 
> I followed the link[2] and read the related thread: as it is more that one
> year old, I wonder if there is any news on this, or alternatively if there is
> a recommended workaround: as that is the only place where I'm using IS
> DISTINCT FROM against an HSTORE field, I could easily replace those
> expressions with the more verbose equivalent like
> 
>     (OLD.x IS NULL AND NEW.x IS NOT NULL)
>     OR
>     (OLD.x IS NOT NULL AND NEW.x IS NULL)
>     OR
>     (OLD.x <> NEW.x)
> 
> lacking a better approach.
> 
> What would you suggest?

I don't know if progress has been made on this or not.

Are you able to use a plain text dump?

If so you might try changing:

SELECT pg_catalog.set_config('search_path', '', false);

to something that covers the path where you installed hstore.

> 
> Thanks in advance,
> ciao, lele.
> 
> [1] https://www.postgresql-archive.org/BUG-15695-Failure-to-restore-a-dump-ERROR-operator-does-not-exist...
> [2] https://www.postgresql.org/message-id/flat/ffefc172-a487-aa87-a0e7-472bf29735c8%40gmail.com
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (5+ messages)  latest in thread

Message-ID: <e6284cec-7c2d-950d-33e2-cdf7d4e9d9bc@aklaver.com>
Permalink:  ../e6284cec-7c2d-950d-33e2-cdf7d4e9d9bc@aklaver.com/
Also on:    postgresql.org/message-id/e6284cec-7c2d-950d-33e2-cdf7d4e9d9bc@aklaver.com

 · 

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: adrian.klaver@aklaver.com, lele@metapensiero.it
  Subject: Re: Cannot restore dump when using IS DISTINCT FROM on a HSTORE column
  In-Reply-To: <e6284cec-7c2d-950d-33e2-cdf7d4e9d9bc@aklaver.com>
  References: <87woem4ymk.fsf@metapensiero.it> <e6284cec-7c2d-950d-33e2-cdf7d4e9d9bc@aklaver.com>

* 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