pg.ddx.io pgsql-bugs@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: Dennis Kögel <dk@neveragain.de>
To: pgsql-bugs@postgresql.org
Subject: Parallel pg_restore fails to import views with triggers (dependency problem?)
Date: Tue, 26 Jan 2016 19:21:31 +0100
Message-ID: <1445A624-D09F-4B51-9C41-46BA1E2D6862@neveragain.de> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Hi,
as far as I currently understand it: When a view has to be dumped as table + rule, and it has triggers, it seems that parallel pg_restore fails to understand that the trigger depends on the rule (at least on 9.5.0 and before).
A simple test case (see attachment):
# 1) create empty DB with view + trigger && create dump
$ dropdb x156353; createdb x156353 && psql -d x156353 -qf 156353.sql && pg_dump -d x156353 -Fc -f x156353.pgdump
# 2) create database from that dump, no parallelism: works fine
$ dropdb x156353; pg_restore -Cdpostgres -j1 x156353.pgdump
# 3) create database from that dump, with -j >1: fails
$ dropdb x156353; pg_restore -Cdpostgres -j2 x156353.pgdump
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 2852; 2620 1001120 TRIGGER tr_staff_v postgres
pg_restore: [archiver (db)] could not execute query: ERROR: "staff_v" is a table
DETAIL: Tables cannot have INSTEAD OF triggers.
Command was: CREATE TRIGGER tr_staff_v INSTEAD OF INSERT ON staff_v FOR EACH ROW EXECUTE PROCEDURE tf_staff_v();
- D.
P.S.: Thanks to RhodiumToad for making sense of this.
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Attachments:
156353.sql (application/octet-stream, 508B) download
view thread (2+ messages) latest in thread
Message-ID: <1445A624-D09F-4B51-9C41-46BA1E2D6862@neveragain.de> Permalink: ../1445A624-D09F-4B51-9C41-46BA1E2D6862@neveragain.de/ Also on: postgresql.org/message-id/1445A624-D09F-4B51-9C41-46BA1E2D6862@neveragain.de ·
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-bugs@postgresql.org Cc: dk@neveragain.de Subject: Re: Parallel pg_restore fails to import views with triggers (dependency problem?) In-Reply-To: <1445A624-D09F-4B51-9C41-46BA1E2D6862@neveragain.de> References: <1445A624-D09F-4B51-9C41-46BA1E2D6862@neveragain.de> * 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