pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Olga Vingurt <olga.vingurt@gmail.com>
To: tgl@sss.pgh.pa.us
Cc: pgsql-general@lists.postgresql.org
Subject: Re: pg_restore fails due to foreign key violation
Date: Tue, 11 Dec 2018 13:07:49 +0200
Message-ID: <CAOkHHZJAsyv0pdTQTt824otSNec69O2O+siToeAHDTqpNyg-Xw@mail.gmail.com> (raw)
In-Reply-To: <28278.1544463193@sss.pgh.pa.us>
References: <CAOkHHZKZ_HGw56OiBAN9s9ZT8o42rH4vriCHPOeYAYdp=jwsfQ@mail.gmail.com>
	<28278.1544463193@sss.pgh.pa.us>

Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Hm.  In theory, that truncation failure in itself shouldn't have caused a
> problem --- autovacuum is just trying to remove some empty pages, and if
> they don't get removed, they'd still be empty.  However, there's a problem
> if the pages are empty because we just deleted some recently-dead tuples,
> because the state of the pages on-disk might be different from what it
> is in-memory.


It indeed looks like that was exactly the issue.
The error we saw in the event log happened only once and mentioned the
specific table we had issues with.
We had rows in the table which should have been deleted due to foreign key
constraint (ON DELETE CASCADE configured for the foreign key) and when I
tried to select one of the rows by using the column with the foreign key
nothing returned in the query so I guess the matching index was missing the
rows.

In the short term, what you need to do is figure out what caused the
> permission failure.  The general belief among pgsql-hackers is that
> shoddy antivirus products tend to cause this, but I don't know details.
>

There is no antivirus on the Windows server. As it happened only once (in a
few years we installed on the server) and we don't have any additional info
why PostgreSQL got "Permission denied" error we will hope for the best i.e.
that we won't get into this situation again.
Thanks a lot for the help!

Regards,
Olga

view thread (6+ messages)

Message-ID: <CAOkHHZJAsyv0pdTQTt824otSNec69O2O+siToeAHDTqpNyg-Xw@mail.gmail.com>
Permalink:  ../CAOkHHZJAsyv0pdTQTt824otSNec69O2O+siToeAHDTqpNyg-Xw@mail.gmail.com/
Also on:    postgresql.org/message-id/CAOkHHZJAsyv0pdTQTt824otSNec69O2O+siToeAHDTqpNyg-Xw@mail.gmail.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: olga.vingurt@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: pg_restore fails due to foreign key violation
  In-Reply-To: <CAOkHHZJAsyv0pdTQTt824otSNec69O2O+siToeAHDTqpNyg-Xw@mail.gmail.com>
  References: <CAOkHHZKZ_HGw56OiBAN9s9ZT8o42rH4vriCHPOeYAYdp=jwsfQ@mail.gmail.com> <28278.1544463193@sss.pgh.pa.us> <CAOkHHZJAsyv0pdTQTt824otSNec69O2O+siToeAHDTqpNyg-Xw@mail.gmail.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