Re: Fix pg_stat_reset_single_table_counters function

2023-08-20 Thread Masahiro Ikeda
On 2023-08-21 13:34, Michael Paquier wrote: On Mon, Aug 21, 2023 at 11:33:28AM +0900, Kyotaro Horiguchi wrote: I'm not sure about others, but I would avoid using the name "current_database" for the variable. Agreed. Looking at the surroundings, we have for example "datname" in the collation

Re: Fix pg_stat_reset_single_table_counters function

2023-08-20 Thread Michael Paquier
On Mon, Aug 21, 2023 at 11:33:28AM +0900, Kyotaro Horiguchi wrote: > I'm not sure about others, but I would avoid using the name > "current_database" for the variable. Agreed. Looking at the surroundings, we have for example "datname" in the collation tests so I have just used that, and applied

Re: Fix pg_stat_reset_single_table_counters function

2023-08-20 Thread Masahiro Ikeda
On 2023-08-21 11:33, Kyotaro Horiguchi wrote: On 2023/08/15 14:13, Masahiro Ikeda wrote: On 2023-08-15 11:48, Masahiko Sawada wrote: +COMMENT ON DATABASE :current_database IS 'This is a test comment'; -- insert or update in 'pg_shdescription' I think the current_database should be quoted (see

Re: Make --help output fit within 80 columns per line

2023-08-20 Thread Masahiro Ikeda
On 2023-07-05 10:47, torikoshia wrote: Hi, As discussed in [1], outputs of --help for some commands fits into 80 columns per line, while others do not. Since it seems preferable to have consistent line break policy and some people use 80-column terminal, wouldn't it be better to make all

Support run-time partition pruning for hash join

2023-08-20 Thread Richard Guo
If we have a hash join with an Append node on the outer side, something like Hash Join Hash Cond: (pt.a = t.a) -> Append -> Seq Scan on pt_p1 pt_1 -> Seq Scan on pt_p2 pt_2 -> Seq Scan on pt_p3 pt_3 -> Hash -> Seq Scan on t We can actually

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-08-20 Thread Amit Kapila
On Sun, Aug 20, 2023 at 6:49 PM Masahiko Sawada wrote: > > On Thu, Aug 17, 2023 at 10:31 PM Amit Kapila wrote: > > > > > > > > Sorry I was not clear. I meant the logical replication slots that are > > > *not* used by logical replication, i.e., are created manually and used > > > by third party

Re: Extract numeric filed in JSONB more effectively

2023-08-20 Thread Chapman Flack
On 2023-08-20 21:31, Andy Fan wrote: Highlighting the user case of makeRelableType is interesting! But using the Oid directly looks more promising for this question IMO, it looks like: "you said we can put anything in this arg, so I put an OID const here", seems nothing is wrong. Perhaps

Re: Fix pg_stat_reset_single_table_counters function

2023-08-20 Thread Kyotaro Horiguchi
Apologies. In the previous mail, I mistakenly addressed it to the wrong recipients. Reposted. On 2023/08/15 14:13, Masahiro Ikeda wrote: On 2023-08-15 11:48, Masahiko Sawada wrote: +COMMENT ON DATABASE :current_database IS 'This is a test comment'; -- insert or update in 'pg_shdescription' I

Re: Rethink the wait event names for postgres_fdw, dblink and etc

2023-08-20 Thread Masahiro Ikeda
Hi, Thanks for your comments. I updated the patch to v2. * Update a comment instead writing documentation about the wait events for pg_prewarm. * Make the name of wait events which are different code path different. Add DblinkGetConnect and PgPrewarmDumpShutdown. * Make variable names

Re: Extract numeric filed in JSONB more effectively

2023-08-20 Thread Andy Fan
On Sat, Aug 19, 2023 at 3:09 AM Chapman Flack wrote: > On 2023-08-18 14:50, Chapman Flack wrote: > > Now, my guess is EXPLAIN is complaining when it sees the Const > > of type internal, and doesn't know how to show that value. > > Perhaps makeRelabelType is the answer there, too: what if the > >

Re: PostgreSQL 16 RC1 + GA release dates

2023-08-20 Thread Jonathan S. Katz
On 8/20/23 10:50 AM, Tom Lane wrote: "Jonathan S. Katz" writes: The date for PostgreSQL 16 Release Candidate 1 (RC1) is August 31, 2023. Please ensure all open items[1] are completed and committed before August 26, 2023 12:00 UTC. FYI, I moved the "Oversight in reparameterize_path_by_child

Re: Adding a LogicalRepWorker type field

2023-08-20 Thread Peter Smith
On Fri, Aug 18, 2023 at 6:16 PM Zhijie Hou (Fujitsu) wrote: > > On Friday, August 18, 2023 11:20 AM Amit Kapila > wrote: > > > > On Mon, Aug 14, 2023 at 12:08 PM Peter Smith > > wrote: > > > > > > The main patch for adding the worker type enum has been pushed [1]. > > > > > > Here is the

Re: Logging of matching pg_hba.conf entry during auth skips trust auth, potential security issue

2023-08-20 Thread Michael Paquier
On Fri, Aug 18, 2023 at 08:49:16AM +0900, Michael Paquier wrote: > After sleeping on it, I think that I'd just agree with Robert's point > to just use the same language as the message, while also agreeing with > the patch to not set MyClientConnectionInfo.authn_id in the uaTrust > case, only

Re: POC, WIP: OR-clause support for indexes

2023-08-20 Thread Peter Geoghegan
On Thu, Aug 17, 2023 at 3:08 AM a.rybakina wrote: > But now I see an interesting transformation, which was the most interesting > for me. > > EXPLAIN (COSTS OFF) SELECT * FROM tenk1 WHERE thousand = 42 AND (tenthous = 1 > OR tenthous = 3 OR tenthous = 42); It would be even more interesting if

Re: POC, WIP: OR-clause support for indexes

2023-08-20 Thread Peter Geoghegan
On Sun, Aug 20, 2023 at 3:11 PM Peter Geoghegan wrote: > Back in 2003, commit 9888192f removed (or at least simplified) what > were then called "CNF/DNF CONVERSION ROUTINES". Prior to that point > the optimizer README had something about leaving clause lists > un-normalized leading to selectivity

Re: POC, WIP: OR-clause support for indexes

2023-08-20 Thread Peter Geoghegan
On Thu, Aug 17, 2023 at 3:08 AM a.rybakina wrote: > This is an interesting feature. I didn't notice this function before, I > studied many times consider_new_or_cause, which were called there. As far as > I know, there is a selectivity calculation going on there, but as far as I > remember, I

Re: UUID v7

2023-08-20 Thread Andrey M. Borodin
> On 30 Jul 2023, at 13:08, Andrey M. Borodin wrote: > > > After discussion on GitHub with Sergey Prokhorenko [0] I understood that > counter is optional, but useful part of UUID v7. It actually promotes > sortability of data generated at high speed. > The standard does not specify how big

datetime from a JsonbValue

2023-08-20 Thread Chapman Flack
Hi, Thread [1] concerns (generalizing slightly) the efficient casting to an SQL type of the result of a jsonb extracting operation (array indexing, object keying, path evaluation) that has ended with a scalar JsonbValue. So far, it can efficiently rewrite casts to boolean or numeric types. I

Re: Oversight in reparameterize_path_by_child leading to executor crash

2023-08-20 Thread Tom Lane
I looked over the v3 patch. I think it's going in generally the right direction, but there is a huge oversight: path_is_reparameterizable_by_child does not come close to modeling the success/failure conditions of reparameterize_path_by_child. In all the cases where reparameterize_path_by_child

Re: [PATCH] Add function to_oct

2023-08-20 Thread Nathan Bossart
On Sat, Aug 19, 2023 at 08:35:46AM +0100, Dean Rasheed wrote: > I note that there are no tests for negative inputs. I added some in v8. > Doing a quick test, shows that this changes the current behaviour, > because all inputs are now treated as 64-bit: > > HEAD: > > select

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-08-20 Thread Masahiko Sawada
On Fri, Aug 18, 2023 at 10:51 PM Hayato Kuroda (Fujitsu) wrote: > > Dear Peter, > > PSA new version patch set. > I've looked at the v22 patch set, and here are some comments: 0001: Do we need regression tests to make sure that the slot's confirmed_flush_lsn matches the LSN of the latest

Re: [PATCH] Add function to_oct

2023-08-20 Thread Nathan Bossart
On Sat, Aug 19, 2023 at 11:41:56AM +0700, John Naylor wrote: > This looks nicer, but still doesn't save the starting pointer, and so needs > to lug around that big honking macro. This is what I mean: > > static inline text * > convert_to_base(uint64 value, int base) > { > const char *digits =

Re: PostgreSQL 16 RC1 + GA release dates

2023-08-20 Thread Tom Lane
"Jonathan S. Katz" writes: > The date for PostgreSQL 16 Release Candidate 1 (RC1) is August 31, 2023. > Please ensure all open items[1] are completed and committed before > August 26, 2023 12:00 UTC. FYI, I moved the "Oversight in reparameterize_path_by_child leading to executor crash" open

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-08-20 Thread Masahiko Sawada
On Thu, Aug 17, 2023 at 10:31 PM Amit Kapila wrote: > > On Thu, Aug 17, 2023 at 6:07 PM Masahiko Sawada wrote: > > > > On Tue, Aug 15, 2023 at 12:06 PM Amit Kapila > > wrote: > > > > > > On Tue, Aug 15, 2023 at 7:51 AM Masahiko Sawada > > > wrote: > > > > > > > > On Mon, Aug 14, 2023 at 2:07 

Re: WIP: new system catalog pg_wait_event

2023-08-20 Thread Michael Paquier
On Sat, Aug 19, 2023 at 06:30:12PM +0200, Drouvot, Bertrand wrote: > Thanks, fixed in v10. Okay. I have done an extra review of it, simplifying a few things in the function, the comments and the formatting, and applied the patch. Thanks! I have somewhat managed to miss the catalog version in