pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: shawn wang <shawn.wang.pg@gmail.com>
Cc: wenjing <wjzeng2012@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@lists.postgresql.org, tushar <tushar.ahuja@enterprisedb.com>
Subject: Re: [bug] Table not have typarray when created by single user mode
Date: Tue, 19 May 2020 11:32:39 -0400
Message-ID: <20200519153239.GA17266@alvherre.pgsql> (raw)
In-Reply-To: <CA+T=_GVJ_GHyJ5Y_8WH9X0vyeM=cgZNHiZqTcCDJksc6SHuM1Q@mail.gmail.com>

On 2020-May-19, shawn wang wrote:

> Although single-user mode is used for bootstrapping by initdb. Sometimes it
> is used for debugging or disaster recovery.
> However, it is still possible for users to process data in this mode. If
> only the table is deleted,
> I worry that it will cause inconvenience to the user.
> I don't understand why we must be IsUnderPostmaster to create an array type
> too.
> If we could create an array type in single-user mode, there is not this
> issue.

Looking at the code again, there is one other possible solution: remove
the ereport(ERROR) from AssignTypeArrayOid.  This means that we'll
return InvalidOid and the array type will be marked as 0 in the upgraded
cluster ... which is exactly the case in the original server.  (Of
course, when array_oid is returned as invalid, the creation of the array
should be skipped, in callers of AssignTypeArrayOid.)

I think the argument to have that error check there, is that it's a
cross-check to avoid pg_upgrade bugs for cases where
binary_upgrade_next_array_type_oid is not set when it should have been
set.  But I think we've hammered the pg_upgrade code sufficiently now,
that we don't need that check anymore.  Any bugs that result in that
behavior will be very evident by lack of consistency on some upgrade
anyway.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (14+ messages)  latest in thread

Message-ID: <20200519153239.GA17266@alvherre.pgsql>
Permalink:  ../20200519153239.GA17266@alvherre.pgsql/
Also on:    postgresql.org/message-id/20200519153239.GA17266@alvherre.pgsql

 · 

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: alvherre@2ndquadrant.com, shawn.wang.pg@gmail.com, wjzeng2012@gmail.com, tgl@sss.pgh.pa.us, tushar.ahuja@enterprisedb.com
  Subject: Re: [bug] Table not have typarray when created by single user mode
  In-Reply-To: <20200519153239.GA17266@alvherre.pgsql>

* 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