Re: False "pg_serial": apparent wraparound” in logs

2023-08-24 Thread Imseih (AWS), Sami
Attached a patch with a new CF entry: https://commitfest.postgresql.org/44/4516/ Regards, Sami Imseih Amazon Web Services (AWS) 0001-v1-Fix-false-report-of-wraparound-in-pg_serial.patch Description: 0001-v1-Fix-false-report-of-wraparound-in-pg_serial.patch

Re: initdb caching during tests

2023-08-24 Thread Thomas Munro
On Fri, Aug 25, 2023 at 10:10 AM Andres Freund wrote: > Let's see what the buildfarm says - it's not inconceivable that it'll show > some issues. Apparently Solaris doesn't like "cp -a", per animal "margay". I think "cp -RPp" should be enough everywhere?

Re: Synchronizing slots from primary to standby

2023-08-24 Thread shveta malik
On Wed, Aug 23, 2023 at 4:21 PM Dilip Kumar wrote: > > On Wed, Aug 23, 2023 at 3:38 PM shveta malik wrote: > > > I have reviewed the v12-0002 patch and I have some comments. I see the > latest version posted sometime back and if any of this comment is > already fixed in this version then feel

Re: New WAL record to detect the checkpoint redo location

2023-08-24 Thread Dilip Kumar
On Fri, Aug 18, 2023 at 10:12 AM Dilip Kumar wrote: > > On Fri, Aug 18, 2023 at 5:24 AM Michael Paquier wrote: > > > > On Thu, Aug 17, 2023 at 01:11:50PM +0530, Dilip Kumar wrote: > > > Yeah right, actually I was confused, I assumed it will return the > > > start LSN of the record. And I do not

Re: broken master regress tests

2023-08-24 Thread Thomas Munro
On Fri, Aug 25, 2023 at 3:54 PM Pavel Stehule wrote: > today build is broken on my Fedora 39 Has commit 252dcb32 somehow upset some kind of bleeding edge btrfs filesystem? That's a wild guess and I can't really imagine how but apparently your database files are totally messed up...

Compiler warning on Debian 12, PostgreSQL 16 Beta3

2023-08-24 Thread Daniel Westermann (DWE)
Hi, I've just noticed this warning when building on Debian 12: In file included from /usr/lib/llvm-14/include/llvm/Analysis/ModuleSummaryAnalysis.h:17, from llvmjit_inline.cpp:51: /usr/lib/llvm-14/include/llvm/IR/ModuleSummaryIndex.h: In constructor

Re: list of acknowledgments for PG16

2023-08-24 Thread jian he
On Tue, Aug 22, 2023 at 9:41 PM Vik Fearing wrote: > > > I am struggling to find documentation on how to build the pdfs with > meson. Any pointers? > -- > Vik Fearing > > > ninja docs: https://wiki.postgresql.org/wiki/Meson#Meson_documentation ninja alldocs. which take some time, build all

Re: logical_replication_mode

2023-08-24 Thread Amit Kapila
On Thu, Aug 24, 2023 at 12:45 PM Peter Eisentraut wrote: > > I suggest we rename this setting to something starting with debug_. > Right now, the name looks much too tempting for users to fiddle with. I > think this is similar to force_parallel_mode. > +1. How about debug_logical_replication?

Re: psql --no-connect option

2023-08-24 Thread Pavel Stehule
pá 25. 8. 2023 v 6:21 odesílatel Julien Rouhaud napsal: > Hi, > > On Thu, Aug 24, 2023 at 12:55:30PM -0700, Gurjeet Singh wrote: > > Currently, psql exits if a database connection is not established when > > psql is launched. > > > > Sometimes it may be useful to launch psql without connecting

Re: psql --no-connect option

2023-08-24 Thread Julien Rouhaud
Hi, On Thu, Aug 24, 2023 at 12:55:30PM -0700, Gurjeet Singh wrote: > Currently, psql exits if a database connection is not established when > psql is launched. > > Sometimes it may be useful to launch psql without connecting to the > database. For example, a user may choose to start psql and then

Re: subscription/015_stream sometimes breaks

2023-08-24 Thread Amit Kapila
On Fri, Aug 25, 2023 at 9:09 AM Peter Smith wrote: > > On Thu, Aug 24, 2023 at 8:18 PM Amit Kapila wrote: > > > > On Thu, Aug 24, 2023 at 1:20 PM Alvaro Herrera > > wrote: > > > > > > On 2023-Aug-24, Amit Kapila wrote: > > > > > > > On Wed, Aug 23, 2023 at 1:31 PM Alvaro Herrera > > > >

broken master regress tests

2023-08-24 Thread Pavel Stehule
Hi today build is broken on my Fedora 39 Regards Pavel make[2]: Opouští se adresář „/home/pavel/src/postgresql.master/src/bin/initdb“ make -C pg_amcheck check make[2]: Vstupuje se do adresáře „/home/pavel/src/postgresql.master/src/bin/pg_amcheck“ echo "# +++ tap check in src/bin/pg_amcheck

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

2023-08-24 Thread Peter Smith
On Fri, Aug 25, 2023 at 12:09 PM Hayato Kuroda (Fujitsu) wrote: > > Dear Peter, > > > FYI, the v24-0003 tests for pg_upgrade did not work for me: > > Hmm, I ran tests more than 1hr but could not reproduce the failure. > cfbot also said OK multiple times... > Today I rebuilt everything clean from

Re: subscription/015_stream sometimes breaks

2023-08-24 Thread Peter Smith
On Thu, Aug 24, 2023 at 8:18 PM Amit Kapila wrote: > > On Thu, Aug 24, 2023 at 1:20 PM Alvaro Herrera > wrote: > > > > On 2023-Aug-24, Amit Kapila wrote: > > > > > On Wed, Aug 23, 2023 at 1:31 PM Alvaro Herrera > > > wrote: > > > > > > Hmm, I think if worker->in_use is false, we shouldn't

Re: meson uses stale pg_config_paths.h left over from make

2023-08-24 Thread David Rowley
On Thu, 24 Aug 2023 at 18:25, Andres Freund wrote: > > On 2023-08-24 08:18:14 +0200, Peter Eisentraut wrote: > > Surely meson should not be required to detect that? > > I think we should try to detect included files, due to the nasty and hard to > debug issues that creates. I've spent quite a bit

Re: Support run-time partition pruning for hash join

2023-08-24 Thread David Rowley
On Thu, 24 Aug 2023 at 21:27, Richard Guo wrote: > I performed some performance comparisons of the worst case with two > tables as below: > > 1. The partitioned table has 1000 children, and 100,000 tuples in total. > > 2. The other table is designed that > a) its tuples occupy every partition

Re: psql --no-connect option

2023-08-24 Thread Tristan Partin
On Thu Aug 24, 2023 at 2:55 PM CDT, Gurjeet Singh wrote: Currently, psql exits if a database connection is not established when psql is launched. Sometimes it may be useful to launch psql without connecting to the database. For example, a user may choose to start psql and then pipe commands via

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

2023-08-24 Thread Hayato Kuroda (Fujitsu)
Dear Peter, Thanks for reviewing! New patch could be available in [1]. > 1. check_for_lost_slots > > + > +/* > + * Verify that all logical replication slots are usable. > + */ > +void > +check_for_lost_slots(ClusterInfo *cluster) > > 1a. > AFAIK we don't ever need to call this also for

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

2023-08-24 Thread Hayato Kuroda (Fujitsu)
Dear Peter, Thanks for reviewing! PSA new version patch set. Note again that 0001 patch was replaced to new one[1], but you do not have to discuss that - it should be done in forked thread. > 1. + + + All slots on the old cluster must be usable, i.e., there are no slots +

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

2023-08-24 Thread Hayato Kuroda (Fujitsu)
Dear Peter, > FYI, the v24-0003 tests for pg_upgrade did not work for me: Hmm, I ran tests more than 1hr but could not reproduce the failure. cfbot also said OK multiple times... Could you please check source codes again and send log files if it is still problem? Best Regards, Hayato Kuroda

Re: Avoid a possible overflow (src/backend/utils/sort/logtape.c)

2023-08-24 Thread Peter Geoghegan
On Thu, Aug 24, 2023 at 6:44 PM David Rowley wrote: > I agree with this. I think Ranier's patch is good and we should apply > it and backpatch it. FWIW I'm pretty sure that it's impossible to run into problems here in practice -- the minheap is allocated by palloc(), and the high watermark

Re: Avoid a possible overflow (src/backend/utils/sort/logtape.c)

2023-08-24 Thread Peter Geoghegan
On Thu, Aug 24, 2023 at 6:18 PM Michael Paquier wrote: > Still that looks entirely different to me. Here we have a problem > where the number of free blocks stored may cause an overflow in the > internal routine retrieving a free block, but your other thread > is about long being not enough on

Re: Avoid a possible overflow (src/backend/utils/sort/logtape.c)

2023-08-24 Thread David Rowley
On Fri, 25 Aug 2023 at 13:19, Michael Paquier wrote: > Still that looks entirely different to me. Here we have a problem > where the number of free blocks stored may cause an overflow in the > internal routine retrieving a free block, but your other thread > is about long being not enough on

Re: PG 16 draft release notes ready

2023-08-24 Thread Bruce Momjian
On Wed, Aug 23, 2023 at 09:36:01AM -0700, Jeff Davis wrote: > On Tue, 2023-08-22 at 22:23 -0400, Bruce Momjian wrote: > > > I notice that this item is still listed: > > > > > >  * Determine the ICU default locale from the environment (Jeff > > > Davis) > > > > > > But that was reverted as part

Re: Remove IndexInfo.ii_OpclassOptions field

2023-08-24 Thread Michael Paquier
On Thu, Aug 24, 2023 at 08:57:58AM +0200, Peter Eisentraut wrote: > During some refactoring I noticed that the field IndexInfo.ii_OpclassOptions > is kind of useless. The IndexInfo struct is notionally an executor support > node, but this field is not used in the executor or by the index AM code.

Re: Fix error handling in be_tls_open_server()

2023-08-24 Thread Michael Paquier
On Thu, Aug 24, 2023 at 12:13:18PM +0300, Sergey Shinderuk wrote: > But I need to force malloc to fail at the right time during the test. I > don't think I can make a stable and portable test from this. LD_PRELOAD is the only thing I can think about, but that's very fancy. Even with that, having

Re: Avoid a possible overflow (src/backend/utils/sort/logtape.c)

2023-08-24 Thread Michael Paquier
On Thu, Aug 24, 2023 at 05:33:15PM -0700, Peter Geoghegan wrote: > I am in favor of fixing the problem. I don't quite recall what it was > that made the discussion stall last time around. I think that you mean this one:

Re: pg_stat_get_backend_subxact() and backend IDs?

2023-08-24 Thread Ian Lawrence Barwick
2023年8月25日(金) 1:19 Nathan Bossart : > > On Wed, Aug 23, 2023 at 07:51:40PM -0700, Nathan Bossart wrote: > > On Wed, Aug 23, 2023 at 07:32:06PM -0700, Nathan Bossart wrote: > >> On Thu, Aug 24, 2023 at 10:22:49AM +0900, Ian Lawrence Barwick wrote: > >>> Looking at the code, this is happening

Re: Avoid a possible overflow (src/backend/utils/sort/logtape.c)

2023-08-24 Thread Peter Geoghegan
On Thu, Aug 24, 2023 at 4:47 PM Michael Paquier wrote: > > patch attached. > > Yeah, it looks like you're right here. Will do something about that. This is a known issue. It has been discussed before. I am in favor of fixing the problem. I don't quite recall what it was that made the

Re: ALTER COLUMN ... SET EXPRESSION to alter stored generated column's expression

2023-08-24 Thread Vik Fearing
On 8/2/23 12:35, Amul Sul wrote: Hi, Currently, we have an option to drop the expression of stored generated columns as: ALTER [ COLUMN ] column_name DROP EXPRESSION [ IF EXISTS ] But don't have support to update that expression. The attached patch provides that as: ALTER [ COLUMN ]

Re: Avoid a possible overflow (src/backend/utils/sort/logtape.c)

2023-08-24 Thread Michael Paquier
On Thu, Aug 24, 2023 at 02:46:42PM -0300, Ranier Vilela wrote: > With Windows both *long* and *int* are 4 bytes. > But with Linux *long* is 8 bytes and *int* are 4 bytes. And I recall that WIN32 is the only place where we treat long as 4 bytes. > patch attached. Yeah, it looks like you're right

Re: initdb caching during tests

2023-08-24 Thread Andres Freund
Hi, On 2023-08-23 10:10:31 +0200, Daniel Gustafsson wrote: > > On 23 Aug 2023, at 03:17, Andres Freund wrote: > > On 2023-08-22 23:47:24 +0200, Daniel Gustafsson wrote: > > >> My only small gripe is that I keep thinking about template databases for > >> CREATE > >> DATABASE when reading the

Re: Checks in RegisterBackgroundWorker.()

2023-08-24 Thread Thomas Munro
On Fri, Aug 25, 2023 at 3:15 AM Heikki Linnakangas wrote: > In summary, RegisterBackgroundWorker() is doing some questionable and > useless work, when a shared preload library is loaded to a backend > process in EXEC_BACKEND mode. Yeah. When I was working on 7389aad6 ("Use WaitEventSet API for

psql --no-connect option

2023-08-24 Thread Gurjeet Singh
Currently, psql exits if a database connection is not established when psql is launched. Sometimes it may be useful to launch psql without connecting to the database. For example, a user may choose to start psql and then pipe commands via stdin, one of which may eventually perform the \connect

Re: Make documentation builds reproducible

2023-08-24 Thread Tristan Partin
On Thu Aug 24, 2023 at 2:30 PM CDT, Tom Lane wrote: "Tristan Partin" writes: > On Wed Aug 23, 2023 at 2:24 PM CDT, Peter Eisentraut wrote: >> Somewhere at PGCon, I forgot exactly where, maybe in the same meeting >> where we talked about getting rid of distprep, we talked about that the >>

Re: Make documentation builds reproducible

2023-08-24 Thread Tom Lane
"Tristan Partin" writes: > On Wed Aug 23, 2023 at 2:24 PM CDT, Peter Eisentraut wrote: >> Somewhere at PGCon, I forgot exactly where, maybe in the same meeting >> where we talked about getting rid of distprep, we talked about that the >> documentation builds are not reproducible (in the sense

Re: SLRUs in the main buffer pool - Page Header definitions

2023-08-24 Thread Stephen Frost
Greetings, * Robert Haas (robertmh...@gmail.com) wrote: > On Fri, Aug 18, 2023 at 12:15 PM Nathan Bossart > wrote: > > I think I agree with Stephen. We routinely make changes that require > > updates to extensions, and I doubt anyone is terribly wild about > > maintaining two SLRU systems for

Re: Cirrus-ci is lowering free CI cycles - what to do with cfbot, etc?

2023-08-24 Thread Andres Freund
Hi, On 2023-08-22 23:58:33 -0700, Andres Freund wrote: > To make that possible, we need to make the compute resources for CI > configurable on a per-repository basis. After experimenting with a bunch of > ways to do that, I got stuck on that for a while. But since today we have > sufficient

Re: PostgreSQL 16 RC1 + GA release dates

2023-08-24 Thread Jonathan S. Katz
On 8/16/23 3:48 PM, Jonathan S. Katz wrote: The date for PostgreSQL 16 Release Candidate 1 (RC1) is August 31, 2023. Please ensure all open items[1] are completed and committed before August 26, 2023 12:00 UTC. Reminder: the RC1 open item[1] deadline is at August 26, 2023 @ 12:00 UTC.

Re: Make documentation builds reproducible

2023-08-24 Thread Tristan Partin
On Wed Aug 23, 2023 at 2:24 PM CDT, Peter Eisentraut wrote: Somewhere at PGCon, I forgot exactly where, maybe in the same meeting where we talked about getting rid of distprep, we talked about that the documentation builds are not reproducible (in the sense of

Avoid a possible overflow (src/backend/utils/sort/logtape.c)

2023-08-24 Thread Ranier Vilela
Hi, nFreeBlocks stores the number of free blocks and your type is *long*. At Function ltsGetFreeBlock is locally stored in heapsize wich type is *int* With Windows both *long* and *int* are 4 bytes. But with Linux *long* is 8 bytes and *int* are 4 bytes. patch attached. best regards, Ranier

Re: add timing information to pg_upgrade

2023-08-24 Thread Nathan Bossart
On Wed, Aug 23, 2023 at 09:35:20AM -0700, Nathan Bossart wrote: > On Tue, Aug 22, 2023 at 07:06:23AM -0700, Nathan Bossart wrote: >> On Tue, Aug 22, 2023 at 11:49:33AM +0200, Peter Eisentraut wrote: >>> Let's change MESSAGE_WIDTH to 62 in v16, and then pursue the larger >>> restructuring

Re: PostgreSQL 16 release announcement draft

2023-08-24 Thread Dave Cramer
> > > > Postgres, PostgreSQL, and the Elephant Logo (Slonik) are all registered > > trademarks of the [PostgreSQL Community Association of Canada]( > https://www.postgres.ca). > > Isn't this just the "PostgreSQL Community Association", no Canada? > Certainly confusing from the website, but in the

Re: Cirrus-ci is lowering free CI cycles - what to do with cfbot, etc?

2023-08-24 Thread Nazir Bilal Yavuz
Hi, On Thu, 24 Aug 2023 at 00:48, Andres Freund wrote: > > v3-0008-ci-switch-tasks-to-debugoptimized-build.patch: > > Just thinking of possible optimizations and thought can't we create > > something like 'buildtype: xxx' to override default buildtype using > > .cirrus.star? This could be better

Re: Disabling Heap-Only Tuples

2023-08-24 Thread Matthias van de Meent
On Wed, 19 Jul 2023 at 15:13, Thom Brown wrote: > > On Wed, 19 Jul 2023, 13:58 Laurenz Albe, wrote: >> I agree that the name "max_local_update" could be improved. >> Perhaps "avoid_hot_above_size_mb". > > Or "hot_table_size_threshold" or "hot_update_limit"? Although I like these names, it

Re: pg_stat_get_backend_subxact() and backend IDs?

2023-08-24 Thread Nathan Bossart
On Wed, Aug 23, 2023 at 07:51:40PM -0700, Nathan Bossart wrote: > On Wed, Aug 23, 2023 at 07:32:06PM -0700, Nathan Bossart wrote: >> On Thu, Aug 24, 2023 at 10:22:49AM +0900, Ian Lawrence Barwick wrote: >>> Looking at the code, this is happening because >>> "pgstat_fetch_stat_local_beentry()" >>>

Altering the SELECT portion of a CREATE TABLE AS plan

2023-08-24 Thread Jerry Sievert
Hi, i am trying to mutate a plan for a T_CreateTableAsStmt before it executes. I've created a planner_hook_type hook, where i can see the plan that gets executed as part of the AS of the query, where the CmdType is CMD_SELECT, and its subplans are the plans for the actual select itself. I've

Re: PostgreSQL 16 release announcement draft

2023-08-24 Thread Chapman Flack
On 2023-08-24 11:23, Jonathan S. Katz wrote: SELECT $1::int + $2::int \bind 1 2 \g One cast also works, letting type inference figure out the other. So if I say SELECT $1::int + $2 \gdesc it tells me the result will be int. That made me wonder if there is a \gdesc variant to issue the

Re: PostgreSQL 16 release announcement draft

2023-08-24 Thread Jonathan S. Katz
On 8/24/23 11:16 AM, jian he wrote: hi. Can you check my first email about "a" versus "the" and "pg_stat_activity". I did when you first sent it, and did not make any changes. also: "including the `\bind` command, which allows users to execute parameterized queries (e.g `SELECT $1 + $2`)

Re: Disabling Heap-Only Tuples

2023-08-24 Thread Matthias van de Meent
On Fri, 7 Jul 2023 at 12:18, Tomas Vondra wrote: > > On 7/7/23 11:55, Matthias van de Meent wrote: >> On Fri, 7 Jul 2023 at 06:53, Dilip Kumar wrote: >>> >>> >>> So IIUC, this parameter we can control that instead of putting the new >>> version of the tuple on the same page, it should choose

Re: PostgreSQL 16 release announcement draft

2023-08-24 Thread Alvaro Herrera
On 2023-Aug-24, Jonathan S. Katz wrote: > ### Performance Improvements > > PostgreSQL 16 improves the performance of existing PostgreSQL functionality > through new query planner optimizations. In this latest release, the query > planner can parallelize `FULL` and `RIGHT` joins, generate better

Re: PostgreSQL 16 release announcement draft

2023-08-24 Thread jian he
hi. Can you check my first email about "a" versus "the" and "pg_stat_activity". also: "including the `\bind` command, which allows users to execute parameterized queries (e.g `SELECT $1 + $2`) then use `\bind` to substitute the variables." The example actually is very hard to reproduce. (it's

Checks in RegisterBackgroundWorker.()

2023-08-24 Thread Heikki Linnakangas
The first patch on my "Refactoring backend fork+exec code" thread [0] changes the allocations of BackgroundWorkerList from plain malloc() to MemoryContextAlloc(PostmasterContext). However, that actually caused a segfault in worker_spi tests in EXEC_BACKEND mode. BackgroundWorkerList is a

Re: PostgreSQL 16 release announcement draft

2023-08-24 Thread Erik Rijkers
Op 8/24/23 om 16:32 schreef Jonathan S. Katz: On 8/23/23 5:07 PM, David Rowley wrote: On Thu, 24 Aug 2023 at 05:55, Jonathan S. Katz wrote: Hi, When v15 docs have: "27.2.7. Cascading Replication The cascading replication feature allows a standby server to accept replication connections

Re: PostgreSQL 16 release announcement draft

2023-08-24 Thread Jonathan S. Katz
On 8/23/23 5:07 PM, David Rowley wrote: On Thu, 24 Aug 2023 at 05:55, Jonathan S. Katz wrote: We could add something about 1349d2790 -- do you have suggested wording? I think it's worth a mention. See the text added in square brackets below: PostgreSQL 16 improves the performance of

Re: EBCDIC sorting as a use case for ICU rules

2023-08-24 Thread Jehan-Guillaume de Rorthais
Hi, Sorry to chime in so lately, I was waiting for some customer feedback. On Wed, 21 Jun 2023 15:28:38 +0200 "Daniel Verite" wrote: > At a conference this week I was asked if ICU could be able to > sort like EBCDIC [2]. > It turns out it has been already asked on > -general a few years

Re: Vectorization of some functions and improving pg_list interface

2023-08-24 Thread Chapman Flack
On 2023-08-24 10:07, Maxim Orlov wrote: 1) Why do I need to specify the number of elements in the list in the function name? This is reminding me of something someone (Tom?) worked on sort of recently. Ah, yes: https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=1cff1b9 I wasn't

Vectorization of some functions and improving pg_list interface

2023-08-24 Thread Maxim Orlov
Hi! Recently, I've been playing around with pg_lists and realize how annoying (maybe, I was a bit tired) some stuff related to the lists. For an example, see this code List *l1 = list_make4(1, 2, 3, 4), *l2 = list_make4(5, 6, 7, 8), *l3 = list_make4(9, 0, 1, 2); ListCell

Re: Use FD_CLOEXEC on ListenSockets (was Re: Refactoring backend fork+exec code)

2023-08-24 Thread Heikki Linnakangas
On 24/08/2023 15:48, Thomas Munro wrote: LGTM. I vaguely recall thinking that it might be better to keep EXEC_BACKEND and !EXEC_BACKEND working the same which might be why I didn't try this one, but it looks fine with the comment to explain, as you have it. (It's a shame we can't use

Re: generate syscache info automatically

2023-08-24 Thread Peter Eisentraut
On 03.07.23 07:45, Peter Eisentraut wrote: Here is an updated patch set that adjusts for the recently introduced named captures.  I will address the other issues later.  I think the first few patches in the series can be considered nonetheless. I have committed the 0001 patch, which was

Re: Use FD_CLOEXEC on ListenSockets (was Re: Refactoring backend fork+exec code)

2023-08-24 Thread Thomas Munro
On Thu, Aug 24, 2023 at 11:41 PM Heikki Linnakangas wrote: > On 11/07/2023 01:50, Andres Freund wrote: > >> From: Heikki Linnakangas > >> Date: Mon, 12 Jun 2023 16:33:20 +0300 > >> Subject: [PATCH 4/9] Use FD_CLOEXEC on ListenSockets > >> > >> We went through some effort to close them in the

Re: Adding argument names to aggregate functions

2023-08-24 Thread Dagfinn Ilmari Mannsåker
On Thu, 24 Aug 2023, at 11:05, Daniel Gustafsson wrote: >> On 4 Aug 2023, at 01:36, Nathan Bossart wrote: >> >> On Wed, Jul 19, 2023 at 09:38:12PM +0200, Daniel Gustafsson wrote: >>> Great, thanks! I had a quick look at this while rebasing (as well as your >>> updated patch) and it seems like a

Use FD_CLOEXEC on ListenSockets (was Re: Refactoring backend fork+exec code)

2023-08-24 Thread Heikki Linnakangas
Focusing on this one patch in this series: On 11/07/2023 01:50, Andres Freund wrote: From: Heikki Linnakangas Date: Mon, 12 Jun 2023 16:33:20 +0300 Subject: [PATCH 4/9] Use FD_CLOEXEC on ListenSockets We went through some effort to close them in the child process. Better to not hand them down

Re: Report planning memory in EXPLAIN ANALYZE

2023-08-24 Thread Ashutosh Bapat
Sorry for the late reply. I was working on David's suggestion. Here's a response to your questions and also a new set of patches. On Tue, Aug 22, 2023 at 1:16 PM jian he wrote: > Hi. I tested it. > not sure if following is desired behavior. first run with explain, > then run with

Re: subscription/015_stream sometimes breaks

2023-08-24 Thread Amit Kapila
On Thu, Aug 24, 2023 at 1:20 PM Alvaro Herrera wrote: > > On 2023-Aug-24, Amit Kapila wrote: > > > On Wed, Aug 23, 2023 at 1:31 PM Alvaro Herrera > > wrote: > > > > Hmm, I think if worker->in_use is false, we shouldn't consult the rest > > > of the struct at all, so I propose to add the

Re: Adding argument names to aggregate functions

2023-08-24 Thread Daniel Gustafsson
> On 4 Aug 2023, at 01:36, Nathan Bossart wrote: > > On Wed, Jul 19, 2023 at 09:38:12PM +0200, Daniel Gustafsson wrote: >> Great, thanks! I had a quick look at this while rebasing (as well as your >> updated patch) and it seems like a good idea to add this. Unless there are >> objections I

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

2023-08-24 Thread Peter Smith
Notwithstanding the test errors I am getting for v24-0003, here are some code review comments for this patch anyway. == src/bin/pg_upgrade/check.c 1. check_for_lost_slots + +/* + * Verify that all logical replication slots are usable. + */ +void +check_for_lost_slots(ClusterInfo *cluster)

Re: Support run-time partition pruning for hash join

2023-08-24 Thread Richard Guo
On Tue, Aug 22, 2023 at 2:38 PM David Rowley wrote: > It would be good to see some performance comparisons of the worst case > to see how much overhead the pruning code adds to Hash Join. It may > well be that we need to consider two Hash Join paths, one with and one > without run-time pruning.

Re: Fix error handling in be_tls_open_server()

2023-08-24 Thread Sergey Shinderuk
On 24.08.2023 11:38, Daniel Gustafsson wrote: On 24 Aug 2023, at 10:11, Sergey Shinderuk wrote: I triggered a crash by generating a certificate without a CN and forcing malloc to return NULL when called from X509_NAME_print_ex or BIO_get_mem_ptr with gdb. Can you extend the patch with

Re: Fix error handling in be_tls_open_server()

2023-08-24 Thread Daniel Gustafsson
> On 24 Aug 2023, at 10:11, Sergey Shinderuk wrote: > > On 23.08.2023 16:23, Daniel Gustafsson wrote: >>> On 1 Aug 2023, at 16:44, Sergey Shinderuk >>> wrote: >>> A static analyzer reported a possible pfree(NULL) in be_tls_open_server(). >> This has the smell of a theoretical problem, I can't

Re: Should the archiver process always make sure that the timeline history files exist in the archive?

2023-08-24 Thread Kyotaro Horiguchi
At Wed, 16 Aug 2023 07:33:29 +, Jimmy Yih wrote in > Hello pgsql-hackers, > > After doing some more debugging on the matter, I believe this issue might be a > minor regression from commit 5332b8cec541. Prior to that commit, the archiver > process when first started on a previously promoted

Re: Fix error handling in be_tls_open_server()

2023-08-24 Thread Sergey Shinderuk
On 23.08.2023 16:23, Daniel Gustafsson wrote: On 1 Aug 2023, at 16:44, Sergey Shinderuk wrote: A static analyzer reported a possible pfree(NULL) in be_tls_open_server(). This has the smell of a theoretical problem, I can't really imagine a certificate where which would produce this. Have

Re: subscription/015_stream sometimes breaks

2023-08-24 Thread Alvaro Herrera
On 2023-Aug-24, Amit Kapila wrote: > On Wed, Aug 23, 2023 at 1:31 PM Alvaro Herrera > wrote: > > Hmm, I think if worker->in_use is false, we shouldn't consult the rest > > of the struct at all, so I propose to add the attached 0001 as a minimal > > fix. > > I think that way we may need to add

Remove IndexInfo.ii_OpclassOptions field

2023-08-24 Thread Peter Eisentraut
During some refactoring I noticed that the field IndexInfo.ii_OpclassOptions is kind of useless. The IndexInfo struct is notionally an executor support node, but this field is not used in the executor or by the index AM code. It is really just used in DDL code in index.c and indexcmds.c to

Re: meson uses stale pg_config_paths.h left over from make

2023-08-24 Thread Andres Freund
Hi, On 2023-08-24 08:18:14 +0200, Peter Eisentraut wrote: > On 23.08.23 14:52, David Rowley wrote: > > Generally when there are files left over the meson build script will > > detect this and ask you to run make maintainer-clean. That's useful > > on Linux, but on Windows you're just left to

Re: meson uses stale pg_config_paths.h left over from make

2023-08-24 Thread Peter Eisentraut
On 23.08.23 14:52, David Rowley wrote: Generally when there are files left over the meson build script will detect this and ask you to run make maintainer-clean. That's useful on Linux, but on Windows you're just left to manually remove the conflicting files which are listed. Unfortunately,

logical_replication_mode

2023-08-24 Thread Peter Eisentraut
I suggest we rename this setting to something starting with debug_. Right now, the name looks much too tempting for users to fiddle with. I think this is similar to force_parallel_mode. Also, the descriptions in guc_tables.c could be improved. For example, gettext_noop("Controls when to

Re: persist logical slots to disk during shutdown checkpoint

2023-08-24 Thread vignesh C
On Wed, 23 Aug 2023 at 14:21, Hayato Kuroda (Fujitsu) wrote: > > Dear Vignesh, > > > Here is a patch to persist to disk logical slots during a shutdown > > checkpoint if the updated confirmed_flush_lsn has not yet been > > persisted. > > Thanks for making the patch with different approach! Here

Re: Cirrus-ci is lowering free CI cycles - what to do with cfbot, etc?

2023-08-24 Thread Peter Eisentraut
On 24.08.23 00:56, Andres Freund wrote: Hi, On 2023-08-23 18:32:26 -0400, Tom Lane wrote: Andres Freund writes: There are other potential uses for libpq in pg_regress though - I'd e.g. like to have a "monitoring" session open, which we could use to detect that the server crashed (by waiting