autoprewarm main function not tested background worker not listed in pg_stat_activity

2023-12-28 Thread jian he
Hi. https://coverage.postgresql.org/contrib/pg_prewarm/autoprewarm.c.gcov.html function autoprewarm_start_worker never gets tested, but autoprewarm_start_worker listed in our doc (https://www.postgresql.org/docs/16/pgprewarm.html) Maybe we should test it. also this part in function

Re: Synchronizing slots from primary to standby

2023-12-28 Thread Amit Kapila
On Fri, Dec 29, 2023 at 6:59 AM Masahiko Sawada wrote: > > On Wed, Dec 27, 2023 at 7:43 PM Amit Kapila wrote: > > > > > > > > 3) The slotsync worker uses primary_conninfo but also uses a new GUC > > > parameter, say slot_sync_dbname, to specify the database to connect. > > > The slot_sync_dbname

Re: pg_stat_statements: more test coverage

2023-12-28 Thread Julien Rouhaud
On Wed, Dec 27, 2023 at 8:53 PM Peter Eisentraut wrote: > > On 27.12.23 09:08, Julien Rouhaud wrote: > > > > I was a bit surprised by that so I checked locally. It does work as > > expected provided that you set pg_stat_statements.track to all: > > Ok, here is an updated patch set that does it

Re: Pdadmin open on Macbook issue

2023-12-28 Thread Maciek Sakrejda
This is not the right mailing list for your question. Try the pgadmin-support [1] mailing list. You may also want to include more details in your question, because it's not really possible to tell what's going wrong from your description. [1]: https://www.postgresql.org/list/pgadmin-support/

Re: Removing unneeded self joins

2023-12-28 Thread Alexander Lakhin
Hi Alexander, 23.10.2023 14:29, Alexander Korotkov wrote: Fixed all of the above. Thank you for catching this! I've discovered that starting from d3d55ce57 the following query: CREATE TABLE t(a int PRIMARY KEY); WITH tt AS (SELECT * FROM t) UPDATE t SET a = tt.a + 1 FROM tt WHERE tt.a = t.a

Re: Synchronizing slots from primary to standby

2023-12-28 Thread Amit Kapila
On Fri, Dec 29, 2023 at 7:18 AM Masahiko Sawada wrote: > > On Wed, Dec 27, 2023 at 7:13 PM shveta malik wrote: > > > > On Wed, Dec 27, 2023 at 11:36 AM Masahiko Sawada > > wrote: > > > I was not aware if there is any way to connect if we > > want to run SQL queries. I initially tried using

Re: Track in pg_replication_slots the reason why slots conflict?

2023-12-28 Thread Amit Kapila
On Thu, Dec 28, 2023 at 2:58 PM shveta malik wrote: > > PFA the v2-patch with all your comments addressed. > Does anyone have a preference for a column name? The options on the table are conflict_cause, conflicting_cause, conflict_reason. Any others? I was checking docs for similar usage and

Re: POC: GROUP BY optimization

2023-12-28 Thread Andrei Lepikhov
On 28/12/2023 18:29, Alexander Korotkov wrote: On Thu, Dec 28, 2023 at 10:22 AM Andrei Lepikhov wrote: But arrangement with an ORDER BY clause doesn't work: DROP INDEX abc; explain SELECT x,w,z FROM t GROUP BY (w,x,z) ORDER BY (x,z,w); I think the reason is that the sort_pathkeys and

Re: Synchronizing slots from primary to standby

2023-12-28 Thread Masahiko Sawada
On Wed, Dec 27, 2023 at 7:13 PM shveta malik wrote: > > On Wed, Dec 27, 2023 at 11:36 AM Masahiko Sawada > wrote: > > > > Hi, > > > > Thank you for working on this. > > > > On Tue, Dec 26, 2023 at 9:27 PM shveta malik wrote: > > > > > > On Tue, Dec 26, 2023 at 4:41 PM Zhijie Hou (Fujitsu) > >

Re: Removing const-false IS NULL quals and redundant IS NOT NULL quals

2023-12-28 Thread Andy Fan
Richard Guo writes: > > The detection of self-inconsistent restrictions already exists in > planner. > > # set constraint_exclusion to on; > SET > # explain (costs off) select * from a where a > 3 and a is null; > QUERY PLAN > -- > Result >One-Time Filter:

Re: Synchronizing slots from primary to standby

2023-12-28 Thread Masahiko Sawada
On Wed, Dec 27, 2023 at 7:43 PM Amit Kapila wrote: > > On Wed, Dec 27, 2023 at 11:36 AM Masahiko Sawada > wrote: > > > > On Tue, Dec 26, 2023 at 9:27 PM shveta malik wrote: > > > > > > I would like to revisit the current dependency of slotsync worker on > > > dbname used in 002 patch.

Re: Fix Brin Private Spool Initialization (src/backend/access/brin/brin.c)

2023-12-28 Thread Tomas Vondra
On 12/27/23 12:37, Ranier Vilela wrote: > Em ter., 26 de dez. de 2023 às 19:07, Tomas Vondra > mailto:tomas.von...@enterprisedb.com>> > escreveu: > > > > On 12/26/23 19:10, Ranier Vilela wrote: > > Hi, > > > > The commit b437571 >

Re: Revise the Asserts added to bimapset manipulation functions

2023-12-28 Thread David Rowley
On Thu, 28 Dec 2023 at 23:21, David Rowley wrote: > then instead of having to do: > > #ifdef REALLOCATE_BITMAPSETS > a = (Bitmapset *) palloc(BITMAPSET_SIZE(tmp->nwords)); > memcpy(a, tmp, BITMAPSET_SIZE(tmp->nwords)); > pfree(tmp); > #endif > > all over the place. Couldn't we do: > > #ifdef

Re: Statistics Import and Export

2023-12-28 Thread Tomas Vondra
On 12/13/23 11:26, Corey Huinker wrote: > Yeah, that was the simplest output function possible, it didn't seem > > worth it to implement something more advanced. pg_mcv_list_items() is > more convenient for most needs, but it's quite far from the on-disk > representation. > > > I

Re: Avoid computing ORDER BY junk columns unnecessarily

2023-12-28 Thread Tom Lane
I wrote: > Yeah, fair point. I'll try to take a look at your patchset after > the holidays. I spent some time looking at this patch, and I'm not very pleased with it. My basic complaint is that this is a band-aid that only touches things at a surface level, whereas I think we need a much deeper

Re: The segmentation fault of Postgresql 9.6.24

2023-12-28 Thread Bruce Momjian
On Thu, Dec 28, 2023 at 11:20:18PM +0100, Tomas Vondra wrote: > This could be pretty much anything, and without seeing where exactly it > fails it's impossible to say. I see you apparently hit the issue > repeatedly, and tall the information is *exactly* the same - addresses, > code, etc. Try

Re: The segmentation fault of Postgresql 9.6.24

2023-12-28 Thread Tomas Vondra
On 12/28/23 21:09, Kevin Wang wrote: > Hello hackers, > > Our prod databases are still PG 9.6.24.  We have one primary plus 3 > stream replications that are all working well for a long time. Everything is working well until the day it breaks ... > However, when I promoted one standby

Re: Pdadmin open on Macbook issue

2023-12-28 Thread Bruce Momjian
On Thu, Dec 28, 2023 at 04:12:06PM +0800, Anita wrote: > Dear Sir/Madam, > > I have used Pdadmin on my Macbook for a few days, then suddenly it can not be > opened anymore(after i tried to force to exit it when i tried to turn off the > laptop), I have tried many solution to try to fix this issue

The segmentation fault of Postgresql 9.6.24

2023-12-28 Thread Kevin Wang
Hello hackers, Our prod databases are still PG 9.6.24. We have one primary plus 3 stream replications that are all working well for a long time. However, when I promoted one standby database to the primary role, we the the below error message from the PG log: === 2023-12-01

Pdadmin open on Macbook issue

2023-12-28 Thread Anita
Dear Sir/Madam, I have used Pdadmin on my Macbook for a few days, then suddenly it can not be opened anymore(after i tried to force to exit it when i tried to turn off the laptop), I have tried many solution to try to fix this issue but none of them worked. Therefore, can you

PostgreSQL 16.1 dict_snowball.so: undefined symbol: CurrentMemoryContext

2023-12-28 Thread Vitalijus Jefišovas
Hello, Having issues compiling PostgreSQL 16.1 targeting ARM32 architecture. Using building, which currently has 15.5 version, and it compiles and runs well. Currently using GCC 11 with binutils 2.39. During initdb, it gives error message: [356] FATAL: could not load library

Re: broken master regress tests

2023-12-28 Thread Alexander Lakhin
28.12.2023 20:36, Jeff Davis wrote: We do want that test to run though, right? Yes, I think so. I suspect that test line never worked reliably. The skip_test check at the top guarantees that the collation named "en_US" exists, but that doesn't mean that the OS understands the locale 'en_US'.

Windows sockets (select missing events?)

2023-12-28 Thread Ranier Vilela
Hi, The type of field fd_count is defined in winsock.h: typedef unsigned intu_int; So in the struct fd_set, the field fd_count is unsigned int. The pgwin32_select function has loops that use *int* as indices. Question: in Windows, the socket select function isn't missing some events? If

Re: Statistics Import and Export

2023-12-28 Thread Bruce Momjian
On Thu, Dec 28, 2023 at 12:28:06PM -0500, Corey Huinker wrote: > What I am proposing is *import* functions.  I didn't say anything about > how pg_dump obtains the data it prints; however, I would advocate that > we keep that part as simple as possible.  You cannot expect export >

Re: broken master regress tests

2023-12-28 Thread Jeff Davis
On Thu, 2023-12-28 at 18:00 +0300, Alexander Lakhin wrote: > AFAICS, before that commit SELECT getdatabaseencoding() in the test > returned SQL_ASCII, hence the test was essentially skipped, but now > it > returns WIN1252, so problematic CREATE COLLATION(locale = 'en_US', > ...) > is reached. We

Re: Statistics Import and Export

2023-12-28 Thread Corey Huinker
On Wed, Dec 27, 2023 at 10:10 PM Tom Lane wrote: > Corey Huinker writes: > > Export functions was my original plan, for simplicity, maintenance, etc, > > but it seemed like I'd be adding quite a few functions, so the one view > > made more sense for an initial version. Also, I knew that pg_dump

Re: Transaction timeout

2023-12-28 Thread Junwang Zhao
Hey Andrey, On Sun, Dec 24, 2023 at 1:14 AM Andrey M. Borodin wrote: > > > > > On 22 Dec 2023, at 10:39, Japin Li wrote: > > > > > > I try to split the test for transaction timeout, and all passed on my CI > > [1]. > > > I like the refactoring you did in timeout.spec. I thought it is

Re: introduce dynamic shared memory registry

2023-12-28 Thread Nathan Bossart
On Wed, Dec 27, 2023 at 01:53:27PM -0600, Nathan Bossart wrote: > Here is a new version of the patch. In addition to various small changes, > I've rewritten the test suite to use an integer and a lock, added a > dsm_registry_find() function, and adjusted autoprewarm to use the registry. Here's a

Re: broken master regress tests

2023-12-28 Thread Alexander Lakhin
Hello Jeff, 22.12.2023 02:17, Jeff Davis wrote: On Wed, 2023-12-20 at 17:48 -0800, Jeff Davis wrote: Attached. It appears to increase the coverage. I committed it and I'll see how the buildfarm reacts. Starting from the commit 8793c6005, I observe a failure of test collate.windows.win1252

Re: Multidimensional Histograms

2023-12-28 Thread Tomas Vondra
On 12/27/23 22:19, Tomas Vondra wrote: > Hello Alexander, > > We actually had histograms in the early patches adding multivariate > statistics [1]. We however ended up removing histograms and only kept > the simpler types, for a couple reasons. > > It might be worth going through the discussion

Tidy fill hstv array (src/backend/access/heap/pruneheap.c)

2023-12-28 Thread Ranier Vilela
Hi, The function heap_page_prune (src/backend/access/heap/pruneheap.c) Has a comment: "/* * presult->htsv is not initialized here because all ntuple spots in the * array will be set either to a valid HTSV_Result value or -1. */ IMO, this is a little bogus and does not make sense. I think it

Re: doc patch: note AttributeRelationId passed to FDW validator function

2023-12-28 Thread Ian Lawrence Barwick
2023年12月28日(木) 15:37 Michael Paquier : > > On Thu, Dec 28, 2023 at 01:55:27PM +0900, Ian Lawrence Barwick wrote: > > 2023年6月7日(水) 9:08 Ian Lawrence Barwick : > >> The alternative v2 patch adds this to this list of OIDs, and also > >> formats it as an > >> SGML list, which IMHO is easier to read. >

Re: Switching XLog source from archive to streaming when primary available

2023-12-28 Thread Bharath Rupireddy
On Sat, Oct 21, 2023 at 11:59 PM Bharath Rupireddy wrote: > > On Fri, Jul 21, 2023 at 12:38 PM Bharath Rupireddy > wrote: > > > > Needed a rebase. I'm attaching the v13 patch for further consideration. > > Needed a rebase. I'm attaching the v14 patch. It also has the following > changes: > > -

Re: pg_upgrade failing for 200+ million Large Objects

2023-12-28 Thread Robins Tharakan
On Thu, 28 Dec 2023 at 01:48, Tom Lane wrote: > Robins Tharakan writes: > > Applying all 4 patches, I also see good performance improvement. > > With more Large Objects, although pg_dump improved significantly, > > pg_restore is now comfortably an order of magnitude faster. > > Yeah. The key

Re: POC: GROUP BY optimization

2023-12-28 Thread Alexander Korotkov
On Thu, Dec 28, 2023 at 10:22 AM Andrei Lepikhov wrote: > But arrangement with an ORDER BY clause doesn't work: > > DROP INDEX abc; > explain SELECT x,w,z FROM t GROUP BY (w,x,z) ORDER BY (x,z,w); > > I think the reason is that the sort_pathkeys and group_pathkeys are > physically different

Re: Set log_lock_waits=on by default

2023-12-28 Thread Shinya Kato
On 2023-12-22 20:00, Laurenz Albe wrote: My point is that in the vast majority of cases, long lock waits indicate a problem that you would like to know about, so the parameter should default to "on". +1. I always set log_lock_waits=on, so I agree with this. Just a random idea but what if

Re: Some revises in adding sorting path

2023-12-28 Thread Shubham Khanna
On Thu, Dec 28, 2023 at 4:01 PM Shubham Khanna wrote: > > On Thu, Dec 28, 2023 at 4:00 PM Richard Guo wrote: > > > > > > On Wed, Mar 29, 2023 at 4:00 AM David Rowley wrote: > >> > >> If you write some tests for this code, it will be useful to prove that > >> it actually does something, and also

Re: Some revises in adding sorting path

2023-12-28 Thread Shubham Khanna
On Thu, Dec 28, 2023 at 4:00 PM Richard Guo wrote: > > > On Wed, Mar 29, 2023 at 4:00 AM David Rowley wrote: >> >> If you write some tests for this code, it will be useful to prove that >> it actually does something, and also that it does not break again in >> the future. I don't really want to

Re: pg_upgrade and logical replication

2023-12-28 Thread Amit Kapila
On Wed, Dec 13, 2023 at 12:09 PM vignesh C wrote: > > Thanks for the comments, the attached v25 version patch has the > changes for the same. > I have looked at it again and made some cosmetic changes like changing some comments and a minor change in one of the error messages. See, if the

Re: Revise the Asserts added to bimapset manipulation functions

2023-12-28 Thread David Rowley
On Wed, 27 Dec 2023 at 22:30, Richard Guo wrote: > The Asserts added to bitmapset.c by commits 71a3e8c43b and 7d58f2342b > contain some duplicates, such as in bms_difference, bms_is_subset, > bms_subset_compare, bms_int_members and bms_join. For instance, I'm just learning of these changes now.

Re: Track in pg_replication_slots the reason why slots conflict?

2023-12-28 Thread shveta malik
On Thu, Dec 28, 2023 at 10:16 AM shveta malik wrote: > > On Wed, Dec 27, 2023 at 4:16 PM Amit Kapila wrote: > > > > On Wed, Dec 27, 2023 at 3:08 PM shveta malik wrote: > > > > > > PFA the patch which attempts to implement this. > > > > > > This patch changes the existing 'conflicting' field to

Re: POC: GROUP BY optimization

2023-12-28 Thread Andrei Lepikhov
On 27/12/2023 12:07, Tom Lane wrote: Andrei Lepikhov writes: To be clear. In [1], I mentioned we can perform micro-benchmarks and structure costs of operators. At least for fixed-length operators, it is relatively easy. I repeat what I said: this is a fool's errand. You will not get