Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1swK2W-0037mv-Nx for pgsql-general@arkaria.postgresql.org; Thu, 03 Oct 2024 11:30:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1swK2U-00DvXX-PD for pgsql-general@arkaria.postgresql.org; Thu, 03 Oct 2024 11:30:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1swK2U-00DvXP-EB for pgsql-general@lists.postgresql.org; Thu, 03 Oct 2024 11:30:34 +0000 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1swK2R-002He6-Qv for pgsql-general@lists.postgresql.org; Thu, 03 Oct 2024 11:30:33 +0000 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2fac787f39fso9693921fa.2 for ; Thu, 03 Oct 2024 04:30:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727955030; x=1728559830; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=aYXzsvpou5m0KU81cJx5MFHojErxbWqOxpeET01kBgE=; b=Ub+YE0WNsaAu3Ie0l4+ThlfAndZG+QGpI25Z4bTZ4ZE7N8GSJWpxiRDh4TshEkbt/G u1rv0Akhd0ZP5/hPiTQ43xFp/X2SbnkN2hKBFyfBhpleUlCTHmQeL7nTctUzh8FLqEyP aPiKb5oCC3JSlGFkKOFhDoBmh1IlCgZLQez1YGUslw9NiNJspKJotAoYiBnMqfujbCWE UTpvmGhYAQZsK82CMxml+vkR60trADEEkpy/MzIBaAS9DMw4G4AkXHUjgInrsdSxUydy 9696CteVGxKrbhOqOpIg+SVlaxvfrX4xbf8VcCd2CA8ZMuit55oCRXBnfltoOHl8ZvhC hd7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727955030; x=1728559830; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aYXzsvpou5m0KU81cJx5MFHojErxbWqOxpeET01kBgE=; b=tupAc6wuT1SuyDARCLYIamG7B6sKEgtiqcwTNlVSiXHE7vlT8KHxv6g+AeQmX4PyDc JePAP5fvKIQaz6m8BaLsrAiVExNMagaHc8UlL348NLdbSbiueFsIiCtT2rfq1vPZXY1i +0l+ajYG09h9Kn9hR8NqTOYOXq8BA1BCfc9IOQyk1FGq/YnTx8knp//qD2OXKuVamAr4 K8WwKPS7Kr578VrlmiHXTtiUlaicTs2tllmXjSM6rGlB6s9GX63bFNNsSWHF8zWqaXVd NG/yIbKKkTOEszjceP4W4UN3aCWX35W/YTW64T2vxnICbt44erRO9s9uipo/gfgG05JV Fttg== X-Gm-Message-State: AOJu0YxJ6PA+qIL3NNRRYeiLLwhGwsCwfesYDjObALhkC60ud27CEE+c aerZU9Ilsf7rI3S9LgFWyexdW7zgkC2XAe/BS4RGSqm7Pen8UI1dpdfY+HkMydPqL/FBSQ3dyEk XBLj4Kz0+9jnRok6Qh69FDyCshO0JbOWC X-Google-Smtp-Source: AGHT+IEFURhHTn/1eup6UoPGdi13Iw1C5h5WJklaiKct9/r9/jgwn2vq2YJMwTDuCp6Ri9FMl7WWrCootakBH0g1PAQ= X-Received: by 2002:a05:6512:114b:b0:539:920a:f886 with SMTP id 2adb3069b0e04-539a07a881emr3604124e87.50.1727955029419; Thu, 03 Oct 2024 04:30:29 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?B?Vmluw61jaXVzIEFicmFow6Nv?= Date: Thu, 3 Oct 2024 12:29:50 +0100 Message-ID: Subject: Re: Userland copy of pg_statistic - is there a solution? To: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000b770da062390e100" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000b770da062390e100 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Sep 30, 2024 at 8:31=E2=80=AFAM Vin=C3=ADcius Abrah=C3=A3o wrote: > > Morning, > > postgres=3D# create table backup_pg_statistic as select * from pg_statist= ic; > 2024-09-30 08:25:56 BST [7400]: > user=3Dvinnix,db=3Dpostgres,app=3Dpsql,client=3D[local] ERROR: column "s= tavalues1" > has pseudo-type anyarray > 2024-09-30 08:25:56 BST [7400]: > user=3Dvinnix,db=3Dpostgres,app=3Dpsql,client=3D[local] STATEMENT: creat= e table > backup_pg_statistic as select * from pg_statistic; > ERROR: column "stavalues1" has pseudo-type anyarray > Time: 9.544 ms > postgres=3D# create table test_array(a anyarray); > 2024-09-30 08:26:40 BST [7400]: > user=3Dvinnix,db=3Dpostgres,app=3Dpsql,client=3D[local] ERROR: column "a= " has > pseudo-type anyarray > 2024-09-30 08:26:40 BST [7400]: > user=3Dvinnix,db=3Dpostgres,app=3Dpsql,client=3D[local] STATEMENT: creat= e table > test_array(a anyarray); > ERROR: column "a" has pseudo-type anyarray > Time: 9.137 ms > Is there a solution for this simple problem? > > Cheers, > Vin=C3=ADcius > Following up my own question - I could overcome this limitation observing the parameter allow_system_table_mods postgres=3D# set allow_system_table_mods to on; SET Time: 5.190 ms postgres=3D# create table a(a anyarray) ; CREATE TABLE Time: 132.959 ms This is verified at heap_create_with_catalog(...). PostgreSQL code https://github.com/postgres/postgres/blob/master/src/backend/catalog/heap.c= #L1151 If someone needs a patch let me know to make it work for other users. We can work on this together. -- vinnix aka: Vin=C3=ADcius Abrah=C3=A3o Bazana Schmidt twitter.com/vischmidt --000000000000b770da062390e100 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Sep 30, 2024 at 8:31=E2=80=AFAM V= in=C3=ADcius Abrah=C3=A3o <vinni= x.bsd@gmail.com> wrote:

Morning,

postgres=3D# create table backup_pg_stat= istic as select * from pg_statistic;
2024-09-30 08:25:56 BST [7400]: use= r=3Dvinnix,db=3Dpostgres,app=3Dpsql,client=3D[local] ERROR: =C2=A0column &q= uot;stavalues1" has pseudo-type anyarray
2024-09-30 08:25:56 BST [7= 400]: user=3Dvinnix,db=3Dpostgres,app=3Dpsql,client=3D[local] STATEMENT: = =C2=A0create table backup_pg_statistic as select * from pg_statistic;
ER= ROR: =C2=A0column "stavalues1" has pseudo-type anyarray
Time: = 9.544 ms
postgres=3D# create table test_array(a anyarray);
2024-09-30= 08:26:40 BST [7400]: user=3Dvinnix,db=3Dpostgres,app=3Dpsql,client=3D[loca= l] ERROR: =C2=A0column "a" has pseudo-type anyarray
2024-09-30= 08:26:40 BST [7400]: user=3Dvinnix,db=3Dpostgres,app=3Dpsql,client=3D[loca= l] STATEMENT: =C2=A0create table test_array(a anyarray);
ERROR: =C2=A0co= lumn "a" has pseudo-type anyarray
Time: 9.137 ms

Is there a solution for this simple problem?

Cheers,
Vin=C3=ADcius

Following up my own question - I = could overcome this limitation observing the parameter allow_system_table_mods

postgres=3D# set allow_system_ta= ble_mods to on;
SET
Time: 5.190 ms
postgres=3D# create table a(a a= nyarray) ;
CREATE TABLE
Time: 132.959 ms

This is verified at heap_create_with_catalog(...). PostgreSQL code https://github.com/postgres/postgres/blob/master/src/backend/catalog= /heap.c#L1151

If someone needs a patch let me know to make it w= ork for other users. We can work on this together.
=C2=A0
--
vinnix
aka: Vin=C3=ADcius Abrah=C3=A3o Bazana Schmidt
= twitter.com/visc= hmidt
--000000000000b770da062390e100--