pg_restore: [archiver (db)] could not execute query: ERROR: operator does not exist: public.hstore = public.hstore

From: Cherio <cherio(at)gmail(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: pg_restore: [archiver (db)] could not execute query: ERROR: operator does not exist: public.hstore = public.hstore
Date: 2019-03-15 21:12:13
Message-ID: CAKHqFkL0pYC9Tdk5W-6T0GFz_A2EuqnxwbG3V_WY1kXgj93SFg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I am exporting DB from 10.6 and importing into 10.7 and an UPDATE rule
fails to restore. I have a view and a rule that starts like this

CREATE OR REPLACE RULE table_view__upd__rul AS ON UPDATE
TO cfg.table_view
DO INSTEAD (
UPDATE sch.tab
SET
updated_at = NEW.updated_at,
updated_by = NEW.updated_by,
hstore_field = NEW.hstore_field
WHERE id = OLD.id
AND
(
OLD.updated_at IS DISTINCT FROM NEW.updated_at OR
OLD.updated_by IS DISTINCT FROM NEW.updated_by OR
OLD.hstore_field IS DISTINCT FROM NEW.hstore_field
);
....

I export into a custom format as
pg_dump -F c -Z 0 -T bak.* -T tmp.* -h host -p port database > file.dump

and import with
pg_restore -v -d database -j 4 -p port file.dump

which results into an error
pg_restore: [archiver (db)] could not execute query: ERROR: operator does
not exist: public.hstore = public.hstore
LINE 3: ...ISTINCT FROM (new.updated_by)::text) OR (old.hstore_field IS
DISTINC...

with an arrow pointing to "old.hstore_field IS -->DISTINC..."

From the log I can see that hstore was extension successfully created and
many other tables, views and functions successfully recreated prior to this
error.

This looks like a bug to me :(

Thank you!

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2019-03-15 21:20:38 BUG #15695: Failure to restore a dump, ERROR: operator does not exist: public.hstore = public.hstore
Previous Message Masahiko Sawada 2019-03-15 12:37:55 Re: Query issues on Foreign tables