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 1tMsFP-0076LL-FS for pgsql-general@arkaria.postgresql.org; Sun, 15 Dec 2024 17:17:39 +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 1tMsEO-00FE8n-NF for pgsql-general@arkaria.postgresql.org; Sun, 15 Dec 2024 17:16:37 +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 1tMsEO-00FE8f-CE for pgsql-general@lists.postgresql.org; Sun, 15 Dec 2024 17:16:37 +0000 Received: from mail-yb1-xb34.google.com ([2607:f8b0:4864:20::b34]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tMsEM-002yks-Pj for pgsql-general@postgresql.org; Sun, 15 Dec 2024 17:16:36 +0000 Received: by mail-yb1-xb34.google.com with SMTP id 3f1490d57ef6-e4930eca0d4so579130276.3 for ; Sun, 15 Dec 2024 09:16:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734282994; x=1734887794; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=tsY9iEwAG4Lrjy405/0Yaez/z2Vqi7c48sdNaQgzyBI=; b=ei8b7wRPchhhuXDROm8elZAKL2kSGBPv1mLeKURbwPeg3OCFd218QJ9rL9Ugu1E17V EFFM342KUABAblE7A8IH0cblO/mcQyQssa5q1bnfl6HIMC4dZE8EdFfLpnLnsgiRkhu6 Xf4rWzFMfKLYFsJCXBf0L/sBZNjD1VbAN44TNcrN/rN2YwB3ndXEUBULv0X/WLOHzvbt 6dsVOwbbQjPTGfrHn+iNY42zNTiUUf8ui4SPC1etAX5f+eJCem6nFFOhe8x13hCSYszO ihvop/cet8ifI3OBGaaJ2+hciEvXwU+sgTE7uEYrJPbZCgAthoRQ53thGobEUi61yng9 iWNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734282994; x=1734887794; h=cc: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=tsY9iEwAG4Lrjy405/0Yaez/z2Vqi7c48sdNaQgzyBI=; b=T/VOURXavYkZyEk7sVKZaMaLmx4fk5dqMGkAIqtBCWAUFGrjC0b67CzBazAjUMSeG7 J/v7WkzSSN2XmUdyb4CCCTkOJ1o3wDdiSkK3kLxvZtpcycunc6Csp92N/OlH1Vf/D0Os rpzDsdxP/DsOnCaCNDH3RwWGcLhnKwpMuSYBtlhXhqBEVHOGgB5gve7bUCfs3WuKwfFK Elbs0hR+LEi/mkF+zsavg4AbtaBgIQUNLjhQTzea9EedKRQqopAV9UBJ7WyTX3/ueG07 +DnD7Yc1pDNkQkDgT876q2bibkaxTb2Hoz4eM9rm7fDSz3ubOpSwcj7fikjGX9VpOezy ZtsQ== X-Gm-Message-State: AOJu0YyJbqc3FzitlTsEN/daIoDYruOutLeCTKrpsNdkeZnqsKBabpFx g0nnfHRaAT8UGxW8poVa7nDHIBpGM1whcW26mG/ge3utg48rtL0lOeo+G/3q9xdvH10nd2zaULL XEKwbQv8sNssIhrUZiRGz9F2DJYI= X-Gm-Gg: ASbGncsbretNkA/UmJUPSYRdUZSqi1Lh4BJePznrJePoRLAFwoqEYRBPyw1GsQwXrlo 8JLZMDg0lWahlJY00oEpBR3bulS+/0LTAvcsv89PC9l4An5iVybeTzRcivWkxKfRQnMIfSaE= X-Google-Smtp-Source: AGHT+IHrmEWXJ5Y8cK6BMGeCIMUlbUisqTzR+zWQGm+EzGiMcT9pm65+h8jhk2OkJN/4u/n3I/Evp8IUegBPA16SK/Y= X-Received: by 2002:a05:6902:15c3:b0:e4c:9a13:180c with SMTP id 3f1490d57ef6-e4c9a131a80mr1294803276.46.1734282993743; Sun, 15 Dec 2024 09:16:33 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Pavel Stehule Date: Sun, 15 Dec 2024 18:15:57 +0100 Message-ID: Subject: Re: Request for new column in pg_namespace To: Ron Johnson Cc: pgsql-general Content-Type: multipart/alternative; boundary="000000000000c83dc8062952390f" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000c83dc8062952390f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi ne 15. 12. 2024 v 17:59 odes=C3=ADlatel Ron Johnson napsal: > https://www.postgresql.org/docs/current/catalog-pg-namespace.html > > Currently, when I want to query all "userland" tables, I write something > like: > select ... > from pg_class cl, pg_namespace nsp > where cl.relnamespace =3D nsp.oid > and nsp.nspname not like 'pg_% > and nsp.nspname !=3D 'information_schema'; > > 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 ... > from pg_class cl, pg_namespace nsp > where cl.relnamespace =3D nsp.oid > and nsp.indissystem =3D false; > > oid of all system objects is less then 0x4000 Regards Pavel > -- > Death to , and butter sauce. > Don't boil me, I'm still alive. > lobster! > --000000000000c83dc8062952390f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

ne 15. 12. 2024 v=C2=A017= :59 odes=C3=ADlatel Ron Johnson <ronljohnsonjr@gmail.com> napsal:
Currently, when I want to query all "userland" ta= bles, I write something like:
select ...=
from pg_class cl, pg_namespace nsp
where cl.relnamespace =3D nsp.oid=
=C2=A0 and nsp.nspname not like 'pg_%
=C2=A0 and=C2=A0nsp.nspname=C2=A0!=3D=C2=A0'information_schema';

= A new boolean column named "indissystem" that's true only for= system relations would make many=C2=A0maintenance queries cleaner, = since they'd look like:
select = ...
from pg_class cl, pg_namespace nsp
where cl.relnamespace =3D nsp.= oid
=C2=A0 and nsp.indissystem =3D false;


oid of all system objects is less= then 0x4000

Regards

Pave= l

=C2=A0
--
Death to <Redacted>, and butter sauce.
Don't boil me= , I'm still alive.
<Redacted> lobster!
--000000000000c83dc8062952390f--