pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: wenjing <wjzeng2012@gmail.com>
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: Mon, 13 Apr 2020 10:51:16 -0400
Message-ID: <32412.1586789476@sss.pgh.pa.us> (raw)
In-Reply-To: <761F1389-C6A8-4C15-80CE-950C961F5341@gmail.com>
References: <761F1389-C6A8-4C15-80CE-950C961F5341@gmail.com>

wenjing <wjzeng2012@gmail.com> writes:
> Use single user mode (t_create_by_standalone) typarray = 0, but use psql t_create_by_psql typarray has oid.

That's because of this in heap_create_with_catalog:

    /*
     * Decide whether to create an array type over the relation's rowtype. We
     * do not create any array types for system catalogs (ie, those made
     * during initdb). We do not create them where the use of a relation as
     * such is an implementation detail: toast tables, sequences and indexes.
     */
    if (IsUnderPostmaster && (relkind == RELKIND_RELATION ||
                              relkind == RELKIND_VIEW ||
                              relkind == RELKIND_MATVIEW ||
                              relkind == RELKIND_FOREIGN_TABLE ||
                              relkind == RELKIND_COMPOSITE_TYPE ||
                              relkind == RELKIND_PARTITIONED_TABLE))
        new_array_oid = AssignTypeArrayOid();

Admittedly, "!IsUnderPostmaster" is not exactly the same thing as "running
during initdb", but I do not consider this a bug.  You generally should
not be using single-user mode for anything except disaster recovery.

			regards, tom lane





view thread (14+ messages)  latest in thread

Message-ID: <32412.1586789476@sss.pgh.pa.us>
Permalink:  ../32412.1586789476@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/32412.1586789476@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, wjzeng2012@gmail.com, tushar.ahuja@enterprisedb.com
  Subject: Re: [bug] Table not have typarray when created by single user mode
  In-Reply-To: <32412.1586789476@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