Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i5smu-0005YO-T1 for pgsql-general@arkaria.postgresql.org; Thu, 05 Sep 2019 14:31:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i5smt-00086L-6F for pgsql-general@arkaria.postgresql.org; Thu, 05 Sep 2019 14:31:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i5sms-0007cp-0b for pgsql-general@lists.postgresql.org; Thu, 05 Sep 2019 14:31:02 +0000 Received: from [66.111.4.25] (helo=out1-smtp.messagingengine.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1i5sml-00075A-Ce for pgsql-general@postgresql.org; Thu, 05 Sep 2019 14:31:00 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 9448322281; Thu, 5 Sep 2019 10:30:44 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 05 Sep 2019 10:30:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=M cdrURVjVK4Cyjj1Shnt1OEXCvZA2L1mHAu27oDi92c=; b=PHR9h4pPjV42VD30L I0aOc7/Wjejhxc6T8R3991GxnLtME6eeMGYEkrSxL7vob4ED17iJ5daXxe2IJ+bz /Jzem3rcoXOg71Eq6626RRr576Ciaw2IFgBY3m6/Nw3qbTa14AwodDm/RGQyAV6v Ozpz5DsW268ipLpLD1JBAjgKDX7hZGvKtHQs+6C246nmMSydKRqI4mXAZ7OtHZ8N hJrfDPfucVr5j/Hy23+LYB0eIPVV2h5FKEQpW8PCkzlgGGNrfnykNkcRvlPlQjw8 F+r6/PSp+iJRaMXJq0uw6aKVSzCuagvXNfEp6dgbrc9N0mn7jYULw551V394oxxR uUb4Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=McdrURVjVK4Cyjj1Shnt1OEXCvZA2L1mHAu27oDi9 2c=; b=tP14mOWLHqjsZx9I2FHuukDTwGB+dt8ouJVKdfaJiPvYI9M+5X5FYIlFC Z3V3IOXLwmaoy61e8e9dveUEJBd0joLZigG39/Cho7+VrQUZSqfzaS1MVYpfx9nf SY6ECDvQB2IjnOrzvRC1zhEeXVcDRKEyVF7s3VY6sUh1JLPqk49Wqd0941mFOH4d jgDwu78H957dchaRuGXrgx71rEHhMQe5X4orZW57Ke8k87Tvy4UeyIBjINajcp5G FC1uVBH9bEebsEDJYh9Tu2i8brSlNjTfiDEkn2lSuRMWiThVzMjpzTN1AYzXZiwZ DJf98Sl5wgmns2/HjC6ZfrzIBzYVA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudejjedgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucffohhmrghinhepphhoshhtghhrvghsqhhlqdgrrhgthhhivhgvrdhorhhgpdhp ohhsthhgrhgvshhqlhdrohhrghenucfkphepjedurddvuddvrdduhedtrddvtddvnecurf grrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghr rdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from [192.168.1.4] (unknown [71.212.150.202]) by mail.messagingengine.com (Postfix) with ESMTPA id E0A0380066; Thu, 5 Sep 2019 10:30:42 -0400 (EDT) Subject: Re: Cannot restore dump when using IS DISTINCT FROM on a HSTORE column To: Lele Gaifax , pgsql-general@postgresql.org References: <87woem4ymk.fsf@metapensiero.it> From: Adrian Klaver Message-ID: Date: Thu, 5 Sep 2019 07:30:39 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <87woem4ymk.fsf@metapensiero.it> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.25 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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-public-hstore-public-hstore-td6077272.html > [2] https://www.postgresql.org/message-id/flat/ffefc172-a487-aa87-a0e7-472bf29735c8%40gmail.com > -- Adrian Klaver adrian.klaver@aklaver.com