Re: First draft of PG 17 release notes

2024-07-16 Thread Kisoon Kwon
Hi, In the PG17 release notes, I noticed it is mentioned as "pg_attribute.stxstattarget" which seems incorrect. In my opinion, it should be "pg_statistic_ext.stxstattarget" because the "stxstattarget" column is part of the "pg_statistic_ext" catalog. Regards, Kisoon Kwon Bitnine Global (www.bitni

Re: New function normal_rand_array function to contrib/tablefunc.

2024-07-16 Thread Andy Fan
Andy Fan writes: (just noticed this reply is sent to Jim privately, re-sent it to public.) > Hi Jim, > >> >> When either minval or maxval exceeds int4 the function cannot be >> executed/found >> >> SELECT * FROM normal_rand_array(5, 10, 8, 42::bigint); >> >> ERROR:  function normal_rand_array(i

Re: New function normal_rand_array function to contrib/tablefunc.

2024-07-16 Thread Andy Fan
Dean Rasheed writes: > My suggestion would be to mirror the signatures of the core random() > functions more closely, and have this: > > 1). rand_array(numvals int, minlen int, maxlen int) > returns setof float8[] > > 2). rand_array(numvals int, minlen int, maxlen int, >minval

Re: long-standing data loss bug in initial sync of logical replication

2024-07-16 Thread Amit Kapila
On Tue, Jul 16, 2024 at 6:54 PM vignesh C wrote: > > On Tue, 16 Jul 2024 at 11:59, Amit Kapila wrote: > > > > On Tue, Jul 16, 2024 at 9:29 AM Amit Kapila wrote: > > > > > > One related comment: > > > @@ -1219,8 +1219,14 @@ AlterPublicationTables(AlterPublicationStmt > > > *stmt, HeapTuple tup, >

RE: Slow catchup of 2PC (twophase) transactions on replica in LR

2024-07-16 Thread Hayato Kuroda (Fujitsu)
Dear Hou, Peter, Thanks for giving comments! PSA new version. Almost comments were addressed. What's new: 0001 - IsTwoPhaseTransactionGidForSubid() was updated per comment from Hou-san [1]. Some nitpicks were accepted. 0002 - An argument in CheckAlterSubOption() was renamed to " slot_ne

Re: Expand applicability of aggregate's sortop optimization

2024-07-16 Thread Andrei Lepikhov
On 5/9/24 08:08, David Rowley wrote: On Thu, 9 May 2024 at 12:26, David Rowley wrote: I wonder if we should also consider as an alternative to this to just have an aggregate support function, similar to SupportRequestOptimizeWindowClause that just nullifies the aggorder / aggdistinct fields for

Re: Slow catchup of 2PC (twophase) transactions on replica in LR

2024-07-16 Thread Peter Smith
Hi, here is my review of the v18-0003 patch. == sgml/ref/alter_subscription.sgml nitpick - some minor tweaks to the documentation text. I also added a link back to the two_phase parameter. Please see the attached diffs file. == Kind Regards, Peter Smith. Fujitsu Australia diff --git a/do

Re: Flush pgstats file during checkpoints

2024-07-16 Thread Michael Paquier
On Tue, Jul 16, 2024 at 10:37:39AM +0900, Michael Paquier wrote: > On Fri, Jul 12, 2024 at 01:01:19PM +, Bertrand Drouvot wrote: >> Instead of removing the stat file, should we keep it around until the first >> call >> to pgstat_write_statsfile()? > > Oops. You are right, I have somewhat miss

Re: Slow catchup of 2PC (twophase) transactions on replica in LR

2024-07-16 Thread Peter Smith
Here are some review comments for patch v18-0002. == src/backend/commands/subscriptioncmds.c 1. CheckAlterSubOption 1a. It's not obvious why we are only checking the 'slot name' when needs_update==true, but OTOH is always checking the 'enabled' state. ~ 1b. Param 'needs_update' is a vague

Re: Expand applicability of aggregate's sortop optimization

2024-07-16 Thread Andrei Lepikhov
On 5/8/24 17:13, Matthias van de Meent wrote: As you may know, aggregates like SELECT MIN(unique1) FROM tenk1; are rewritten as SELECT unique1 FROM tenk1 ORDER BY unique1 USING < LIMIT 1; by using the optional sortop field in the aggregator. However, this optimization is disabled for clauses that

Re: improve performance of pg_dump with many sequences

2024-07-16 Thread Nathan Bossart
On Wed, Jul 17, 2024 at 11:30:04AM +0900, Michael Paquier wrote: > Yeah, I have bumped on the same issue. In the long term, I also think > that we'd better have pg_sequence_last_value() return a row with > is_called and the value scanned. As you say, it won't help except > when upgrading from ver

Re: Remove dependence on integer wrapping

2024-07-16 Thread Nathan Bossart
On Tue, Jul 16, 2024 at 09:23:27PM -0400, Joseph Koshakow wrote: > On Tue, Jul 16, 2024 at 1:57 PM Nathan Bossart > wrote: >> The reason I suggested this is so that we could omit all the prerequisite >> isinf(), isnan(), etc. checks in the cash_mul_float8() and friends. The >> checks are slighly

Re: Flush pgstats file during checkpoints

2024-07-16 Thread Michael Paquier
On Fri, Jul 12, 2024 at 12:10:26PM +, Bertrand Drouvot wrote: > Looking at 0001: > > + /* error logged already */ > > Maybe mention it's already logged by durable_rename() (like it's done in > InstallXLogFileSegment(), BaseBackup() for example). > > Except this nit, 0001 LGTM.

Re: temp table on commit delete rows performance issue

2024-07-16 Thread feichanghong
Hi Floris, > On Jul 16, 2024, at 19:47, Floris Van Nee wrote: > > Hi hackers, > > I'm looking for some input on an issue I've observed. A common pattern > I've seen is using temporary tables to put data in before updating the > real tables. Something roughly like: > > On session start: > CREAT

Re: improve performance of pg_dump with many sequences

2024-07-16 Thread Michael Paquier
On Tue, Jul 16, 2024 at 04:36:15PM -0500, Nathan Bossart wrote: > Unfortunately, I've also discovered a problem with 0003. > pg_sequence_last_value() returns NULL when is_called is false, in which > case we assume last_value == seqstart, which is, sadly, bogus due to > commands like ALTER SEQUENCE

Re: Injection points: preloading and runtime arguments

2024-07-16 Thread Michael Paquier
On Tue, Jul 16, 2024 at 11:20:57AM +0300, Heikki Linnakangas wrote: > The "direct" argument to InjectionPointCacheRefresh() feels a bit weird. > Also weird that it still checks ActiveInjectionPoints->max_inuse, even > though it otherwise operates on the cached version only. I think you can > just c

Re: Possible incorrect row estimation for Gather paths

2024-07-16 Thread Richard Guo
I can reproduce this problem with the query below. explain (costs on) select * from tenk1 order by twenty; QUERY PLAN - Gather Merge (cost=772.11..830.93 rows=5882 width=244) Wor

Re: Remove dependence on integer wrapping

2024-07-16 Thread Joseph Koshakow
On Tue, Jul 16, 2024 at 1:57 PM Nathan Bossart wrote: >> >>On Mon, Jul 15, 2024 at 07:55:22PM -0400, Joseph Koshakow wrote: >> On Mon, Jul 15, 2024 at 11:31 AM Nathan Bossart >> wrote: >>>I'm curious why you aren't using float8_mul/float8_div here, i.e., >>> >>>fresult = rint(

RE: Slow catchup of 2PC (twophase) transactions on replica in LR

2024-07-16 Thread Zhijie Hou (Fujitsu)
On Tuesday, July 16, 2024 1:17 PM Kuroda, Hayato/黒田 隼人 wrote > > Dear Amit, Hou, > > Thanks for giving comments! PSA new versions. > What's new: > > 0001: included Hou's patch [1] not to overwrite slot options. > Some other comments were also addressed. Thanks for the patch! One more i

Re: Wrong results with grouping sets

2024-07-16 Thread Paul George
Thanks for the work! > Since a subquery is a volatile expression, each of its instances should be evaluated separately. This seems like a valid point, though "query 2" below which groups over a RANDOM() column and outputs an additional RANDOM() column a potential, albeit contrived, counter-exampl

Re: Removing unneeded self joins

2024-07-16 Thread Alexander Korotkov
Hi, Tom! I'd like to give you and update on the progress with SJE. On Mon, May 6, 2024 at 6:54 PM Tom Lane wrote: > Robert Haas writes: > > I want to go on record right now as disagreeing with the plan proposed > > in the commit message for the revert commit, namely, committing this > > again e

Re: [EXTERNAL] Re: Add non-blocking version of PQcancel

2024-07-16 Thread Thomas Munro
On Wed, Jul 17, 2024 at 3:08 AM Alvaro Herrera wrote: > Ugh. I tried to follow what's going on in that cygwin code, but I gave > up pretty quickly. It depends on a mutex, but I didn't see the mutex > being defined or initialized anywhere. https://github.com/cygwin/cygwin/blob/cygwin-3.5.3/winsu

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

2024-07-16 Thread Alexander Korotkov
Hi, Alena! On Thu, Jul 11, 2024 at 7:17 PM Alena Rybakina wrote: > I have finished patch and processed almost your suggestions (from [0], [1], > [2]). It remains only to add tests where the conversion should work, but I > will add this in the next version. > > [0] https://www.postgresql.org/mes

Re: recovery test error

2024-07-16 Thread Michael Paquier
On Tue, Jul 16, 2024 at 03:04:13PM -0400, Andrew Dunstan wrote: > This was called by poll_query_until(), which is changed by the patch to use > a libpq session rather than constantly forking psql. ISTM we should be > passing true as a second parameter so we keep going if the file doesn't > exist. >

Re: Windows perl/tcl requirement documentation

2024-07-16 Thread Michael Paquier
On Mon, Jul 01, 2024 at 11:27:26AM -0400, Andrew Dunstan wrote: > Our docs currently state this regarding the perl requirement for building on > Windows: > > > ActiveState Perl > >ActiveState Perl is required to run the build generation scripts. >MinGW or Cygwin Perl will not work. It mu

Re: RFC: pg_stat_logmsg

2024-07-16 Thread Michael Paquier
On Wed, Jul 17, 2024 at 12:14:36AM +0200, Tomas Vondra wrote: > I noticed this patch hasn't moved since September 2023, so I wonder > what's the main blocker / what is needed to move this? + /* Location of permanent stats file (valid when database is shut down) */ + #define PGLM_DUMP_FILEP

Re: RFC: pg_stat_logmsg

2024-07-16 Thread Tomas Vondra
Hi, I noticed this patch hasn't moved since September 2023, so I wonder what's the main blocker / what is needed to move this? As for the feature, I've never done a fleet-wide analysis, so if this is one of the main use cases, I'm not really sure I can judge if this is a good tool for that. It se

Re: PG_TEST_EXTRA and meson

2024-07-16 Thread Nazir Bilal Yavuz
Hi, On Wed, 17 Jul 2024 at 00:27, Jacob Champion wrote: > > On Tue, Jul 16, 2024 at 2:12 PM Nazir Bilal Yavuz wrote: > > > > 2- If PG_TEST_EXTRA is set from the setup command, use it from the > > setup command and discard the environment variable. If PG_TEST_EXTRA > > is not set from the setup c

Re: [PATCH] Refactor pqformat.{c,h} and protocol.h

2024-07-16 Thread Nathan Bossart
On Tue, Jul 16, 2024 at 10:58:37PM +0300, Aleksander Alekseev wrote: >> Thanks. The only thing that stands out to me is the name of the parallel >> leader/worker protocol message. In the original thread for protocol >> characters, some early versions of the patch called it a "parallel >> progress

Re: improve performance of pg_dump with many sequences

2024-07-16 Thread Nathan Bossart
On Thu, Jul 11, 2024 at 09:09:17PM -0500, Nathan Bossart wrote: > On second thought, maybe we should just limit this improvement to the minor > releases with the fix so that we _can_ get rid of the workaround. Or we > could use the hacky workaround only for versions with the bug. Here is a new ve

Re: PG_TEST_EXTRA and meson

2024-07-16 Thread Jacob Champion
On Tue, Jul 16, 2024 at 2:12 PM Nazir Bilal Yavuz wrote: > > 2- If PG_TEST_EXTRA is set from the setup command, use it from the > setup command and discard the environment variable. If PG_TEST_EXTRA > is not set from the setup command, then use it from the environment. Is there a way for the envi

Re: PG_TEST_EXTRA and meson

2024-07-16 Thread Nazir Bilal Yavuz
Hi, On Thu, 11 Jul 2024 at 09:30, Ashutosh Bapat wrote: > > In order to run these tests, we have to run meson setup again. There > are couple of problems with this > 1. It's not clear why the tests were skipped. Also not clear that we > have to run meson setup again - from the output alone > 2. R

Re: walsender.c fileheader comment

2024-07-16 Thread Tomas Vondra
On 6/11/24 04:35, Peter Smith wrote: > Hi, > > I was reading the walsender.c fileheader comment while studying > another thread. I think if there is logical replication in progress > then the PROCSIG_WALSND_INIT_STOPPING handler will *always* switch to > a "stopping" state: e.g., > > /* > * H

Re: Meson far from ready on Windows

2024-07-16 Thread Tristan Partin
From 9f7c96dfab4d807e668c9d32b44db5f4ff122e15 Mon Sep 17 00:00:00 2001 From: Andres Freund Date: Mon, 8 Jul 2024 15:55:56 -0700 Subject: [PATCH v2 02/10] Don't define HAVE_[GSSAPI_]GSSAPI_EXT_H The check for gssapi_ext.h was added in f7431bca8b0. As we require gssapi_ext.h to be present, there's

Re: [18] Policy on IMMUTABLE functions and Unicode updates

2024-07-16 Thread Jeff Davis
On Tue, 2024-07-16 at 13:27 -0700, David G. Johnston wrote: > I'd teach pg_upgrade to inspect the post-upgraded catalog of is-use > dependencies and report on any of these it finds and remind the DBA > that this latent issue may exist in their system. That's impossible to do in a complete way, and

Re: [18] Policy on IMMUTABLE functions and Unicode updates

2024-07-16 Thread Jeremy Schneider
On Tue, Jul 16, 2024 at 3:28 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > > I'd teach pg_upgrade to inspect the post-upgraded catalog of in-use > dependencies and report on any of these it finds and remind the DBA that > this latent issue may exist in their system. > Would this hel

Re: [18] Policy on IMMUTABLE functions and Unicode updates

2024-07-16 Thread David G. Johnston
On Tue, Jul 16, 2024 at 1:16 PM Tom Lane wrote: > Joe Conway writes: > > So you are proposing we add STATIC to VOLATILE/STABLE/IMMUTABLE (in the > > third position before IMMUTABLE), give it IMMUTABLE semantics, mark > > builtin functions that deserve it, and document with suitable caution > > s

Re: [18] Policy on IMMUTABLE functions and Unicode updates

2024-07-16 Thread Tom Lane
Joe Conway writes: > Fair enough, but then I think we should change the documentation to not > say "forever". No objection to that, it's clearly a misleading definition. regards, tom lane

Re: Converting tab-complete.c's else-if chain to a switch

2024-07-16 Thread Tom Lane
I wrote: > Andres Freund writes: >> Hm, the fact that we are continuing to use the same macros in the switch >> makes >> it a bit painful to edit the .in.c in an editor with compiler-warnings >> integration - I see a lot of reported errors ("Expression is not an integer >> constant expression") d

Re: [18] Policy on IMMUTABLE functions and Unicode updates

2024-07-16 Thread Joe Conway
On 7/16/24 16:16, Tom Lane wrote: Joe Conway writes: So you are proposing we add STATIC to VOLATILE/STABLE/IMMUTABLE (in the third position before IMMUTABLE), give it IMMUTABLE semantics, mark builtin functions that deserve it, and document with suitable caution statements? What is the poin

Re: [18] Policy on IMMUTABLE functions and Unicode updates

2024-07-16 Thread Tom Lane
Joe Conway writes: > So you are proposing we add STATIC to VOLATILE/STABLE/IMMUTABLE (in the > third position before IMMUTABLE), give it IMMUTABLE semantics, mark > builtin functions that deserve it, and document with suitable caution > statements? What is the point of that, exactly? I'll agr

Re: [18] Policy on IMMUTABLE functions and Unicode updates

2024-07-16 Thread Joe Conway
On 7/16/24 15:33, David G. Johnston wrote: On Tue, Jul 16, 2024 at 11:57 AM Joe Conway > wrote: > There are two alternative philosophies: > > A. By choosing to use a Unicode-based function, the user has opted in > to the Unicode stability guarantee

Re: [PATCH] Refactor pqformat.{c,h} and protocol.h

2024-07-16 Thread Aleksander Alekseev
Hi, > Thanks. The only thing that stands out to me is the name of the parallel > leader/worker protocol message. In the original thread for protocol > characters, some early versions of the patch called it a "parallel > progress" message, but this new one just calls it PqMsg_Progress. I guess >

Re: [PATCH] Refactor pqformat.{c,h} and protocol.h

2024-07-16 Thread Nathan Bossart
On Tue, Jul 16, 2024 at 09:14:35PM +0300, Aleksander Alekseev wrote: >> As discussed elsewhere [0], we can add the leader/worker protocol >> characters to protocol.h, but they should probably go in a separate >> section. I'd recommend breaking that part out to a separate patch, too. > > OK, here

Re: [18] Policy on IMMUTABLE functions and Unicode updates

2024-07-16 Thread David G. Johnston
On Tue, Jul 16, 2024 at 11:57 AM Joe Conway wrote: > > > There are two alternative philosophies: > > > > A. By choosing to use a Unicode-based function, the user has opted in > > to the Unicode stability guarantees[2], and it's fine to update Unicode > > occasionally in new major versions as long

recovery test error

2024-07-16 Thread Andrew Dunstan
As I was trying out the libpq perl wrapper on Windows, I encountered a failure in recovery test 002_archiving.pl from this query: SELECT size IS NOT NULL FROM pg_stat_file('c:/prog/postgresql/build/testrun/recovery/002_archiving/data/t_002_archiving_primary_data/archives/0002.history')

Re: [18] Policy on IMMUTABLE functions and Unicode updates

2024-07-16 Thread Joe Conway
On 7/16/24 13:42, Jeff Davis wrote: The IMMUTABLE marker for functions is quite simple on the surface, but could be interpreted a few different ways, and there's some historical baggage that makes it complicated. There are a number of ways in which IMMUTABLE functions can change behavior: 1. Up

Re: [PATCH] Refactor pqformat.{c,h} and protocol.h

2024-07-16 Thread Aleksander Alekseev
Hi, > As discussed elsewhere [0], we can add the leader/worker protocol > characters to protocol.h, but they should probably go in a separate > section. I'd recommend breaking that part out to a separate patch, too. OK, here is the updated patchset. This time I chose not to include this patch:

Re: Remove dependence on integer wrapping

2024-07-16 Thread Nathan Bossart
On Mon, Jul 15, 2024 at 07:55:22PM -0400, Joseph Koshakow wrote: > On Mon, Jul 15, 2024 at 11:31 AM Nathan Bossart > wrote: >>I'm curious why you aren't using float8_mul/float8_div here, i.e., >> >>fresult = rint(float8_mul((float8) c, f)); >>fresult = rint(float8_div((

Re: Differents execution times with gin index, prepared statement and literals.

2024-07-16 Thread Tomas Vondra
On 7/16/24 17:43, Pierrick Chovelon wrote: > ... > > Quite fast as well... > > Have you got an idea on the initial issue ? Why when using a prepared > statement and a gin index the execution time "explode" ? > Something to do with the planner ? optimizer ? > > (We executed the same test with a bt

Re: [Proposal] Add foreign-server health checks infrastructure

2024-07-16 Thread Fujii Masao
On 2023/12/12 11:43, Hayato Kuroda (Fujitsu) wrote: Dear Shubham, I am failing to apply the latest Patch-"v39-0001-postgres_fdw-add-postgres_fdw_verify_connection-.patch" for review. Please find the error I am facing: D:\Project\Postgres>git am D:\Project\Patch\v39-0001-postgres_fdw-add-p

[18] Policy on IMMUTABLE functions and Unicode updates

2024-07-16 Thread Jeff Davis
The IMMUTABLE marker for functions is quite simple on the surface, but could be interpreted a few different ways, and there's some historical baggage that makes it complicated. There are a number of ways in which IMMUTABLE functions can change behavior: 1. Updating or moving to a different OS aff

Re: Restrict EXPLAIN (ANALYZE) for RLS and security_barrier views

2024-07-16 Thread Dean Rasheed
On Mon, 6 May 2024 at 15:46, Laurenz Albe wrote: > > Currently, it is pretty easy to subvert the restrictions imposed > by row-level security and security_barrier views. All you have to > to is use EXPLAIN (ANALYZE) and see how many rows were filtered > out by the RLS policy or the view condition

Re: [PATCH] Refactor pqformat.{c,h} and protocol.h

2024-07-16 Thread Nathan Bossart
I took a closer look at 0001. diff --git a/src/include/libpq/protocol.h b/src/include/libpq/protocol.h index 4b8d440365..8c0f095edf 100644 --- a/src/include/libpq/protocol.h +++ b/src/include/libpq/protocol.h @@ -47,6 +47,7 @@ #define PqMsg_EmptyQueryResponse 'I' #define PqMsg_BackendKeyDa

Re: [PATCH] Refactor pqformat.{c,h} and protocol.h

2024-07-16 Thread Aleksander Alekseev
Hi, > > This was briefly brought up in the discussion that ultimately led to > > protocol.h [0]. I don't have a particularly strong opinion on the matter, > > but I will note that protocol.h was intended to be easily usable in > > third-party code, and changing it from characters to an enum from

Re: Add a GUC check hook to ensure summarize_wal cannot be enabled when wal_level is minimal

2024-07-16 Thread Fujii Masao
On 2024/07/17 1:30, Nathan Bossart wrote: On Tue, Jul 16, 2024 at 12:23:19PM -0400, Robert Haas wrote: TBH, I don't want to do that. I think it's too fragile. It's the sort of thing that just barely works given the exact behavior of these particular GUCs, but it relies on a bunch of subtle as

Re: Things I don't like about \du's "Attributes" column

2024-07-16 Thread David G. Johnston
On Tue, Jul 16, 2024 at 8:00 AM Robert Haas wrote: > I'm starting to have some doubts about whether this effort is really > worthwhile. It seems like what we have right now is a patch which uses > both more horizontal space and more vertical space than the current > implementation, without (IMHO)

Re: [PATCH] Refactor pqformat.{c,h} and protocol.h

2024-07-16 Thread Tom Lane
Nathan Bossart writes: > This was briefly brought up in the discussion that ultimately led to > protocol.h [0]. I don't have a particularly strong opinion on the matter, > but I will note that protocol.h was intended to be easily usable in > third-party code, and changing it from characters to an

Re: Add a GUC check hook to ensure summarize_wal cannot be enabled when wal_level is minimal

2024-07-16 Thread Nathan Bossart
On Tue, Jul 16, 2024 at 12:23:19PM -0400, Robert Haas wrote: > TBH, I don't want to do that. I think it's too fragile. It's the sort > of thing that just barely works given the exact behavior of these > particular GUCs, but it relies on a bunch of subtle assumptions which > won't be evident to futu

Re: Add a GUC check hook to ensure summarize_wal cannot be enabled when wal_level is minimal

2024-07-16 Thread Robert Haas
On Mon, Jul 15, 2024 at 4:10 PM Nathan Bossart wrote: > You don't, but the GUC check hook should always return true when > summarize_wal is processed first. We'd rely on the PostmasterMain() check > to fail in that case. OK, I see. So at startup time, the check hook might or might not catch a co

Re: CI, macports, darwin version problems

2024-07-16 Thread Joe Conway
On 7/16/24 11:44, Andres Freund wrote: hi, On 2024-07-16 09:38:21 -0400, Joe Conway wrote: On 7/16/24 08:28, Joe Conway wrote: > On 7/16/24 00:34, Thomas Munro wrote: > > temporarily disabled that machine from the pool and click the re-run > > button, and it failed[2] on jc-m2-1: "Error: The op

Re: Addressing SECURITY DEFINER Function Vulnerabilities in PostgreSQL Extensions

2024-07-16 Thread Robert Haas
On Tue, Jul 16, 2024 at 1:55 AM Ashutosh Sharma wrote: > Just to confirm, are you suggesting to remove the protected flag and > set the default search_path (as $extension_schema,) for all functions > within an extension where no explicit search_path is set? No, I'm not saying that. In fact I'm no

Re: Parent/child context relation in pg_get_backend_memory_contexts()

2024-07-16 Thread Robert Haas
On Mon, Jul 15, 2024 at 8:22 PM David Rowley wrote: > > That said, if you want to go with the integer > > IDs and want to spend more time massaging it, I also think that's > > fine. I simply don't believe it's the only way forward here. YMMV, but > > my opinion is that none of these approaches hav

Re: CI, macports, darwin version problems

2024-07-16 Thread Andres Freund
hi, On 2024-07-16 09:38:21 -0400, Joe Conway wrote: > On 7/16/24 08:28, Joe Conway wrote: > > On 7/16/24 00:34, Thomas Munro wrote: > > > temporarily disabled that machine from the pool and click the re-run > > > button, and it failed[2] on jc-m2-1: "Error: The operation couldn’t be > > > complete

Differents execution times with gin index, prepared statement and literals.

2024-07-16 Thread Pierrick Chovelon
Hello, One of our customer is facing an issue regarding a prepared statement and a gin index. An important gap between execution times can be shown when using execute or plain literals. Here is the test that shown this issue : Init table : create table tmp_tk_test_index (     sync_id   

Re: [PATCH] Refactor pqformat.{c,h} and protocol.h

2024-07-16 Thread Nathan Bossart
On Tue, Jul 16, 2024 at 04:09:44PM +0300, Aleksander Alekseev wrote: > - Patch 1 replaces all the char's with PqMsg's Thanks. I'll look into committing this one in the near future. > - Patch 2 makes PqMsg an enum. This ensures that the problem will not > appear again in the future and also gives

Re: [EXTERNAL] Re: Add non-blocking version of PQcancel

2024-07-16 Thread Alvaro Herrera
On 2024-Jul-16, Alvaro Herrera wrote: > Maybe we can disable this test specifically on Cygwin. We could do that > by creating a postgres_fdw_cancel.sql file, with the current output for > all platforms, and a "SELECT version() ~ 'cygwin' AS skip_test" query, > as we do for encoding tests and such

Re: [EXTERNAL] Re: Add non-blocking version of PQcancel

2024-07-16 Thread Alvaro Herrera
On 2024-Jul-16, Alexander Lakhin wrote: > I've managed to reproduce this issue in my Cygwin environment by running > the postgres_fdw test in a loop (10 iterations are enough to get the > described effect). And what I'm seeing is that a query-cancelling backend > is stuck inside pgfdw_xact_callbac

Re: Things I don't like about \du's "Attributes" column

2024-07-16 Thread Robert Haas
On Tue, Jul 16, 2024 at 9:48 AM Pavel Luzanov wrote: > Which version of the patch is currently under discussion? > > I believe we are talking about the latest v8 patch version. [1] > > 1. > https://www.postgresql.org/message-id/5341835b-e7be-44dc-b6e5-400e9e3f3c64%40postgrespro.ru Thanks. For so

Re: Removing unneeded self joins

2024-07-16 Thread Alexander Korotkov
Hi, Vardan! Great, thank you! On Tue, Jul 16, 2024 at 5:26 PM Вардан Погосян wrote: > I did the SJE testing at Andrey's request. > To do this, I used the automatic testing tool EET (Equivalent Expression > Transformation) [1] with some modifications. > EET transforms the logical conditions in a

Re: Using LibPq in TAP tests via FFI

2024-07-16 Thread Andrew Dunstan
On 2024-06-17 Mo 10:01 AM, Andrew Dunstan wrote: I agree with you that falling back on BackgroundPsql is not a terribly satisfactory solution. I'm somewhat doubtful we'll just agree on making FFI::Platypus a hard dependency, but if we agree to do so... Maybe not. If so your other sugges

Re: Removing unneeded self joins

2024-07-16 Thread Вардан Погосян
Hi! I did the SJE testing at Andrey's request.To do this, I used the automatic testing tool EET (Equivalent _expression_ Transformation) [1] with some modifications. EET transforms the logical conditions in a query, creating multiple queries waiting for the same number of rows. In order to make sur

Re: [PATCH] Refactor pqformat.{c,h} and protocol.h

2024-07-16 Thread Aleksander Alekseev
Hi, > The proposed patchset fixes this. In v1 I mistakenly named the enum PgMsg while it should have been PqMsg. Here is the corrected patchset. -- Best regards, Aleksander Alekseev v2-0002-Introduce-PqMsg-enum.patch Description: Binary data v2-0001-Always-pass-PqMsg_-to-pq_beginmessage-_re

Re: Compress ReorderBuffer spill files using LZ4

2024-07-16 Thread Tomas Vondra
On 7/16/24 14:52, Amit Kapila wrote: > On Tue, Jul 16, 2024 at 12:58 AM Tomas Vondra > wrote: >> >> On 7/15/24 20:50, Julien Tachoires wrote: >>> Hi, >>> >>> Le ven. 7 juin 2024 à 06:18, Julien Tachoires a écrit : Le ven. 7 juin 2024 à 05:59, Tomas Vondra a écrit : > >

Re: Things I don't like about \du's "Attributes" column

2024-07-16 Thread Pavel Luzanov
On 16.07.2024 16:24, Robert Haas wrote: Which version of the patch is currently under discussion? I believe we are talking about the latest v8 patch version. [1] 1.https://www.postgresql.org/message-id/5341835b-e7be-44dc-b6e5-400e9e3f3c64%40postgrespro.ru -- Pavel Luzanov Postgres Professiona

Re: CI, macports, darwin version problems

2024-07-16 Thread Joe Conway
On 7/16/24 08:28, Joe Conway wrote: On 7/16/24 00:34, Thomas Munro wrote: temporarily disabled that machine from the pool and click the re-run button, and it failed[2] on jc-m2-1: "Error: The operation couldn’t be completed. No space left on device" after a long period during which it was presum

RE: temp table on commit delete rows performance issue

2024-07-16 Thread Floris Van Nee
> > I didn't investigate your particular issue but generally speaking creating a > table, even a temporary one, is an expensive operation. > > Note that it's far from being a seperate file on the disk. It affects catalog > tables, shared buffers, all the corresponding locks, etc. If you have ind

Re: Things I don't like about \du's "Attributes" column

2024-07-16 Thread Robert Haas
On Tue, Jul 16, 2024 at 4:53 AM Pavel Luzanov wrote: > On 15.07.2024 12:50, Rafia Sabih wrote: > Well, it was just my opinion of how I would have liked it better, but > of course you may decide against it, there is no strong feeling around > it. > And if you are on the fence with the opinion of ha

Re: long-standing data loss bug in initial sync of logical replication

2024-07-16 Thread vignesh C
On Tue, 16 Jul 2024 at 11:59, Amit Kapila wrote: > > On Tue, Jul 16, 2024 at 9:29 AM Amit Kapila wrote: > > > > One related comment: > > @@ -1219,8 +1219,14 @@ AlterPublicationTables(AlterPublicationStmt > > *stmt, HeapTuple tup, > > oldrel = palloc(sizeof(PublicationRelInfo)); > > oldrel->wh

Re: temp table on commit delete rows performance issue

2024-07-16 Thread Aleksander Alekseev
Hi, > I'm looking for some input on an issue I've observed. A common pattern > I've seen is using temporary tables to put data in before updating the > real tables. Something roughly like: > > On session start: > CREATE TEMP TABLE temp_t1 (...) ON COMMIT DELETE ROWS; > > On update: > BEGIN; > COPY

[PATCH] Refactor pqformat.{c,h} and protocol.h

2024-07-16 Thread Aleksander Alekseev
Hi, While investigating a bug report [1] I wanted to find all the pieces of code that form PqMsg_DataRow messages and couldn't easily do it. This is because one authors prefer writing: pq_beginmessage(buf, 'D'); .. while others: pq_beginmessage(buf, PqMsg_DataRow); The proposed patchset fixes

Re: Compress ReorderBuffer spill files using LZ4

2024-07-16 Thread Amit Kapila
On Tue, Jul 16, 2024 at 12:58 AM Tomas Vondra wrote: > > On 7/15/24 20:50, Julien Tachoires wrote: > > Hi, > > > > Le ven. 7 juin 2024 à 06:18, Julien Tachoires a écrit : > >> > >> Le ven. 7 juin 2024 à 05:59, Tomas Vondra > >> a écrit : > >>> > >>> On 6/6/24 12:58, Julien Tachoires wrote: > >>>

Re: Why is 'use_alias' hardcoded to true in deparseFromExprForRel() for some cases

2024-07-16 Thread Tom Lane
Rajan Pandey writes: > This seems like an extra-protection in case of joins. But it could happen > that the join is across 2 different foreign postgres-servers (means each > foreign server will do SCAN only, and the JOIN will happen at the upper > layer). In that case, using aliases in the remote

Re: CI, macports, darwin version problems

2024-07-16 Thread Joe Conway
On 7/16/24 00:34, Thomas Munro wrote: temporarily disabled that machine from the pool and click the re-run button, and it failed[2] on jc-m2-1: "Error: The operation couldn’t be completed. No space left on device" after a long period during which it was presumably trying to download that image.

Re: ActiveState Perl is not valid anymore to build PG17 on the Windows 10/11 platforms, So Documentation still suggesting it should be updated

2024-07-16 Thread Andrew Dunstan
On 2024-07-16 Tu 7:46 AM, Yasir wrote: Hi Hackers, Recently, I compiled PG17 on the windows. Till PG16 "ActiveState Perl", as instructed in the documentation , was being used successfully on the W

Re: Use read streams in CREATE DATABASE command when the strategy is wal_log

2024-07-16 Thread Noah Misch
On Tue, Jul 16, 2024 at 02:11:20PM +0300, Nazir Bilal Yavuz wrote: > On Fri, 12 Jul 2024 at 02:52, Noah Misch wrote: > > On Tue, Apr 16, 2024 at 02:12:19PM +0300, Nazir Bilal Yavuz wrote: > > > --- a/src/backend/storage/aio/read_stream.c > > > +++ b/src/backend/storage/aio/read_stream.c > > > @@ -

Re: pg_ctl start may return 0 even if the postmaster has been already started on Windows

2024-07-16 Thread Yasir
On Tue, Jul 16, 2024 at 4:58 PM Yasir Shah wrote: > The following review has been posted through the commitfest application: > make installcheck-world: tested, failed (meson test, passed) > Implements feature: tested, failed(tested, passed) > Spec compliant: n

Re: pg_ctl start may return 0 even if the postmaster has been already started on Windows

2024-07-16 Thread Yasir Shah
The following review has been posted through the commitfest application: make installcheck-world: tested, failed Implements feature: tested, failed Spec compliant: not tested Documentation:not tested Hi, I have verified following: - Bug exits in PG17. I also checke

temp table on commit delete rows performance issue

2024-07-16 Thread Floris Van Nee
Hi hackers, I'm looking for some input on an issue I've observed. A common pattern I've seen is using temporary tables to put data in before updating the real tables. Something roughly like: On session start: CREATE TEMP TABLE temp_t1 (...) ON COMMIT DELETE ROWS; On update: BEGIN; COPY temp_t1 F

ActiveState Perl is not valid anymore to build PG17 on the Windows 10/11 platforms, So Documentation still suggesting it should be updated

2024-07-16 Thread Yasir
Hi Hackers, Recently, I compiled PG17 on the windows. Till PG16 "ActiveState Perl", as instructed in the documentation , was being used successfully on the Windows 10/11 to compile PG. However, it looks

Re: Pgoutput not capturing the generated columns

2024-07-16 Thread Shubham Khanna
On Mon, Jul 15, 2024 at 11:09 AM Peter Smith wrote: > > Hi, I had a quick look at the patch v17-0004 which is the split-off > new BMS logic. > > IIUC this 0004 is currently undergoing some refactoring and > cleaning-up, so I won't comment much about it except to give the > following observation be

Re: Use read streams in CREATE DATABASE command when the strategy is wal_log

2024-07-16 Thread Nazir Bilal Yavuz
Hi, Thank you for the review! On Fri, 12 Jul 2024 at 02:52, Noah Misch wrote: > > On Tue, Apr 16, 2024 at 02:12:19PM +0300, Nazir Bilal Yavuz wrote: > > I am working on using read streams in the CREATE DATABASE command when the > > strategy is wal_log. RelationCopyStorageUsingBuffer() function i

Re: [EXTERNAL] Re: Add non-blocking version of PQcancel

2024-07-16 Thread Alexander Lakhin
Hello, 25.06.2024 11:24, Jelte Fennema-Nio wrote: My expectation is that that should remove all failure cases. If it doesn't, I think our best bet is removing the test again. It looks like that test eventually showed what could be called a virtue. Please take a look at a recent BF failure [1]:

Why is 'use_alias' hardcoded to true in deparseFromExprForRel() for some cases

2024-07-16 Thread Rajan Pandey
Hi everyone, In the postgrs_fdw deparser code, deparseFromExprForRel() appends an alias to the remote query based on the 'use_alias' boolean flag. For a simple query, 'use_alias' is determined by `bms_membership(scanrel->relids) == BMS_MULTIPLE` condition. Example: https://github.com/postgres/post

Re: errors building on windows using meson

2024-07-16 Thread Yasir
On Tue, May 28, 2024 at 8:50 PM Imran Zaheer wrote: > Hi > > I was facing the same error when using active state perl for compiling > postgres with meson on windows. I used active state perl because it was > working fine for pg compilations until pg-16. > > Using choco strawberry perl solved my p

Re: Slow catchup of 2PC (twophase) transactions on replica in LR

2024-07-16 Thread Peter Smith
Hi, here are some review comments for patch v18-0001. == doc/src/sgml/protocol.sgml nitpick - Although it is no fault of your patch, IMO it would be nicer for the TWO_PHASE description (of CREATE REPLICATION SLOT) to also be in the same consistent order as what you have (e.g. below FAILOVER).

Re: Wrong results with grouping sets

2024-07-16 Thread Ashutosh Bapat
On Mon, Jul 15, 2024 at 8:15 AM Richard Guo wrote: > > We can see that with the 0001 patch, this query runs ~3 times faster, > which is no surprise because there are 3 instances of the same > subquery in the targetlist. I am not sure if that's the right thing to do. I am using a slightly elabo

Re: Pgoutput not capturing the generated columns

2024-07-16 Thread Shlok Kyal
On Mon, 15 Jul 2024 at 08:08, Peter Smith wrote: > > Hi, here are some review comments about patch v17-0003 I have addressed the comments in v18-0003 patch [1]. [1]: https://www.postgresql.org/message-id/CANhcyEW3LVJpRPScz6VBa%3DZipEMV7b-u76PDEALNcNDFURCYMA%40mail.gmail.com Thanks and Regards,

Re: Pgoutput not capturing the generated columns

2024-07-16 Thread Shlok Kyal
On Tue, 9 Jul 2024 at 09:53, Peter Smith wrote: > > Hi Shlok, here are my review comments for v16-0003. > > == > src/backend/replication/logical/proto.c > > > On Mon, Jul 8, 2024 at 10:04 PM Shlok Kyal wrote: > > > > On Mon, 8 Jul 2024 at 13:20, Peter Smith wrote: > > > > > > > > > 2. logica

Re: Things I don't like about \du's "Attributes" column

2024-07-16 Thread Pavel Luzanov
On 15.07.2024 12:50, Rafia Sabih wrote: Well, it was just my opinion of how I would have liked it better, but of course you may decide against it, there is no strong feeling around it. And if you are on the fence with the opinion of having them in normal or extended mode, then maybe we can ask mo

  1   2   >