pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: Artur Zakirov <zaartur@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: pg_dump crash on identity sequence with not loaded attributes
Date: Tue, 10 Dec 2024 12:03:52 -0500
Message-ID: <77015.1733850232@sss.pgh.pa.us> (raw)
In-Reply-To: <cd6b865d-4ae7-46a0-9212-f09453f9468c@eisentraut.org>
References: <CAKNkYnwXFBf136=u9UqUxFUVagevLQJ=zGd5BsLhCsatDvQsKQ@mail.gmail.com>
	<cd6b865d-4ae7-46a0-9212-f09453f9468c@eisentraut.org>

Peter Eisentraut <peter@eisentraut.org> writes:
> On 09.12.24 16:54, Artur Zakirov wrote:
>> pg_dump crashes when a table is added into an extension and its
>> identity sequence isn't.

> Maybe the bug is that this scenario is possible in the first place?  The 
> identity sequence is an internal dependency.  It would be like putting a 
> view into an extension but not the underlying rule?

As far as I can tell, views' rules are not marked as direct members of
the extension, whether they are made within the extension's script or
later on.  The same for indexes.  (I think this was intentional to
avoid bloating pg_depend more than necessary.)  So those cases might
not be great analogies.  Rules and indexes can't exist except as
auxiliary objects of a table, so a sequence isn't quite the same
situation anyway.

Even if we hacked things up so that the sequence got added to the
table's extension, a user could still get into this state with
ALTER EXTENSION ... DROP SEQUENCE.  So between that and having
existing databases with the issue, I think pg_dump has to be made
to cope with it.  I'm also talking myself into the idea that we
have to do our best to actually reproduce the situation, not
just ignore the sequence, which is what the currently-proposed
patch would do.  Maybe forcing owning_tab->interesting to true
is the right fix?  But the rule about "don't dump sequences of
not-to-be-dumped-tables" is still problematic from this standpoint.

			regards, tom lane





view thread (13+ messages)  latest in thread

Message-ID: <77015.1733850232@sss.pgh.pa.us>
Permalink:  ../77015.1733850232@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/77015.1733850232@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, peter@eisentraut.org, zaartur@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: pg_dump crash on identity sequence with not loaded attributes
  In-Reply-To: <77015.1733850232@sss.pgh.pa.us>

* 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