Re: Request for new column in pg_namespace

2024-12-15 Thread Ron Johnson
On Sun, Dec 15, 2024 at 2:20 PM Tom Lane wrote: > Isaac Morland writes: > > On Sun, 15 Dec 2024 at 12:29, Tom Lane wrote: > >> 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)

Re: Request for new column in pg_namespace

2024-12-15 Thread Isaac Morland
On Sun, 15 Dec 2024 at 14:20, Tom Lane wrote: > Isaac Morland writes: > > On Sun, 15 Dec 2024 at 12:29, Tom Lane wrote: > >> 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)".

Re: Request for new column in pg_namespace

2024-12-15 Thread Tom Lane
Isaac Morland writes: > On Sun, 15 Dec 2024 at 12:29, Tom Lane wrote: >> 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)". > Would it make sense to make the parameter be of type r

Re: Request for new column in pg_namespace

2024-12-15 Thread Ron Johnson
On Sun, Dec 15, 2024 at 12:29 PM Tom Lane wrote: > Pavel Stehule writes: > > ne 15. 12. 2024 v 17:59 odesílatel 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

Continue Logical Replication After Master Became Slave and then Became Master Again

2024-12-15 Thread Avi Weinberg
Hi All, Postgres 15.2 We have Patroni cluster with one master and two replicas. The master is publisher (logical replication) to some subscriptions running on other clusters. When we have a failover, the master becomes replica and one of the replicas assume the role of master. In such a cas

Re: Request for new column in pg_namespace

2024-12-15 Thread Isaac Morland
On Sun, 15 Dec 2024 at 12:29, Tom Lane wrote: > 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)". > Would it make sense to make the parameter be of type regnamespace?

Re: Request for new column in pg_namespace

2024-12-15 Thread Tom Lane
Pavel Stehule writes: > ne 15. 12. 2024 v 17:59 odesílatel 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 0

Re: Request for new column in pg_namespace

2024-12-15 Thread Pavel Stehule
Hi ne 15. 12. 2024 v 17:59 odesílatel 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 = nsp.oid >

Request for new column in pg_namespace

2024-12-15 Thread Ron Johnson
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 = nsp.oid and nsp.nspname not like 'pg_% and nsp.nspname != 'information_schema';