Re: cache lookup failed for index - Mailing list pgsql-general

From Willy-Bas Loos
Subject Re: cache lookup failed for index
Date
Msg-id CAHnozTiLwZD=KHovfMO=AE7winK9rV8FqUfJmVxvmGLbEoSxgw@mail.gmail.com
Whole thread Raw
In response to Re: cache lookup failed for index  (Willy-Bas Loos <willybas@gmail.com>)
Responses Re: cache lookup failed for index
List pgsql-general
On Wed, Jun 29, 2016 at 11:16 AM, Willy-Bas Loos <willybas@gmail.com> wrote:

Ah OK. So it needs a lock for the visibility to be registered to the transaction, is that it?


Wait that doesn't make sense. pg_dump merely describes the table in DDL, so it doesn't even need access to the index pages. It only needs to read the pg_catalog afaik.
However, the indexes are created as a last step in the pg_dump process (at least in the resulting dump file). So it first makes the DDL to create the table, then dumps the data, and in the end it describes the constraints, indexes and privileges.
So maybe pg_dump first creates the DDL, then acquires a access share lock on the table for dumping the data, and then when it's time to create DDL for the index, it is gone from the pg_catalog.
So what i don't get is, -if the above is the case- If  pg_dump expects to find an index, it already knows about its existence. Then why does it need to look for it again?

--
Willy-Bas Loos

pgsql-general by date:

Previous
From: Willy-Bas Loos
Date:
Subject: Re: cache lookup failed for index
Next
From: "David G. Johnston"
Date:
Subject: Re: Sub-query having NULL row returning FALSE result