Re: Improve join_search_one_level readibilty (one line change)

2023-06-03 Thread Julien Rouhaud
Hi, On Sat, Jun 03, 2023 at 05:24:43PM +0800, 謝東霖 wrote: > > Attached is my first patch for PostgreSQL, which is a simple one-liner > that I believe can improve the code. Welcome! > In the "join_search_one_level" function, I noticed that the variable > "other_rels_list" always refers to "joinrel

Re: Avoid unused value (src/fe_utils/print.c)

2023-06-03 Thread Alexander Lakhin
Hi Michael, 04.06.2023 01:42, Michael Paquier wrote: On Sat, Jun 03, 2023 at 03:00:01PM +0300, Alexander Lakhin wrote: Clang' scan-build detects 58 errors "Dead assignment", including that one. Maybe it would be more sensible to eliminate all errors of this class? Depends on if this makes any

Re: [BUG] pg_dump does not properly deal with BEGIN ATOMIC function

2023-06-03 Thread Kirk Wolak
On Sat, Jun 3, 2023 at 2:28 PM Tom Lane wrote: > Kirk Wolak writes: > > On Fri, Jun 2, 2023 at 8:16 AM Tom Lane wrote: > > If I comprehend the suggestion, it will label each line with a warning. > > Which implies I have 6 Warnings. > > Right, I'd forgotten that pg_log_warning() will interpose

Add test module for Table Access Method

2023-06-03 Thread Fabrízio de Royes Mello
Hi all, During the PGCon Unconference session about Table Access Method one missing item pointed out is that currently we lack documentation and examples of TAM. So in order to improve things a bit in this area I'm proposing to add a test module for Table Access Method similar what we already hav

Re: Avoid unused value (src/fe_utils/print.c)

2023-06-03 Thread Michael Paquier
On Sat, Jun 03, 2023 at 03:00:01PM +0300, Alexander Lakhin wrote: > Clang' scan-build detects 58 errors "Dead assignment", including that one. > Maybe it would be more sensible to eliminate all errors of this class? Depends on if this makes any code changed a bit easier to understand I guess, so t

Re: New Table Access Methods for Multi and Single Inserts

2023-06-03 Thread Andres Freund
Hi, This patch was referenced in a discussion at pgcon, so I thought I'd give it a look, even though Bharat said that he won't have time to drive it forward... On 2021-04-19 10:21:36 +0530, Bharath Rupireddy wrote: > diff --git a/src/backend/access/heap/heapam_handler.c > b/src/backend/access/h

Re: [PATCH] Slight improvement of worker_spi.c example

2023-06-03 Thread Michael Paquier
On Sat, Jun 03, 2023 at 03:34:30PM +0300, Aleksander Alekseev wrote: > Agree. It is a simple example and I don't think it's going to be > useful to make a complicated one out of it. It does not have to be complicated, but I definitely agree that we'd better spend some efforts in improving it as a

Re: Implement generalized sub routine find_in_log for tap test

2023-06-03 Thread Michael Paquier
On Mon, May 29, 2023 at 07:49:52AM +0530, vignesh C wrote: > Thanks for the comment, the attached v3 version patch has the changes > for the same. -if (find_in_log( - $node, $log_offset, - qr/peer authentication is not supported on this platform/)) +if ($node->log_conta

Re: Prevent psql \watch from running queries that return no rows

2023-06-03 Thread Michael Paquier
On Fri, Jun 02, 2023 at 11:47:16AM -0400, Greg Sabino Mullane wrote: > * Not completely convinced of the name "zero" (better than > "stop_when_no_rows_returned"). Considered adding a new x=y argument, or > overloading c (c=-1) but neither seemed very intuitive. On the other hand, > it's tempting to

Re: Docs: Encourage strong server verification with SCRAM

2023-06-03 Thread Michael Paquier
On Thu, Jun 01, 2023 at 08:28:32AM -0400, Michael Paquier wrote: > Hmm. Okay by me. Took me some time to get back to it, but applied this way. -- Michael signature.asc Description: PGP signature

Re: [BUG] pg_dump does not properly deal with BEGIN ATOMIC function

2023-06-03 Thread Tom Lane
Kirk Wolak writes: > On Fri, Jun 2, 2023 at 8:16 AM Tom Lane wrote: >> BTW, now that I see a case the default printout here seems >> completely ridiculous. I think we need to do >> - pg_log_info(" %s", buf); >> + pg_log_warning(" %s", buf); > If I comprehend the suggestion, it w

Improving FTS for Greek

2023-06-03 Thread Florents Tselai
I posted earlier in pgsql-general, that I realised there’s no greek.stop under $(pg_config —sharedir)/tsearch_data And indeed looks like stop words are maintained with to_tsvector(‘greek’, ..). I wrote an extension https://github.com/Florents-Tselai/pg_fts_greek that adds another ‘greek_ext’ r

Improve join_search_one_level readibilty (one line change)

2023-06-03 Thread 謝東霖
Hello hackers Attached is my first patch for PostgreSQL, which is a simple one-liner that I believe can improve the code. In the "join_search_one_level" function, I noticed that the variable "other_rels_list" always refers to "joinrels[1]" even when the (level == 2) condition is met. I propose ch

Re: Should "REGRESS_OPTS = --temp-config" be working for 3rd party extensions?

2023-06-03 Thread Aleksander Alekseev
Hi Julien, > temp-config can only be used when bootstrapping a temporary environment, so > when using e.g. make check. PGXS / third-party extension can only use > installcheck, so if you need specific config like shared_preload_libraries you > need to manually configure your instance beforehand,

Re: Should "REGRESS_OPTS = --temp-config" be working for 3rd party extensions?

2023-06-03 Thread Julien Rouhaud
On Sat, Jun 03, 2023 at 02:56:27PM +0300, Aleksander Alekseev wrote: > > I tried to use `REGRESS_OPTS = --temp-config` in order to test a 3rd > party extension with a custom .conf file similarly to how PostgreSQL > does it for src/test/modules/test_slru. It didn't work and "38.18. > Extension Build

Re: Avoid unused value (src/fe_utils/print.c)

2023-06-03 Thread Ranier Vilela
Em sáb., 3 de jun. de 2023 às 09:00, Alexander Lakhin escreveu: > Hello Ranier, > > 03.06.2023 13:14, Ranier Vilela wrote: > > Hi, > > > > This is for Postgres 17 (head). > > > > Per Coverity. > > At function print_unaligned_text, variable "need_recordsep", is > > unnecessarily set to true and fa

Re: [PATCH] Slight improvement of worker_spi.c example

2023-06-03 Thread Aleksander Alekseev
Hi, > That being said this module is really naive and has so many problems that I > don't think it's actually helpful as coding guidelines for anyone who wants to > create a non toy extension using bgworkers. Agree. It is a simple example and I don't think it's going to be useful to make a compli

Re: [PATCH] Slight improvement of worker_spi.c example

2023-06-03 Thread Julien Rouhaud
On Sat, Jun 03, 2023 at 02:38:26PM +0300, Aleksander Alekseev wrote: > Hi Julien, > > > I'm pretty sure that this is intentional. The worker can be launched > > dynamically and in that case it still needs a GUC for the naptime. > > The dynamic worker also is going to need worker_spi_database, howe

Re: PostgreSQL 16 Beta 1 Released!

2023-06-03 Thread Tom Lane
Marco Atzeri writes: > just me ? No. https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=5df5bea29070b420452bdb257c3dec1cf0419fca regards, tom lane

Re: Avoid unused value (src/fe_utils/print.c)

2023-06-03 Thread Alexander Lakhin
Hello Ranier, 03.06.2023 13:14, Ranier Vilela wrote: Hi, This is for Postgres 17 (head). Per Coverity. At function print_unaligned_text, variable "need_recordsep", is unnecessarily set to true and false. Clang' scan-build detects 58 errors "Dead assignment", including that one. Maybe it woul

Should "REGRESS_OPTS = --temp-config" be working for 3rd party extensions?

2023-06-03 Thread Aleksander Alekseev
Hi, I tried to use `REGRESS_OPTS = --temp-config` in order to test a 3rd party extension with a custom .conf file similarly to how PostgreSQL does it for src/test/modules/test_slru. It didn't work and "38.18. Extension Building Infrastructure" [1] doesn't seem to be much help. Here is my Makefile

Re: [PATCH] Slight improvement of worker_spi.c example

2023-06-03 Thread Aleksander Alekseev
Hi Julien, > I'm pretty sure that this is intentional. The worker can be launched > dynamically and in that case it still needs a GUC for the naptime. The dynamic worker also is going to need worker_spi_database, however the corresponding GUC declaration is placed below the check. Perhaps we sh

Re: [PATCH] Slight improvement of worker_spi.c example

2023-06-03 Thread Julien Rouhaud
On Sat, Jun 03, 2023 at 02:09:26PM +0300, Aleksander Alekseev wrote: > > Additionally I noticed that the check: > > ``` > if (!process_shared_preload_libraries_in_progress) > return; > ``` > > ... was misplaced in _PG_init(). Here is the patch v2 which fixes this too. I'm p

Re: [PATCH] Slight improvement of worker_spi.c example

2023-06-03 Thread Aleksander Alekseev
Hi, > The patch changes the order to: > > StartTransactionCommand(); > PushActiveSnapshot(...); > SPI_connect(); > > ... > > SPI_finish(); > PopActiveSnapshot(); > CommitTransactionCommand(); > > ... and also clarifies that the order of PushActiveSnapshot(...) and > SPI

Avoid unused value (src/fe_utils/print.c)

2023-06-03 Thread Ranier Vilela
Hi, This is for Postgres 17 (head). Per Coverity. At function print_unaligned_text, variable "need_recordsep", is unnecessarily set to true and false. Attached a trivial fix patch. regards, Ranier Vilela avoid-unused-value-print.patch Description: Binary data