Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jO0Qk-00082E-N7 for pgsql-bugs@arkaria.postgresql.org; Mon, 13 Apr 2020 14:51:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jO0Qj-0005IL-7s for pgsql-bugs@arkaria.postgresql.org; Mon, 13 Apr 2020 14:51:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jO0Qj-0005HA-22 for pgsql-bugs@lists.postgresql.org; Mon, 13 Apr 2020 14:51:21 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jO0Qh-0005Rh-7F for pgsql-bugs@lists.postgresql.org; Mon, 13 Apr 2020 14:51:20 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 03DEpGJ4032413; Mon, 13 Apr 2020 10:51:16 -0400 From: Tom Lane To: wenjing cc: pgsql-bugs@lists.postgresql.org, tushar Subject: Re: [bug] Table not have typarray when created by single user mode In-reply-to: <761F1389-C6A8-4C15-80CE-950C961F5341@gmail.com> References: <761F1389-C6A8-4C15-80CE-950C961F5341@gmail.com> Comments: In-reply-to wenjing message dated "Mon, 13 Apr 2020 16:25:02 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <32411.1586789476.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 13 Apr 2020 10:51:16 -0400 Message-ID: <32412.1586789476@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk wenjing writes: > Use single user mode (t_create_by_standalone) typarray =3D 0, but use ps= ql 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 a= s * such is an implementation detail: toast tables, sequences and index= es. */ if (IsUnderPostmaster && (relkind =3D=3D RELKIND_RELATION || relkind =3D=3D RELKIND_VIEW || relkind =3D=3D RELKIND_MATVIEW || relkind =3D=3D RELKIND_FOREIGN_TABLE || relkind =3D=3D RELKIND_COMPOSITE_TYPE || relkind =3D=3D RELKIND_PARTITIONED_TABLE)) new_array_oid =3D 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