Re: [PATCH] Add function to_oct

2023-08-14 Thread Vik Fearing
On 8/15/23 06:11, Nathan Bossart wrote: On Tue, Jul 25, 2023 at 08:29:17PM -0700, Nathan Bossart wrote: Here's a new version of the patch with the silly mistakes fixed. If there are no objections, I'd like to commit this patch soon. I just took a look at this (and the rest of the thread).

Re: ECPG Semantic Analysis

2023-08-14 Thread Michael Meskes
Hi, > I have a modified version of ECPG, to which I gave the ability to > do semantic analysis of SQL statements. Where i can share it or with > whom can I discuss it? Feel free to send it my way. Thanks, Michael -- Michael Meskes Michael at Fam-Meskes dot De Michael at Meskes dot

Re: proposal: jsonb_populate_array

2023-08-14 Thread Pavel Stehule
út 15. 8. 2023 v 7:48 odesílatel Vik Fearing napsal: > On 8/14/23 15:37, Pavel Stehule wrote: > > po 14. 8. 2023 v 15:09 odesílatel Erik Rijkers napsal: > > > >> Op 8/14/23 om 14:51 schreef Pavel Stehule:> po 14. 8. 2023 v 11:32 > >> odesílatel Alvaro Herrera > >> > with proposed function I

Re: proposal: jsonb_populate_array

2023-08-14 Thread Vik Fearing
On 8/14/23 15:37, Pavel Stehule wrote: po 14. 8. 2023 v 15:09 odesílatel Erik Rijkers napsal: Op 8/14/23 om 14:51 schreef Pavel Stehule:> po 14. 8. 2023 v 11:32 odesílatel Alvaro Herrera > with proposed function I can write > > select jsonb_populate_array(null:date[], >

Re: Using defines for protocol characters

2023-08-14 Thread Tatsuo Ishii
> I tried to address all the feedback in v5 of the patch, which is attached. > I limited the patch to only the characters that have names in the "Message > Formats" section of protocol.sgml instead of trying to invent names for > unnamed characters. > > I'm aware of one inconsistency. While I

Re: proposal: jsonb_populate_array

2023-08-14 Thread Vik Fearing
On 8/14/23 15:47, Chapman Flack wrote: On 2023-08-14 09:11, Erik Rijkers wrote:   , '$' returning date[] I certainly like that syntax better. It's not that the "here's a null to tell you the type I want" is terribly unclear, but it seems not to be an idiom I have seen a lot of in PostgreSQL

Re: Extract numeric filed in JSONB more effectively

2023-08-14 Thread Pavel Stehule
út 15. 8. 2023 v 7:23 odesílatel Pavel Stehule napsal: > Hi > > út 15. 8. 2023 v 5:24 odesílatel Andy Fan > napsal: > >> >>> jsonb_extract_xx_type just cares about the argtype, but >>> 'explain select xx' will still access the const->constvalue. >>> const->constvalue is 0 which is set by

Re: Extract numeric filed in JSONB more effectively

2023-08-14 Thread Pavel Stehule
Hi út 15. 8. 2023 v 5:24 odesílatel Andy Fan napsal: > >> jsonb_extract_xx_type just cares about the argtype, but >> 'explain select xx' will still access the const->constvalue. >> const->constvalue is 0 which is set by makeNullConst currently, >> and it is ok for the current supported type.

Re: Fix pg_stat_reset_single_table_counters function

2023-08-14 Thread Masahiro Ikeda
On 2023-08-15 11:48, Masahiko Sawada wrote: On Mon, Aug 14, 2023 at 5:12 PM Masahiro Ikeda wrote: I changed the table to check the stats from pg_database to pg_shdescription because the stats can update via the SQL interface COMMENT command. It seems to work well. +COMMENT ON DATABASE

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

2023-08-14 Thread Zhijie Hou (Fujitsu)
On Tuesday, August 15, 2023 11:06 AM Amit Kapila wrote: > > On Tue, Aug 15, 2023 at 7:51 AM Masahiko Sawada > wrote: > > > > On Mon, Aug 14, 2023 at 2:07 PM Amit Kapila > wrote: > > > > > > On Mon, Aug 14, 2023 at 7:57 AM Masahiko Sawada > wrote: > > > > Another idea is (which might have

Re: [PATCH] Add function to_oct

2023-08-14 Thread Nathan Bossart
On Tue, Jul 25, 2023 at 08:29:17PM -0700, Nathan Bossart wrote: > Here's a new version of the patch with the silly mistakes fixed. If there are no objections, I'd like to commit this patch soon. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: Using defines for protocol characters

2023-08-14 Thread Nathan Bossart
I tried to address all the feedback in v5 of the patch, which is attached. I limited the patch to only the characters that have names in the "Message Formats" section of protocol.sgml instead of trying to invent names for unnamed characters. I'm aware of one inconsistency. While I grouped all

Re: Extract numeric filed in JSONB more effectively

2023-08-14 Thread Andy Fan
> > > jsonb_extract_xx_type just cares about the argtype, but > 'explain select xx' will still access the const->constvalue. > const->constvalue is 0 which is set by makeNullConst currently, > and it is ok for the current supported type. > The exception is numeric data type, the constvalue

Re: proposal: jsonb_populate_array

2023-08-14 Thread jian he
\df jsonb_populate_record List of functions Schema | Name | Result data type | Argument data types | Type +---+--+-+-- pg_catalog | jsonb_populate_record | anyelement

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

2023-08-14 Thread Amit Kapila
On Tue, Aug 15, 2023 at 7:51 AM Masahiko Sawada wrote: > > On Mon, Aug 14, 2023 at 2:07 PM Amit Kapila wrote: > > > > On Mon, Aug 14, 2023 at 7:57 AM Masahiko Sawada > > wrote: > > > Another idea is (which might have already discussed thoguh) that we check > > > if the latest shutdown

Re: Fix pg_stat_reset_single_table_counters function

2023-08-14 Thread Masahiko Sawada
Hi, On Mon, Aug 14, 2023 at 5:12 PM Masahiro Ikeda wrote: > > Hi, > > On 2023-08-13 04:12, Andres Freund wrote: > > On 2023-08-10 17:48:10 +0900, Masahiko Sawada wrote: > >> Good catch! I've confirmed that the issue has been fixed by your > >> patch. > > > > Indeed. > > Thanks for your

Re: logicalrep_worker_launch -- counting/checking the worker limits

2023-08-14 Thread Peter Smith
A rebase was needed due to a recent push [1]. PSA v3. -- [1] https://github.com/postgres/postgres/commit/2a8b40e3681921943a2989fd4ec6cdbf8766566c Kind Regards, Peter Smith. Fujitsu Australia v3-0001-logicalrep_worker_launch-limit-checks.patch Description: Binary data

Re: Do we want a hashset type?

2023-08-14 Thread jian he
https://github.com/tvondra/hashset On Mon, Aug 14, 2023 at 11:23 PM Florents Tselai wrote: > > Has anyone put this in a git repo / extension package or similar ? > > I’d like to try it out outside the core pg tree. > > > On 1 Jul 2023, at 12:04 PM, Joel Jacobson wrote: > > > > On Fri, Jun 30,

Re: [PoC] Improve dead tuple storage for lazy vacuum

2023-08-14 Thread Masahiko Sawada
Hi, On Mon, Aug 14, 2023 at 8:05 PM John Naylor wrote: > > On Thu, Jul 13, 2023 at 3:09 PM Masahiko Sawada wrote: > > > > 0007, 0008, 0010, and 0011 are straightforward and agree to merge them. Thank you for updating the patch! > > [Part 1 - clear the deck of earlier performance work etc] > >

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

2023-08-14 Thread Masahiko Sawada
On Mon, Aug 14, 2023 at 2:07 PM Amit Kapila wrote: > > On Mon, Aug 14, 2023 at 7:57 AM Masahiko Sawada wrote: > > > > On Sat, Aug 12, 2023, 15:20 Amit Kapila wrote: > >> > >> I don't think we need the complexity of version-specific checks if we > >> do what we do in get_control_data().

Re: [RFC] Clang plugin for catching suspicious typedef casting

2023-08-14 Thread Xing Guo
Hi, On 8/10/23, Dmitry Dolgov <9erthali...@gmail.com> wrote: >> On Wed, Aug 09, 2023 at 03:23:32PM +0200, Peter Eisentraut wrote: >> On 03.08.23 18:56, Dmitry Dolgov wrote: >> > I would like to get your opinion, folks. Does it sound interesting >> > enough for the community, is it worth it to

Re: Regression test collate.icu.utf8 failed on REL_14_STABLE

2023-08-14 Thread Japin Li
On Tue, 15 Aug 2023 at 08:54, Japin Li wrote: > On Tue, 15 Aug 2023 at 08:49, Andy Fan wrote: >>> >>> >>> >>> DROP SCHEMA test_schema; >>> +ERROR: cannot drop schema test_schema because other objects depend on it >>> +DETAIL: collation test_schema.test11 depends on schema test_schema >>>

Re: Regression test collate.icu.utf8 failed on REL_14_STABLE

2023-08-14 Thread Japin Li
On Tue, 15 Aug 2023 at 08:49, Andy Fan wrote: >> >> >> >> DROP SCHEMA test_schema; >> +ERROR: cannot drop schema test_schema because other objects depend on it >> +DETAIL: collation test_schema.test11 depends on schema test_schema >> +HINT: Use DROP ... CASCADE to drop the dependent objects

Re: Regression test collate.icu.utf8 failed on REL_14_STABLE

2023-08-14 Thread Andy Fan
> > > > DROP SCHEMA test_schema; > +ERROR: cannot drop schema test_schema because other objects depend on it > +DETAIL: collation test_schema.test11 depends on schema test_schema > +HINT: Use DROP ... CASCADE to drop the dependent objects too. > DROP ROLE regress_test_role; > +ERROR: role

Re: Support to define custom wait events for extensions

2023-08-14 Thread Michael Paquier
On Tue, Aug 15, 2023 at 09:14:15AM +0900, Masahiro Ikeda wrote: > OK. I'll make a new patch and start a new thread. Cool, thanks! -- Michael signature.asc Description: PGP signature

Re: Support to define custom wait events for extensions

2023-08-14 Thread Masahiro Ikeda
On 2023-08-14 18:26, Michael Paquier wrote: On Mon, Aug 14, 2023 at 05:55:42PM +0900, Masahiro Ikeda wrote: I'm thinking a name like "contrib name + description summary" would be nice. The "contrib name" is namespace-like and the "description summary" is the same as the name of the waiting

Re: Ignore 2PC transaction GIDs in query jumbling

2023-08-14 Thread Michael Paquier
On Mon, Aug 14, 2023 at 12:11:13PM +0100, Dagfinn Ilmari Mannsåker wrote: > As far as I could tell the only thing missing was removing > DeallocateStmt from the list of unhandled utility statement types (and > updating comments to match). Updated patch attached. Hmm. One issue with the patch is

Re: PG 16 draft release notes ready

2023-08-14 Thread Bruce Momjian
On Thu, Aug 10, 2023 at 07:56:12AM +0300, Pavel Luzanov wrote: > On 09.08.2023 21:06, Bruce Momjian wrote: > > On Sun, Jul 23, 2023 at 02:09:17PM +0300, Pavel Luzanov wrote: > > > Please consider to add item to the psql section: > > > > > > Add psql \drg command to display role grants and remove

Re: walsender "wakeup storm" on PG16, likely because of bc971f4025c (Optimize walsender wake up logic using condition variables)

2023-08-14 Thread Thomas Munro
On Tue, Aug 15, 2023 at 2:23 AM Tomas Vondra wrote: > I'm not familiar with the condition variable code enough to have an > opinion, but the patch seems to resolve the issue for me - I can no > longer reproduce the high CPU usage. Thanks, pushed.

ECPG Semantic Analysis

2023-08-14 Thread Juan Rodrigo Alejandro Burgos Mella
Hi I have a modified version of ECPG, to which I gave the ability to do semantic analysis of SQL statements. Where i can share it or with whom can I discuss it? Atte. JRBM

Re: Regarding Contributions

2023-08-14 Thread Bruce Momjian
On Tue, Aug 15, 2023 at 01:24:44AM +0530, Satwik Sharma wrote: > Hello, my name is Satwik Sharma, and I'm an enthusiast in the fields of data > science and new to open source development. I presently use Python, SQL, > MongoDB, PowerBI, Tableau, and am currently studying Scala. I came across the >

Regarding Contributions

2023-08-14 Thread Satwik Sharma
Hello, my name is Satwik Sharma, and I'm an enthusiast in the fields of data science and new to open source development. I presently use Python, SQL, MongoDB, PowerBI, Tableau, and am currently studying Scala. I came across the repository maintained by your company, and I want to contribute. It

Re: run pgindent on a regular basis / scripted manner

2023-08-14 Thread Andrew Dunstan
On 2023-08-14 Mo 10:04, Peter Eisentraut wrote: On 12.08.23 23:14, Andres Freund wrote: It's a somewhat annoying task though, find all the typedefs, add them to the right place in the file (we have an out of order entry right now). I think a script that*adds*  (but doesn't remove) local

Re: In-placre persistance change of a relation

2023-08-14 Thread Nathan Bossart
I think there are some good ideas here. I started to take a look at the patches, and I've attached a rebased version of the patch set. Apologies if I am repeating any discussions from upthread. First, I tested the time difference in ALTER TABLE SET UNLOGGED/LOGGED with the patch applied, and

Re: CREATE FUNCTION ... SEARCH { DEFAULT | SYSTEM | SESSION }

2023-08-14 Thread Jeff Davis
On Sat, 2023-08-12 at 11:25 -0700, Andres Freund wrote: > > I'm not sure that anything based, directly or indirectly, on > search_path > really is a realistic way to get there. Can you explain a little more? I see what you mean generally, that search_path is an imprecise thing, and that it

Re: [PATCH] psql: Add tab-complete for optional view parameters

2023-08-14 Thread David Zhang
[..] For below changes, else if (TailMatches("CREATE", "VIEW", MatchAny, "AS") || -             TailMatches("CREATE", "OR", "REPLACE", "VIEW", MatchAny, "AS")) +             TailMatches("CREATE", "VIEW", MatchAny, "WITH", "(*)", "AS") || +             TailMatches("CREATE", "OR",

Re: Extract numeric filed in JSONB more effectively

2023-08-14 Thread Andy Fan
On Mon, Aug 14, 2023 at 10:10 PM Tom Lane wrote: > Chapman Flack writes: > > Providing a function with return type declared internal but > > with no parameter of that type is not good, > > Not so much "not good" as "absolutely, positively WILL NOT HAPPEN". Chap is pretty nice to others:). >

Re: Replace known_assigned_xids_lck by memory barrier

2023-08-14 Thread Nathan Bossart
On Sun, Mar 19, 2023 at 12:43:43PM +0300, Michail Nikolaev wrote: > In a nutshell: KnownAssignedXids as well as the head/tail pointers are > modified only by the startup process, so spinlock is used to ensure > that updates of the array and head/tail pointers are seen in a correct > order. It is

Regression test collate.icu.utf8 failed on REL_14_STABLE

2023-08-14 Thread Japin Li
Hi, hackers I find when I compile PG 14 with --with-icu, collate.icu.utf8 and foreign_data regression tests will failed. However it is OK on REL_15_STABLE and master. I also test this on REL_13_STABLE, and it also failed. Here is the regression diffs. diff -U3

Re: Do we want a hashset type?

2023-08-14 Thread Florents Tselai
Has anyone put this in a git repo / extension package or similar ? I’d like to try it out outside the core pg tree. > On 1 Jul 2023, at 12:04 PM, Joel Jacobson wrote: > > On Fri, Jun 30, 2023, at 06:50, jian he wrote: >> more like a C questions >> in this context does >> #define

Re: pgbench - adding pl/pgsql versions of tests

2023-08-14 Thread Nathan Bossart
On Wed, Jan 04, 2023 at 07:06:44PM +0100, Hannu Krosing wrote: > 1. so I don't have to create the script and function manually each > time I want to test mainly the database (instead of the > client-database system) > > 2. so that new users of PostgreSQL can easily see how much better OLTP >

Re: [PATCH] psql: \dn+ to show size of each schema (and \dA+ for AMs)

2023-08-14 Thread Justin Pryzby
On Thu, Dec 15, 2022 at 10:13:23AM -0600, Justin Pryzby wrote: > This patch record was "closed for lack of interest", but I think what's > actually needed is committer review of which approach to take. On Tue, Aug 01, 2023 at 09:54:34AM +0200, Daniel Gustafsson wrote: > > On 24 May 2023, at

Re: AssertLog instead of Assert in some places

2023-08-14 Thread Ashutosh Bapat
On Sat, Aug 12, 2023 at 12:56 AM Andres Freund wrote: > On 2023-08-11 11:56:27 -0700, Peter Geoghegan wrote: > > On Fri, Aug 11, 2023 at 11:23 AM Andres Freund wrote: > > > > Couldn't you say the same thing about defensive "can't happen" ERRORs? > > > > They are essentially a form of assertion

Re: [RFC] Add jit deform_counter

2023-08-14 Thread Dmitry Dolgov
> On Wed, Jul 19, 2023 at 05:18:29PM +0200, Dmitry Dolgov wrote: > > On Tue, Jul 18, 2023, 3:32 PM Daniel Gustafsson wrote > >> Here is the patch with the proposed variation. > > > > This version still leaves non-text EXPLAIN formats with timing which > doesn't > > add up. Below are JSON and XML

Re: AssertLog instead of Assert in some places

2023-08-14 Thread Ashutosh Bapat
On Fri, Aug 11, 2023 at 11:27 PM Andres Freund wrote: > > > > Attached patch combines Assert and elog(ERROR, ) so that when an > > Assert is triggered in assert-enabled binary, it will throw an error > > while keeping the backend intact. Thus it does not affect gdb session > > or psql session.

Re: Make psql's qeury canceling test simple by using signal() routine of IPC::Run

2023-08-14 Thread Yugo NAGATA
On Mon, 14 Aug 2023 08:29:25 +0900 Michael Paquier wrote: > On Sun, Aug 13, 2023 at 11:22:33AM +0200, Fabien COELHO wrote: > > Test run is ok on my Ubuntu laptop. > > I have a few comments about this patch. > > On HEAD and even after this patch, we still have the following: > SKIP:

Re: pgbench: allow to exit immediately when any client is aborted

2023-08-14 Thread Yugo NAGATA
On Sun, 13 Aug 2023 11:27:55 +0200 (CEST) Fabien COELHO wrote: > > Hello Yugo-san, > > >> I attached the updated patch v3 including changes above, a test, > >> and fix of the typo you pointed out. > > > > I'm sorry but the test in the previous patch was incorrect. > > I attached the correct

Re: proposal: jsonb_populate_array

2023-08-14 Thread Pavel Stehule
po 14. 8. 2023 v 15:47 odesílatel Chapman Flack napsal: > On 2023-08-14 09:11, Erik Rijkers wrote: > > , '$' returning date[] > > I certainly like that syntax better. > > It's not that the "here's a null to tell you the type I want" > is terribly unclear, but it seems not to be an idiom I have

Re: walsender "wakeup storm" on PG16, likely because of bc971f4025c (Optimize walsender wake up logic using condition variables)

2023-08-14 Thread Tomas Vondra
On 8/11/23 21:51, Thomas Munro wrote: > On Sat, Aug 12, 2023 at 5:51 AM Andres Freund wrote: >> On 2023-08-11 15:31:43 +0200, Tomas Vondra wrote: >>> It seems to me the issue is in WalSndWait, which was reworked to use >>> ConditionVariableCancelSleep() in bc971f4025c. The walsenders end up

Re: Extract numeric filed in JSONB more effectively

2023-08-14 Thread Tom Lane
Chapman Flack writes: > Providing a function with return type declared internal but > with no parameter of that type is not good, Not so much "not good" as "absolutely, positively WILL NOT HAPPEN". > because then a > user could, in principle, call it and obtain a value of > 'internal' type, and

Re: run pgindent on a regular basis / scripted manner

2023-08-14 Thread Peter Eisentraut
On 12.08.23 02:11, Tom Lane wrote: Andres Freund writes: On 2023-08-11 18:30:02 -0400, Tom Lane wrote: +1 for including this in CI tests I didn't even mean CI - I meant 'make check-world' / 'meson test'. Which of course would include CI automatically. Hmm. I'm allergic to anything that

Re: run pgindent on a regular basis / scripted manner

2023-08-14 Thread Peter Eisentraut
On 12.08.23 23:14, Andres Freund wrote: It's a somewhat annoying task though, find all the typedefs, add them to the right place in the file (we have an out of order entry right now). I think a script that*adds* (but doesn't remove) local typedefs would make this less painful. I was puzzled

Re: Extract numeric filed in JSONB more effectively

2023-08-14 Thread Chapman Flack
On 2023-08-14 03:06, Andy Fan wrote: We'd still have functions like jsonb_field_as_numeric() under the hood, but there's not an expectation that users call them explicitly. To avoid the lots of functions like jsonb_field_as_int2/int4, I defined Datum jsonb_object_field_type(.., Oid target_oid)

Re: proposal: jsonb_populate_array

2023-08-14 Thread Chapman Flack
On 2023-08-14 09:11, Erik Rijkers wrote: , '$' returning date[] I certainly like that syntax better. It's not that the "here's a null to tell you the type I want" is terribly unclear, but it seems not to be an idiom I have seen a lot of in PostgreSQL before now. Are there other places it's

Re: proposal: jsonb_populate_array

2023-08-14 Thread Pavel Stehule
po 14. 8. 2023 v 15:09 odesílatel Erik Rijkers napsal: > Op 8/14/23 om 14:51 schreef Pavel Stehule:> po 14. 8. 2023 v 11:32 > odesílatel Alvaro Herrera > > with proposed function I can write > > > > select jsonb_populate_array(null:date[], > > '["2023-07-13","2023-07-14"]'::jsonb) > > >

Re: proposal: jsonb_populate_array

2023-08-14 Thread Erik Rijkers
Op 8/14/23 om 14:51 schreef Pavel Stehule:> po 14. 8. 2023 v 11:32 odesílatel Alvaro Herrera > with proposed function I can write > > select jsonb_populate_array(null:date[], > '["2023-07-13","2023-07-14"]'::jsonb) > Not yet committed, but outstanding SQL/JSON patches (v11) will let you do:

Re: Wrong rows estimations with joins of CTEs slows queries by more than factor 500

2023-08-14 Thread Tomas Vondra
Hi, I haven't looked at the patch, but please add the patch to the next commit fest (2023-09), so that we don't lose track of it. See https://commitfest.postgresql.org regards Tomas On 8/14/23 13:12, Jian Guo wrote: > Hi hackers, > > I have written a patch to add stats info for Vars in

Re: Extract numeric filed in JSONB more effectively

2023-08-14 Thread Pavel Stehule
po 14. 8. 2023 v 11:17 odesílatel Andy Fan napsal: > >> you cannot to use type as parameter. There should be some typed value - >> like >> >> jsonb_object_field, '{"a":10}', 'a', NULL::int) >> >> and return type should be anyelement. >> >> > So could we get the inputted type in the body of

Re: proposal: jsonb_populate_array

2023-08-14 Thread Pavel Stehule
po 14. 8. 2023 v 11:32 odesílatel Alvaro Herrera napsal: > On 2023-Aug-14, Pavel Stehule wrote: > > > jsonb_populate_array(anyarray, jsonb) returns anyarray > > > > Usage: > > > > select jsonb_populate_array(null::text[], > '["cust_full_name","cust_email"]') > > I don't understand what this

Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication

2023-08-14 Thread vignesh C
On Thu, 10 Aug 2023 at 10:16, Amit Kapila wrote: > > On Wed, Aug 9, 2023 at 8:28 AM Zhijie Hou (Fujitsu) > wrote: > > > > On Thursday, August 3, 2023 7:30 PM Melih Mutlu > > wrote: > > > > > Right. I attached the v26 as you asked. > > > > Thanks for posting the patches. > > > > While

Re: Wrong rows estimations with joins of CTEs slows queries by more than factor 500

2023-08-14 Thread Jian Guo
Hi hackers, I have written a patch to add stats info for Vars in CTEs. With this patch, the join size estimation on the upper of CTE scans became more accurate. In the function selfuncs.c:eqjoinsel it uses the number of the distinct values of the two join variables to estimate join size, and

Re: Ignore 2PC transaction GIDs in query jumbling

2023-08-14 Thread Dagfinn Ilmari Mannsåker
Michael Paquier writes: > On Sun, Aug 13, 2023 at 02:48:22PM +0800, Julien Rouhaud wrote: >> On Sun, Aug 13, 2023 at 03:25:33PM +0900, Michael Paquier wrote: >>> Perhaps not as much, actually, because I was just reminded that >>> DEALLOCATE is something that pg_stat_statements ignores. So this

Re: [PoC] Improve dead tuple storage for lazy vacuum

2023-08-14 Thread John Naylor
On Thu, Jul 13, 2023 at 3:09 PM Masahiko Sawada wrote: > > 0007, 0008, 0010, and 0011 are straightforward and agree to merge them. [Part 1 - clear the deck of earlier performance work etc] Thanks for taking a look! I've merged 0007 and 0008. The others need a performance test to justify them --

Re: pgbench with libevent?

2023-08-14 Thread Tatsuo Ishii
> It could be refactored to support a different subset of event types -- > maybe just sockets, no latches and obviously no 'postmaster death'. Ok. > But figuring out how to make latches work between threads might also > be interesting for future projects... Maybe. Some people are working on

Re: Synchronizing slots from primary to standby

2023-08-14 Thread shveta malik
On Mon, Aug 14, 2023 at 3:22 PM shveta malik wrote: > > On Tue, Aug 8, 2023 at 11:11 AM Drouvot, Bertrand > wrote: > > > > Hi, > > > > On 8/8/23 7:01 AM, shveta malik wrote: > > > On Mon, Aug 7, 2023 at 3:17 PM Drouvot, Bertrand > > > wrote: > > >> > > >> Hi, > > >> > > >> On 8/4/23 1:32 PM,

Re: pgbench with libevent?

2023-08-14 Thread Fabien COELHO
4. libevent development seems slugish, last bugfix was published 3 years ago, version 2.2 has been baking for years, but the development seems lively (+100 contributors). Ugh, I would stay away from something like that. Would we become hostage to an undelivering group? No thanks.

Re: pgbench with libevent?

2023-08-14 Thread Fabien COELHO
Interesting. In my understanding this also needs to make Latch frontend-friendly? It could be refactored to support a different subset of event types -- maybe just sockets, no latches and obviously no 'postmaster death'. But figuring out how to make latches work between threads might also be

Re: pgbench with libevent?

2023-08-14 Thread Fabien COELHO
Hello Thomas, Pgbench is managing clients I/Os manually with select or poll. Much of this could be managed by libevent. Or maybe libuv (used by nodejs?). From preliminary testing libevent seems not too good at fine grain time management which are used for throttling, whereas libuv

Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication

2023-08-14 Thread Amit Kapila
On Thu, Aug 10, 2023 at 10:15 AM Amit Kapila wrote: > > On Wed, Aug 9, 2023 at 8:28 AM Zhijie Hou (Fujitsu) > wrote: > > > > On Thursday, August 3, 2023 7:30 PM Melih Mutlu > > wrote: > > > > > Right. I attached the v26 as you asked. > > > > Thanks for posting the patches. > > > > While

Re: Synchronizing slots from primary to standby

2023-08-14 Thread shveta malik
On Tue, Aug 8, 2023 at 11:11 AM Drouvot, Bertrand wrote: > > Hi, > > On 8/8/23 7:01 AM, shveta malik wrote: > > On Mon, Aug 7, 2023 at 3:17 PM Drouvot, Bertrand > > wrote: > >> > >> Hi, > >> > >> On 8/4/23 1:32 PM, shveta malik wrote: > >>> On Fri, Aug 4, 2023 at 2:44 PM Drouvot, Bertrand > >>>

Re: Add PG CI to older PG releases

2023-08-14 Thread Nazir Bilal Yavuz
Hi, On Fri, 11 Aug 2023 at 02:00, Andres Freund wrote: > At the very least this would need to be combined with > > commit 950e64fa46b164df87b5eb7c6e15213ab9880f87 > Author: Andres Freund > Date: 2022-07-18 17:06:34 -0700 > > Use STDOUT/STDERR_FILENO in most of syslogger.

Re: pgbench with libevent?

2023-08-14 Thread Alvaro Herrera
On 2023-Aug-13, Fabien COELHO wrote: > 4. libevent development seems slugish, last bugfix was published 3 years ago, > version >2.2 has been baking for years, but the development seems lively (+100 > contributors). Ugh, I would stay away from something like that. Would we become hostage

Re: proposal: jsonb_populate_array

2023-08-14 Thread Alvaro Herrera
On 2023-Aug-14, Pavel Stehule wrote: > jsonb_populate_array(anyarray, jsonb) returns anyarray > > Usage: > > select jsonb_populate_array(null::text[], '["cust_full_name","cust_email"]') I don't understand what this does. Can you be more explicit? -- Álvaro Herrera 48°01'N

Re: Support to define custom wait events for extensions

2023-08-14 Thread Michael Paquier
On Mon, Aug 14, 2023 at 05:55:42PM +0900, Masahiro Ikeda wrote: > I'm thinking a name like "contrib name + description summary" would > be nice. The "contrib name" is namespace-like and the "description summary" > is the same as the name of the waiting event name in core. For example, >

Re: POC: Extension for adding distributed tracing - pg_tracing

2023-08-14 Thread Nikita Malakhov
Hi! Storing spans is a tricky question. Monitoring systems often use pull model and use probes or SQL API for pulling data, so from this point of view it is much more convenient to keep spans in separate table. But in this case we come to another issue - how to flush this data into the table?

Re: Extract numeric filed in JSONB more effectively

2023-08-14 Thread Andy Fan
> > > you cannot to use type as parameter. There should be some typed value - > like > > jsonb_object_field, '{"a":10}', 'a', NULL::int) > > and return type should be anyelement. > > So could we get the inputted type in the body of jsonb_object_field? I guess no. IIUC, our goal will still be

Re: Support to define custom wait events for extensions

2023-08-14 Thread Masahiro Ikeda
On 2023-08-14 15:28, Michael Paquier wrote: On Mon, Aug 14, 2023 at 12:31:05PM +0900, Masahiro Ikeda wrote: Thanks! I confirmed the changes, and all tests passed. Okay, cool. I got some extra time today and applied that, with a few more tweaks. Thanks for applying master branch! This

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

2023-08-14 Thread Peter Eisentraut
On 24.07.23 04:46, Amit Kapila wrote: 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,

Re: Fix pg_stat_reset_single_table_counters function

2023-08-14 Thread Masahiro Ikeda
Hi, On 2023-08-13 04:12, Andres Freund wrote: On 2023-08-10 17:48:10 +0900, Masahiko Sawada wrote: Good catch! I've confirmed that the issue has been fixed by your patch. Indeed. Thanks for your responses! However, I'm not sure the added regression tests are stable since autovacuum

Re: Extract numeric filed in JSONB more effectively

2023-08-14 Thread Pavel Stehule
po 14. 8. 2023 v 9:06 odesílatel Andy Fan napsal: > >> We'd still have functions like jsonb_field_as_numeric() under the >> hood, but there's not an expectation that users call them explicitly. >> > > To avoid the lots of functions like jsonb_field_as_int2/int4, I defined > Datum

Re: pgbench with libevent?

2023-08-14 Thread Thomas Munro
On Mon, Aug 14, 2023 at 6:07 PM Tatsuo Ishii wrote: > Interesting. In my understanding this also needs to make Latch > frontend-friendly? It could be refactored to support a different subset of event types -- maybe just sockets, no latches and obviously no 'postmaster death'. But figuring out

Re: Report planning memory in EXPLAIN ANALYZE

2023-08-14 Thread Ashutosh Bapat
On Mon, Aug 14, 2023 at 8:22 AM Andrey Lepikhov wrote: > > Really, the current approach with the final value of consumed memory > smooths peaks of memory consumption. I recall examples likewise massive > million-sized arrays or reparameterization with many partitions where > the optimizer

Re: Extract numeric filed in JSONB more effectively

2023-08-14 Thread Andy Fan
> > > We'd still have functions like jsonb_field_as_numeric() under the > hood, but there's not an expectation that users call them explicitly. > To avoid the lots of functions like jsonb_field_as_int2/int4, I defined Datum jsonb_object_field_type(.., Oid target_oid) at last, so the function

Re: Report planning memory in EXPLAIN ANALYZE

2023-08-14 Thread Ashutosh Bapat
On Mon, Aug 14, 2023 at 5:23 AM David Rowley wrote: > > On Thu, 10 Aug 2023 at 20:33, Ashutosh Bapat > wrote: > > My point is what's relevant here is how much net memory planner asked > > for. > > But that's not what your patch is reporting. All you're reporting is > the difference in memory

Re: Adding a LogicalRepWorker type field

2023-08-14 Thread Peter Smith
The main patch for adding the worker type enum has been pushed [1]. Here is the remaining (rebased) patch for changing some previous cascading if/else to switch on the LogicalRepWorkerType enum instead. PSA v8. -- [1]

Re: Support to define custom wait events for extensions

2023-08-14 Thread Michael Paquier
On Mon, Aug 14, 2023 at 12:31:05PM +0900, Masahiro Ikeda wrote: > Thanks! I confirmed the changes, and all tests passed. Okay, cool. I got some extra time today and applied that, with a few more tweaks. -- Michael signature.asc Description: PGP signature

Re: pgbench with libevent?

2023-08-14 Thread Tatsuo Ishii
> On Mon, Aug 14, 2023 at 12:35 PM Fabien COELHO wrote: >> > Pgbench is managing clients I/Os manually with select or poll. Much of this >> > could be managed by libevent. >> >> Or maybe libuv (used by nodejs?). >> >> From preliminary testing libevent seems not too good at fine grain time >>