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 1tMshq-0078x3-Uf for pgsql-general@arkaria.postgresql.org; Sun, 15 Dec 2024 17:47:03 +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 1tMsho-00FfDe-8I for pgsql-general@arkaria.postgresql.org; Sun, 15 Dec 2024 17:47:01 +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 1tMshn-00FfDW-Tb for pgsql-general@lists.postgresql.org; Sun, 15 Dec 2024 17:47:01 +0000 Received: from mail-oa1-x2a.google.com ([2001:4860:4864:20::2a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tMshi-002yyw-Rn for pgsql-general@postgresql.org; Sun, 15 Dec 2024 17:46:59 +0000 Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-29e5aedbebdso1615755fac.0 for ; Sun, 15 Dec 2024 09:46:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734284814; x=1734889614; darn=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=ZN7lRpRU71kgQjuc20hAMsMzl86mUkROyVvE1+dQHMo=; b=UnAqKz6mN/wPFJz49eB0GxcAuF3DvbEoqrpmWOsLqqRDGInrLA0qFSP57fy0JN7A7b Z9DvQ4G87iBcDmvUcIVF/HgeKy0MrXzB1XLM1lnoRAwpiC9/pLhshxCMaTG0oIFX8TSU rF943tO7t2f0TGgJIq6Ci3DjwvU1wWUWaz84VEtyyX6AufR+YJuSGLapt2bCBduxvFUl auQL0Sr5JdX44Dp0S826GZXhMjzIQzmx3YA/mXO6q/oS0QkJnIuP0HistVWqV4nC9AC+ aIqmaBbRj2Kk/QpETM0vnbiaRdFGEBknir9HIIjnUVhQk/oaVU3f7UkoZ9opNnTXwh/E NqWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734284814; x=1734889614; 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=ZN7lRpRU71kgQjuc20hAMsMzl86mUkROyVvE1+dQHMo=; b=xREjtNIJv26FVr7JuxCHzShgR6jJGsr/bZCDn60zMk0occj5Yu+VtN14hCwOUBd5j2 RJ+twpB0XLtw5IZeH1Qq9ENHTB8mXGtqFbWU+oYJWqWA8CQLcZCaYrpakG3UXldOZNPr /dFhQLCabh4cpltTwJjIdrbGLIw8KjUQrK/4lystb8Mc2vV+8VD0n7w3Sq0rrRWo6jRX 6pTylMxTW50+RKNxcIPO/eTC+loJlj+koSx7RBfoYUglTeZsahWFGYh1POG6EUp3XmXD 3RGe5UPNyvYdLRzkrZTib7vLjqT+Rip5ncyrshIDPHcufCysGUozjLi6U+KaRCXzAKfa sDnA== X-Gm-Message-State: AOJu0YwPLXAGk+KVOY+tYUMEirtfwe4IMPsrJ4ZlE6g5x5IM1ChhKti6 8OaiC4/RWNt536d22ACfemXf0VpAPYSfgRmbUEwnorxIJRUp6Db1HJlJ2+jmWatb7BuglwKry6W gWVdUL5yMtIGOUo0NMiC6eZhYfw3M2yMR X-Gm-Gg: ASbGncs3jzQCyPSl5mG7G9PXsEfMkgXRBfgrL18g6JhifsJARToFAn7Pfe9AbA1qQ4W VmDCPXToEJKVIUUzd13SyzUGpJ2yPkIZ4D5g2BNSodGpnxTrdC9b+ya1PHBHtro3yrCcxZavP X-Google-Smtp-Source: AGHT+IEi8nfFI7DG0SyWZf+eFESGhFjxZ/Mwq+S7wg0odTa3d8YgMFW55iDqJCvbOay7J8z/jWknk1OAfdE+xPOB2FE= X-Received: by 2002:a05:6870:9721:b0:29e:24c7:2861 with SMTP id 586e51a60fabf-2a3ac5bc344mr5203081fac.13.1734284813724; Sun, 15 Dec 2024 09:46:53 -0800 (PST) MIME-Version: 1.0 References: <1627466.1734283766@sss.pgh.pa.us> In-Reply-To: <1627466.1734283766@sss.pgh.pa.us> From: Ron Johnson Date: Sun, 15 Dec 2024 12:46:42 -0500 Message-ID: Subject: Re: Request for new column in pg_namespace To: pgsql-general Content-Type: multipart/alternative; boundary="00000000000042f54c062952a60c" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000042f54c062952a60c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Dec 15, 2024 at 12:29=E2=80=AFPM Tom Lane wrote= : > Pavel Stehule writes: > > ne 15. 12. 2024 v 17:59 odes=C3=ADlatel Ron Johnson > > napsal: > >> A new boolean column named "indissystem" that's true only for system > >> relations would make *many* maintenance queries cleaner, since they'd > >> look like: > >> select ... > > > oid of all system objects is less then 0x4000 > > That wouldn't help for excluding temp schemas, and it's not totally > trustworthy for information_schema either. > > But I think the real problem with Ron's proposal is that it presumes > there is a one-size-fits-all notion of "system schema". As a > counterexample, for some maintenance activities (such as vacuuming) > you might wish to process pg_catalog. > In that case, one would explicitly mention pg_catalog, no? where cl.relnamespace =3D nsp.oid and (nsp.indissystem =3D false or nsp.nspname =3D 'pg_catalog'); > What I'd suggest as an improvement that could be implemented > immediately is to wrap the checks in a user-defined function > like "is_system_schema(nspname name)". > Good idea. --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --00000000000042f54c062952a60c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sun, Dec 15, 2024 at 12:29=E2=80=AFPM = Tom Lane <tgl@sss.pgh.pa.us>= wrote:
Pavel Stehule <pavel.stehule@gmail.com> wr= ites:
> ne 15. 12. 2024 v 17:59 odes=C3=ADlatel Ron Johnson <ronljohnsonjr@gmail.com&= gt;
> napsal:
>> A new boolean column named "indissystem" that's true= only for system
>> relations would make *many* maintenance queries cleaner, since the= y'd
>> look like:
>> select ...

> oid of all system objects is less then 0x4000

That wouldn't help for excluding temp schemas, and it's not totally=
trustworthy for information_schema either.

But I think the real problem with Ron's proposal is that it presumes there is a one-size-fits-all notion of "system schema".=C2=A0 As = a
counterexample, for some maintenance activities (such as vacuuming)
you might wish to process pg_catalog.

I= n that case, one would explicitly mention pg_catalog, no?
where cl.relnamespace =3D nsp.oid
=C2= =A0 and (nsp.indissystem =3D false or=C2=A0nsp.nspname =3D &= #39;pg_catalog');
=C2=A0
What I'd suggest as an improvement that could= be implemented
immediately is to wrap the checks in a user-defined function
like "is_system_schema(nspname name)".

<= /div>
Good idea.

--
Death to <Redacted>, and butter sauce.
Don't boil m= e, I'm still alive.
<Redacted> lobster!
<= /div>
--00000000000042f54c062952a60c--