Re: Request for new column in pg_namespace

From: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Request for new column in pg_namespace
Date: 2024-12-15 17:46:42
Message-ID: CANzqJaBZc8odgkF_Gn6kgp7gaU2dMiGhS34oTk=+7S28CEHeig@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Dec 15, 2024 at 12:29 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> > ne 15. 12. 2024 v 17:59 odesílatel Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
> > 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 = nsp.oid
and (nsp.indissystem = false or nsp.nspname = '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.

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2024-12-15 19:20:23 Re: Request for new column in pg_namespace
Previous Message Avi Weinberg 2024-12-15 17:41:05 Continue Logical Replication After Master Became Slave and then Became Master Again