Re: remaining sql/json patches

2023-07-23 Thread jian he
hi based on v10*.patch. questions/ideas about the doc. > json_exists ( context_item, path_expression [ PASSING { value AS varname } [, > ...]] [ RETURNING data_type ] [ { TRUE | FALSE | UNKNOWN | ERROR } ON ERROR ]) > Returns true if the SQL/JSON path_expression applied to the context_item > usi

Re: PG 16 draft release notes ready

2023-07-23 Thread Pavel Luzanov
Please consider to add item to the psql section: Add psql \drg command to display role grants and remove the "Member of" column from \du & \dg altogether (d65ddaca) -- Pavel Luzanov Postgres Professional: https://postgrespro.com

Re: PG 16 draft release notes ready

2023-07-23 Thread Michael Paquier
On Tue, Jul 04, 2023 at 05:32:07PM -0400, Bruce Momjian wrote: > On Tue, Jul 4, 2023 at 03:31:05PM +0900, Michael Paquier wrote: >> On Thu, May 18, 2023 at 04:49:47PM -0400, Bruce Momjian wrote: >> Sawada-san has mentioned on twitter that fdd8937 is not mentioned in >> the release notes, and it se

Re: Use COPY for populating all pgbench tables

2023-07-23 Thread Michael Paquier
On Fri, Jul 21, 2023 at 12:22:06PM -0500, Tristan Partin wrote: > v7 looks good from my perspective. Thanks for working through this patch > with me. Much appreciated. Cool. I have applied the new tests for now to move on with this thread. -- Michael signature.asc Description: PGP signature

Re: Use of additional index columns in rows filtering

2023-07-23 Thread Tomas Vondra
On 7/21/23 21:17, Peter Geoghegan wrote: > ... >> But I was >> thinking more about the costing part - if you convert the clauses in >> some way, does that affect the reliability of estimates somehow? > > Obviously, it doesn't affect the selectivity at all. That seems most > important (you kinda

Re: Making Vars outer-join aware

2023-07-23 Thread Anton A. Melnikov
On 08.06.2023 19:58, Tom Lane wrote: I think the right thing here is not either of your patches, but to tweak adjust_relid_set() to not fail on negative oldrelid. I'll go make it so. Thanks! This fully solves the problem with ChangeVarNodes() that i wrote above. Hmm. That implies that you'r

Re: There should be a way to use the force flag when restoring databases

2023-07-23 Thread Ahmed Ibrahim
Hi everyone, I have been working on this. This is a proposed patch for it so we have a force option for DROPping the database. I'd appreciate it if anyone can review. On Thu, Jul 20, 2023 at 9:36 PM Gurjeet Singh wrote: > On Thu, Jul 20, 2023 at 2:10 AM Daniel Gustafsson wrote: > > > > > On

multiple membership grants and information_schema.applicable_roles

2023-07-23 Thread Pavel Luzanov
I found that multiple membership grants added in v16 affects the information_schema.applicable_roles view. Examples on a master, but they works for v16 too. Setup multiple membership alice in bob: postgres@postgres(17.0)=# \drg alice    List of role grants  Role name | Member of | 

Re: Use of additional index columns in rows filtering

2023-07-23 Thread Peter Geoghegan
On Sun, Jul 23, 2023 at 5:04 AM Tomas Vondra wrote: > Sorry, I think I meant 'cost estimates', not the selectivity estimates. > If you convert the original "simple" clauses into the more complex list, > presumably we'd cost that differently, right? I may be entirely wrong, > but my intuition is th

Re: multiple membership grants and information_schema.applicable_roles

2023-07-23 Thread Tom Lane
Pavel Luzanov writes: > The application_roles view shows duplicates: > postgres@postgres(17.0)=# SELECT * FROM > information_schema.applicable_roles WHERE grantee = 'alice'; >  grantee | role_name | is_grantable > -+---+-- >  alice   | bob   | NO >  alice   | b

[BUG] Crash on pgbench initialization.

2023-07-23 Thread Anton A. Melnikov
Hello! My colleague Victoria Shepard reported that pgbench might crash during initialization with some values of shared_buffers and max_worker_processes in conf. After some research, found this happens when the LimitAdditionalPins() returns exactly zero. In the current master, this will happen

Re: Row pattern recognition

2023-07-23 Thread Vik Fearing
On 7/22/23 08:14, Tatsuo Ishii wrote: On 7/22/23 03:11, Tatsuo Ishii wrote: Maybe. Suppose a window function executes row pattern matching using price > PREV(price). The window function already receives WindowStatePerFuncData. If we can pass the WindowStatePerFuncData to PREV, we could let PREV

Re: Row pattern recognition

2023-07-23 Thread Tatsuo Ishii
>>> What we are talking about here is *defining* a window >>> frame. >> Well, we are defining a "reduced" window frame within a (full) window >> frame. A "reduced" window frame is calculated each time when a window >> function is called. > > > Why? It should only be recalculated when the current

Re: Support worker_spi to execute the function dynamically.

2023-07-23 Thread Masahiro Ikeda
On 2023-07-22 01:05, Bharath Rupireddy wrote: On Fri, Jul 21, 2023 at 4:05 PM Masahiro Ikeda wrote: (2) Do we need "worker_spi.total_workers = 0" and "shared_preload_libraries = worker_spi" in dynamic.conf. Currently, the static bg workers will not be launched because "shared_preload_librarie

Re: doc: improve the restriction description of using indexes on REPLICA IDENTITY FULL table.

2023-07-23 Thread Masahiko Sawada
On Sat, Jul 22, 2023 at 7:32 PM Amit Kapila wrote: > > On Fri, Jul 21, 2023 at 6:55 AM Masahiko Sawada wrote: > > > > I've attached the updated patch. I'll push it early next week, barring > > any objections. > > > > You have moved most of the comments related to the restriction of > which index

Re: pg16b2: REINDEX segv on null pointer in RemoveFromWaitQueue

2023-07-23 Thread Masahiko Sawada
On Wed, Jul 12, 2023 at 8:52 PM Justin Pryzby wrote: > > On Mon, Jul 10, 2023 at 09:01:37PM -0500, Justin Pryzby wrote: > > An instance compiled locally, without assertions, failed like this: > > > ... > > > > => REINDEX was running, with parallel workers, but deadlocked with > > ANALYZE, and then

Re: POC: GROUP BY optimization

2023-07-23 Thread Andrey Lepikhov
On 20/7/2023 18:46, Tomas Vondra wrote: On 7/20/23 08:37, Andrey Lepikhov wrote: On 3/10/2022 21:56, Tom Lane wrote: Revert "Optimize order of GROUP BY keys". This reverts commit db0d67db2401eb6238ccc04c6407a4fd4f985832 and several follow-on fixes. ... Since we're hard up against the release d

Re: Synchronizing slots from primary to standby

2023-07-23 Thread Bharath Rupireddy
On Fri, Jul 21, 2023 at 5:16 PM shveta malik wrote: > > Thanks Bharat for letting us know. It is okay to split the patch, it > may definitely help to understand the modules better but shall we take > a step back and try to reevaluate the design first before moving to > other tasks? Agree that des

Re: postgres_fdw: wrong results with self join + enable_nestloop off

2023-07-23 Thread Richard Guo
On Fri, Jul 21, 2023 at 8:51 PM Etsuro Fujita wrote: > I think we should choose the latter, so I modified your patch as > mentioned, after re-creating it on top of my patch. Attached is a new > version (0002-Allow-join-pushdown-even-if-pseudoconstant-quals-v2.patch). > I am attaching my patch as

Re: pgsql: Allow tailoring of ICU locales with custom rules

2023-07-23 Thread Amit Kapila
On Fri, Mar 10, 2023 at 3:24 PM Peter Eisentraut wrote: > > On 08.03.23 21:57, Jeff Davis wrote: > > > * It appears rules IS NULL behaves differently from rules=''. Is that > > desired? For instance: > >create collation c1(provider=icu, > > locale='und-u-ka-shifted-ks-level1', > > de

Re: Assert failure on bms_equal(child_joinrel->relids, child_joinrelids)

2023-07-23 Thread Richard Guo
On Sat, Jul 22, 2023 at 12:02 AM Tom Lane wrote: > Richard Guo writes: > > Instead of fixing add_outer_joins_to_relids() to cope with child joins, > > I'm wondering if we can build join relids for a child join from its > > parent by adjust_child_relids, something like attached. > > That looks li

Re: Support worker_spi to execute the function dynamically.

2023-07-23 Thread Bharath Rupireddy
On Mon, Jul 24, 2023 at 6:34 AM Masahiro Ikeda wrote: > > OK. If so, we need to remove the following comment in Makefile. > > > # enable our module in shared_preload_libraries for dynamic bgworkers Done. > I also confirmed that the tap tests work with meson and make. Thanks for verifying. I al

Re: doc: improve the restriction description of using indexes on REPLICA IDENTITY FULL table.

2023-07-23 Thread Amit Kapila
On Mon, Jul 24, 2023 at 6:39 AM Masahiko Sawada wrote: > > On Sat, Jul 22, 2023 at 7:32 PM Amit Kapila wrote: > > > > > > You have moved most of the comments related to the restriction of > > which index can be picked atop IsIndexUsableForReplicaIdentityFull(). > > Now, the comments related to li

Re: Synchronizing slots from primary to standby

2023-07-23 Thread Amit Kapila
On Mon, Jul 24, 2023 at 8:03 AM Bharath Rupireddy wrote: > > On Fri, Jul 21, 2023 at 5:16 PM shveta malik wrote: > > > > Thanks Bharat for letting us know. It is okay to split the patch, it > > may definitely help to understand the modules better but shall we take > > a step back and try to reeva

Re: Use COPY for populating all pgbench tables

2023-07-23 Thread Michael Paquier
On Sun, Jul 23, 2023 at 08:21:51PM +0900, Michael Paquier wrote: > Cool. I have applied the new tests for now to move on with this > thread. I have done a few more things on this patch today, including measurements with a local host and large scaling numbers. One of my hosts was taking for insta

Re: logical decoding and replication of sequences, take 2

2023-07-23 Thread Amit Kapila
On Thu, Jul 20, 2023 at 8:22 PM Tomas Vondra wrote: > > OK, I merged the changes into the patches, with some minor changes to > the wording etc. > I think we can do 0001-Make-test_decoding-ddl.out-shorter-20230720 even without the rest of the patches. Isn't it a separate improvement? I see that

Re: multiple membership grants and information_schema.applicable_roles

2023-07-23 Thread Pavel Luzanov
On 23.07.2023 23:03, Tom Lane wrote: CREATE RECURSIVE VIEW APPLICABLE_ROLES ( GRANTEE, ROLE_NAME, IS_GRANTABLE ) AS ( ( SELECT GRANTEE, ROLE_NAME, IS_GRANTABLE FROM DEFINITION_SCHEMA.ROLE_AUTHORIZATION_DESCRIPTORS WHERE ( GRANTEE IN ( CURRENT_USER, 'PUBLIC'