Re: warning: comparison of integer expressions of different signedness related to simd.h

2022-09-02 Thread Tom Lane
John Naylor writes: > On Sat, Sep 3, 2022 at 12:30 PM Pavel Stehule wrote: >> /usr/local/pgsql/master/include/server/port/simd.h: In function >> ‘vector8_has’: >> /usr/local/pgsql/master/include/server/port/simd.h:168:27: warning: >> comparison of integer expressions of different signedness:

Re: warning: comparison of integer expressions of different signedness related to simd.h

2022-09-02 Thread Pavel Stehule
so 3. 9. 2022 v 7:50 odesílatel John Naylor napsal: > On Sat, Sep 3, 2022 at 12:30 PM Pavel Stehule > wrote: > > > > Hi > > > > I got fresh warnings when I build an extension > > > > In file included from > /usr/local/pgsql/master/include/server/mb/pg_wchar.h:22, > > from

Re: warning: comparison of integer expressions of different signedness related to simd.h

2022-09-02 Thread John Naylor
On Sat, Sep 3, 2022 at 12:30 PM Pavel Stehule wrote: > > Hi > > I got fresh warnings when I build an extension > > In file included from /usr/local/pgsql/master/include/server/mb/pg_wchar.h:22, > from src/format.c:17: > /usr/local/pgsql/master/include/server/port/simd.h: In

Re: Avoid erroring out when unable to remove or parse logical rewrite files to save checkpoint work

2022-09-02 Thread Ibrar Ahmed
On Sat, Sep 3, 2022 at 3:09 AM Nathan Bossart wrote: > On Fri, Sep 02, 2022 at 05:09:14PM +0900, Michael Paquier wrote: > > I had a few hours and I've spent them looking at what you had here in > > details, and there were a few things I have tweaked before applying > > the patch. > > Thanks! > >

Re: pgbench: using prepared BEGIN statement in a pipeline could cause an error

2022-09-02 Thread Ibrar Ahmed
On Mon, Mar 28, 2022 at 8:35 AM Yugo NAGATA wrote: > On Fri, 25 Mar 2022 16:19:54 -0400 > Tom Lane wrote: > > > Fabien COELHO writes: > > >> [...] One way to avoid these errors is to send Parse messages before > > >> pipeline mode starts. I attached a patch to fix to prepare commands > at > >

warning: comparison of integer expressions of different signedness related to simd.h

2022-09-02 Thread Pavel Stehule
Hi I got fresh warnings when I build an extension In file included from /usr/local/pgsql/master/include/server/mb/pg_wchar.h:22, from src/format.c:17: /usr/local/pgsql/master/include/server/port/simd.h: In function ‘vector8_has’:

Re: win_flex.exe (and likely win_bison.exe) isn't concurrency safe

2022-09-02 Thread Julien Rouhaud
On Sat, Sep 03, 2022 at 10:33:43AM +0530, Amit Kapila wrote: > On Sat, Sep 3, 2022 at 4:13 AM Andres Freund wrote: > > For the meson build it is trivial to "address" this by setting FLEX_TMP_DIR > > to > > a private directory (which we already need to deal with lex.backup), > > something > >

Re: win_flex.exe (and likely win_bison.exe) isn't concurrency safe

2022-09-02 Thread Amit Kapila
On Sat, Sep 3, 2022 at 4:13 AM Andres Freund wrote: > > building PG with meson on windows I occasionally got weird errors around > scanners. Sometimes scanner generation would fail with > > win_flex.exe: error deleting file > C:\Users\myadmin\AppData\Local\Temp\~flex_out_main_2 > > sometimes

Re: test_decoding assertion failure for the loss of top-sub transaction relationship

2022-09-02 Thread Amit Kapila
On Fri, Sep 2, 2022 at 6:26 AM osumi.takami...@fujitsu.com wrote: > > > I've met an assertion failure of logical decoding with below scenario on HEAD. > > --- > > create table tab1 (val integer); > select 'init' from pg_create_logical_replication_slot('regression_slot', > 'test_decoding'); > >

Re: postgres_fdw hint messages

2022-09-02 Thread Nathan Bossart
On Fri, Sep 02, 2022 at 10:06:54PM -0400, Tom Lane wrote: > I think the distance limit of 5 is too loose though. I see that > it accommodates examples like "passfile" for "password", which > seems great at first glance; but it also allows fundamentally > silly suggestions like "user" for "server"

Re: build remaining Flex files standalone

2022-09-02 Thread John Naylor
On Sat, Sep 3, 2022 at 1:29 AM Andres Freund wrote: > > Hi John, > > Are you planning to press ahead with these? I was waiting for feedback on the latest set, so tomorrow I'll see about the FIXME and remove the leftover bogus include. I was thinking of applying the guc-file patches separately

Re: postgres_fdw hint messages

2022-09-02 Thread Tom Lane
Michael Paquier writes: > On Fri, Sep 02, 2022 at 02:26:09PM -0700, Nathan Bossart wrote: >> * I chose a Levenshtein distance of 5 as the threshold of closeness for the >> hint messages. This felt lenient, but it should hopefully still filter out >> some of the more ridiculous suggestions.

Re: Backpatching nbtree VACUUM (page deletion) hardening

2022-09-02 Thread Peter Geoghegan
On Fri, Sep 2, 2022 at 6:14 PM Michael Paquier wrote: > This has been a problem for years, and still for years to come with > libc updates. I am not much into this stuff, but does running VACUUM > in this case help with the state of the index that used a past, > now-invalid, collation (be it

Re: First draft of the PG 15 release notes

2022-09-02 Thread Bruce Momjian
On Wed, Aug 31, 2022 at 04:03:06PM -0400, Bruce Momjian wrote: > On Wed, Aug 31, 2022 at 11:38:33AM +0200, Peter Eisentraut wrote: > > On 30.08.22 22:42, Bruce Momjian wrote: > > > I just can't figure out what the user needs to understand about this, > > > and I understand very little of it. > >

Re: Backpatching nbtree VACUUM (page deletion) hardening

2022-09-02 Thread Michael Paquier
On Fri, Sep 02, 2022 at 02:13:15PM -0700, Peter Geoghegan wrote: > Postgres 14 commit 5b861baa55 added hardening to nbtree page deletion. > This had the effect of making nbtree VACUUM robust against misbehaving > operator classes -- we just LOG the problem and move on, without > throwing an error.

Re: make additional use of optimized linear search routines

2022-09-02 Thread Michael Paquier
On Fri, Sep 02, 2022 at 03:16:11PM -0700, Nathan Bossart wrote: > On Fri, Sep 02, 2022 at 08:15:46PM +0800, Richard Guo wrote: >> +1 for the proposal. I did some simple grep work in the source codes but >> not too much outputs besides the two places addressed in your patches. > > Thanks for

Re: postgres_fdw hint messages

2022-09-02 Thread Michael Paquier
On Fri, Sep 02, 2022 at 02:26:09PM -0700, Nathan Bossart wrote: > Here is a new patch. Two notes: > > * I considered whether to try to unite this new functionality with the > existing stuff in parse_relation.c, but the existing code looked a bit too > specialized. > > * I chose a Levenshtein

Re: json docs fix jsonb_path_exists_tz again

2022-09-02 Thread Michael Paquier
On Fri, Sep 02, 2022 at 04:25:38PM +0200, Erik Rijkers wrote: > In funcs.sgml, the value fed into jsonb_path_exists_tz was wrong; fixed as > attached. > > (was inadvertently reverted with the big JSON revert) Yeah, good catch. This comes from 2f2b18b. There is a second inconsistency with

Re: Backpatching nbtree VACUUM (page deletion) hardening

2022-09-02 Thread Nathan Bossart
On Fri, Sep 02, 2022 at 02:13:15PM -0700, Peter Geoghegan wrote: > I think that this should be backpatched now, to protect users from > particularly nasty problems that hitting the error eventually leads > to. +1 -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

win_flex.exe (and likely win_bison.exe) isn't concurrency safe

2022-09-02 Thread Andres Freund
Hi, building PG with meson on windows I occasionally got weird errors around scanners. Sometimes scanner generation would fail with win_flex.exe: error deleting file C:\Users\myadmin\AppData\Local\Temp\~flex_out_main_2 sometimes the generated scanner would just be corrupted. I was confused

Re: introduce bufmgr hooks

2022-09-02 Thread Nathan Bossart
On Thu, Sep 01, 2022 at 05:34:03PM -0700, Andres Freund wrote: > On 2022-09-01 13:11:50 -0700, Nathan Bossart wrote: >> On Wed, Aug 31, 2022 at 08:29:31AM -0700, Andres Freund wrote: >> > I also think it'll >> > make it harder to improve things in this area, which needs quite a bit of >> > work.

Re: warn if GUC set to an invalid shared library

2022-09-02 Thread Justin Pryzby
On Fri, Jul 22, 2022 at 03:26:47PM -0400, Tom Lane wrote: > Justin Pryzby writes: > > On Fri, Jul 22, 2022 at 03:00:23PM -0400, Tom Lane wrote: > >> Shouldn't you be doing this when the source is PGC_S_TEST, instead? > > > That makes sense, but it doesn't work for ALTER SYSTEM, which uses > >

Re: make additional use of optimized linear search routines

2022-09-02 Thread Nathan Bossart
On Fri, Sep 02, 2022 at 08:15:46PM +0800, Richard Guo wrote: > +1 for the proposal. I did some simple grep work in the source codes but > not too much outputs besides the two places addressed in your patches. Thanks for taking a look! > Here are some places I noticed that might be optimized with

Re: Avoid erroring out when unable to remove or parse logical rewrite files to save checkpoint work

2022-09-02 Thread Nathan Bossart
On Fri, Sep 02, 2022 at 05:09:14PM +0900, Michael Paquier wrote: > I had a few hours and I've spent them looking at what you had here in > details, and there were a few things I have tweaked before applying > the patch. Thanks! -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: O(n) tasks cause lengthy startups and checkpoints

2022-09-02 Thread Nathan Bossart
On Wed, Aug 24, 2022 at 09:46:24AM -0700, Nathan Bossart wrote: > Another rebase for cfbot. And another. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com >From 63a470be1ac8af3b12684f136f70b2d7b6f87b81 Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Wed, 5 Jan 2022 19:24:22

Re: pg_auth_members.grantor is bunk

2022-09-02 Thread Jeff Davis
On Fri, 2022-09-02 at 09:30 -0400, Robert Haas wrote: > Thanks for having a look. Thanks for doing the work. > Yes. I figured that, when GRANTED BY is not specified, it is OK to > infer a valid grantor The spec is clear that the grantor should be either the current user or the current role. We

Re: Mingw task for Cirrus CI

2022-09-02 Thread Melih Mutlu
Justin Pryzby , 19 Ağu 2022 Cum, 05:34 tarihinde şunu yazdı: > Inline notes about changes since the last version. > > On Thu, Jul 28, 2022 at 05:44:28PM -0500, Justin Pryzby wrote: > > I think the "only_if" should allow separately running one but not both > of the > > windows instances, like: > >

Re: postgres_fdw hint messages

2022-09-02 Thread Nathan Bossart
On Thu, Sep 01, 2022 at 04:31:20PM -0700, Nathan Bossart wrote: > On Thu, Sep 01, 2022 at 07:08:49PM -0400, Tom Lane wrote: >> (1) there probably needs to be some threshold of closeness, so we don't >> offer "foobar" when the user wrote "huh" > > Agreed. > >> (2) there are several places doing

Backpatching nbtree VACUUM (page deletion) hardening

2022-09-02 Thread Peter Geoghegan
Postgres 14 commit 5b861baa55 added hardening to nbtree page deletion. This had the effect of making nbtree VACUUM robust against misbehaving operator classes -- we just LOG the problem and move on, without throwing an error. In practice a "misbehaving operator class" is often a problem with

Re: Minimum bison and flex versions

2022-09-02 Thread Andres Freund
Hi, On 2022-09-02 16:29:22 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2022-09-02 15:08:01 -0400, Tom Lane wrote: > >> As fodder for discussion, here's a scraping of the currently-tested > >> versions. (This counts only animals running configure, ie not MSVC. > >> Also, my query

Re: Minimum bison and flex versions

2022-09-02 Thread Tom Lane
Andres Freund writes: > On 2022-09-02 15:08:01 -0400, Tom Lane wrote: >> As fodder for discussion, here's a scraping of the currently-tested >> versions. (This counts only animals running configure, ie not MSVC. >> Also, my query looked back a few months, so some recently-dead >> animals are

Re: Minimum bison and flex versions

2022-09-02 Thread Andres Freund
Hi, On 2022-09-02 15:08:01 -0400, Tom Lane wrote: > As fodder for discussion, here's a scraping of the currently-tested > versions. (This counts only animals running configure, ie not MSVC. > Also, my query looked back a few months, so some recently-dead > animals are still here.) If we also

Re: Fix typo function circle_same (src/backend/utils/adt/geo_ops.c)

2022-09-02 Thread Daniel Gustafsson
> On 2 Sep 2022, at 21:22, Ranier Vilela wrote: > > Em sex., 2 de set. de 2022 às 16:15, Daniel Gustafsson > escreveu: > > On 2 Sep 2022, at 21:08, Ranier Vilela > > wrote: > > > At function circle_same the second isnan test is wrong. > >

Re: Fix typo function circle_same (src/backend/utils/adt/geo_ops.c)

2022-09-02 Thread Ranier Vilela
Em sex., 2 de set. de 2022 às 16:15, Daniel Gustafsson escreveu: > > On 2 Sep 2022, at 21:08, Ranier Vilela wrote: > > > At function circle_same the second isnan test is wrong. > > Yeah, that seems pretty wrong. Did you attempt to procure a test for when > this > yields the wrong result? > Hi

Re: minimum perl version

2022-09-02 Thread Daniel Gustafsson
> On 2 Sep 2022, at 21:11, Tom Lane wrote: > > Andres Freund writes: >> 5.14 would be a trivial lift as far as the buildfarm is concerned. > > Yeah, that seems like a reasonable new minimum for Perl. I might > see about setting up an animal running 5.14.0, just so we can say > "5.14" in the

Re: Fix typo function circle_same (src/backend/utils/adt/geo_ops.c)

2022-09-02 Thread Daniel Gustafsson
> On 2 Sep 2022, at 21:08, Ranier Vilela wrote: > At function circle_same the second isnan test is wrong. Yeah, that seems pretty wrong. Did you attempt to procure a test for when this yields the wrong result? -- Daniel Gustafsson https://vmware.com/

Re: minimum perl version

2022-09-02 Thread Tom Lane
Andres Freund writes: > 5.14 would be a trivial lift as far as the buildfarm is concerned. Yeah, that seems like a reasonable new minimum for Perl. I might see about setting up an animal running 5.14.0, just so we can say "5.14" in the docs without fine print. regards,

Fix typo function circle_same (src/backend/utils/adt/geo_ops.c)

2022-09-02 Thread Ranier Vilela
Hi, I think that this is a typo. At function circle_same the second isnan test is wrong. Attached fix patch. regards, Ranier Vilela 0001-fix-typo-isnan-test-geo_ops.patch Description: Binary data

Minimum bison and flex versions

2022-09-02 Thread Tom Lane
Per the meson thread, we also need to have a conversation about what's the oldest bison and flex versions still worth supporting. The ones that had been our reference points are no longer represented in the buildfarm, and it seems not likely to be worth resurrecting copies of those. As fodder for

Re: minimum perl version

2022-09-02 Thread Andres Freund
Hi, On 2022-09-02 14:31:57 -0400, Tom Lane wrote: > Andres Freund writes: > > I started a query on the buildfarm machine to collect the perl versions, but > > it's just awfully slow... > > This is from March, but it's probably still accurate enough. Thanks. Mine did just finish. Over the last

Re: Remove dead code from sepgsql

2022-09-02 Thread Daniel Gustafsson
> On 2 Sep 2022, at 17:55, Robert Haas wrote: > > On Fri, Sep 2, 2022 at 5:56 AM Daniel Gustafsson wrote: >> Commit 4232c4b40 introduced userspace access vector cache in sepgsql, and >> removed all callers of sepgsql_check_perms. Searching the usual repos for >> usage in 3rd party code comes

Re: minimum perl version

2022-09-02 Thread Tom Lane
Andres Freund writes: > I started a query on the buildfarm machine to collect the perl versions, but > it's just awfully slow... This is from March, but it's probably still accurate enough. regards, tom lane sysname| snapshot | l

Re: build remaining Flex files standalone

2022-09-02 Thread Andres Freund
Hi John, Are you planning to press ahead with these? > Subject: [PATCH v4 01/11] Preparatory refactoring for compiling guc-file.c > standalone > Subject: [PATCH v4 02/11] Move private declarations shared between guc.c and > guc-file.l to new header > Subject: [PATCH v4 03/11] Build guc-file.c

minimum perl version

2022-09-02 Thread Andres Freund
Hi, Split off from the meson thread at https://postgr.es/m/990067.1662138678%40sss.pgh.pa.us On 2022-09-02 13:11:18 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2022-09-02 14:17:26 +0700, John Naylor wrote: > >> + # FIXME: -output option is only available in perl 5.9.3 - but that's >

Re: failing to build preproc.c on solaris with sun studio

2022-09-02 Thread Tom Lane
Andres Freund writes: > I also wonder if we shouldn't just make ecpg optional at some point. Or even > move it out of the tree. The reason it's in the tree is to ensure its grammar stays in sync with the core grammar, and perhaps more to the point, that it's possible to build its grammar at all.

Re: failing to build preproc.c on solaris with sun studio

2022-09-02 Thread Andres Freund
Hi, On 2022-08-07 14:47:36 +0700, John Naylor wrote: > Playing around with the compiler flags on preproc.c, I get these > compile times, gcc memory usage as reported by /usr/bin/time -v , and > symbol sizes (non-debug build): > > -O2: > time 8.0s > Maximum resident set size (kbytes): 255884 > >

Re: [RFC] building postgres with meson - v11

2022-09-02 Thread samay sharma
On Thu, Sep 1, 2022 at 4:12 PM samay sharma wrote: > Hi, > > On Wed, Aug 31, 2022 at 1:42 AM Peter Eisentraut < > peter.eisentr...@enterprisedb.com> wrote: > >> On 24.08.22 17:30, Andres Freund wrote: >> >> 0545eec895 meson: Add docs >> >> >> >> We should think more about how to arrange the

Re: [RFC] building postgres with meson - v12

2022-09-02 Thread Tom Lane
Andres Freund writes: > On 2022-09-02 14:17:26 +0700, John Naylor wrote: >> + # FIXME: -output option is only available in perl 5.9.3 - but that's >> + # probably a fine minimum requirement? >> >> Since we've retired some buildfarm animals recently, it seems the >> oldest perl there is 5.14?

Re: [RFC] building postgres with meson - v12

2022-09-02 Thread Andres Freund
Hi, On 2022-09-02 09:35:15 -0700, Andres Freund wrote: > Part of that is due to some ugly dependencies of src/common on backend headers > that IMO probably shouldn't exist (e.g. src/common/relpath.c includes > catalog/pg_tablespace_d.h). Looks like it'd not be hard to get at least the > _shlib

Re: On login trigger: take three

2022-09-02 Thread Zhihong Yu
On Fri, Sep 2, 2022 at 8:37 AM Daniel Gustafsson wrote: > This had bitrotted a fair bit, attached is a rebase along with (mostly) > documentation fixes. 0001 adds a generic GUC for ignoring event triggers > and > 0002 adds the login event with event trigger support, and hooks it up to > the >

Re: Remove dead code from sepgsql

2022-09-02 Thread Robert Haas
On Fri, Sep 2, 2022 at 5:56 AM Daniel Gustafsson wrote: > Commit 4232c4b40 introduced userspace access vector cache in sepgsql, and > removed all callers of sepgsql_check_perms. Searching the usual repos for > usage in 3rd party code comes up blank. Is there any reason not to remove it > as per

walmethods.c/h are doing some strange things

2022-09-02 Thread Robert Haas
Hi, We have a number of places in the system where we are using object-oriented design patterns. For example, a foreign data wrapper returns a table of function pointers which are basically methods for operating on a planner or executor node that corresponds to a foreign table that uses that

Re: [PATCH] docs: Document the automatically generated names for indices

2022-09-02 Thread Bruce Momjian
On Thu, Sep 1, 2022 at 05:47:11PM -0700, ja...@mercury.com wrote: > From: Jade Lovelace > > I have intentionally been careful to not guarantee that the > automatically generated name *is* what's documented, but instead give > the general idea. > > Knowing the format is useful for people

Re: On login trigger: take three

2022-09-02 Thread Daniel Gustafsson
This had bitrotted a fair bit, attached is a rebase along with (mostly) documentation fixes. 0001 adds a generic GUC for ignoring event triggers and 0002 adds the login event with event trigger support, and hooks it up to the GUC such that broken triggers wont require single-user mode. Moving

json docs fix jsonb_path_exists_tz again

2022-09-02 Thread Erik Rijkers
In funcs.sgml, the value fed into jsonb_path_exists_tz was wrong; fixed as attached. (was inadvertently reverted with the big JSON revert) Erik Rijkers--- doc/src/sgml/func.sgml.orig 2022-09-02 16:16:21.406405542 +0200 +++ doc/src/sgml/func.sgml 2022-09-02 16:17:41.751838806 +0200 @@ -16533,7

Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints

2022-09-02 Thread Dilip Kumar
On Fri, Sep 2, 2022 at 5:25 PM Justin Pryzby wrote: > > On Tue, Aug 02, 2022 at 12:50:43PM -0500, Justin Pryzby wrote: > > Also, if I understand correctly, this patch seems to assume that nobody is > > connected to the source database. But what's actually enforced is just that > > nobody *else*

Re: allowing for control over SET ROLE

2022-09-02 Thread Robert Haas
On Fri, Sep 2, 2022 at 3:20 AM Wolfgang Walther wrote: > The full syntax could look like this: > > GRANT { INHERIT | SET | ALL [ PRIVILEGES ] } >ON ROLE role_name [, ...] >TO role_specification [, ...] WITH GRANT OPTION >[ GRANTED BY role_specification ] > > With this new syntax, the

Re: Asynchronous execution support for Custom Scan

2022-09-02 Thread Kazutaka Onishi
Hi, Fujii-san, The asynchronous version "ctidscan" plugin is ready. Please check this. https://github.com/0-kaz/ctidscan/tree/async_sample I've confirmed this works correctly by running SQL shown below. The query plan shows 2 custom scan works asynchronously. postgres=# LOAD 'ctidscan'; LOAD

Re: Column Filtering in Logical Replication

2022-09-02 Thread Amit Kapila
On Fri, Sep 2, 2022 at 8:45 AM Peter Smith wrote: > > On Thu, Sep 1, 2022 at 7:53 PM Amit Kapila wrote: > > > > On Fri, Aug 26, 2022 at 7:33 AM Peter Smith wrote: > > > > > > > Few comments on both the patches: > > v4-0001* > > = > > 1. > > Furthermore, if the table uses > > + REPLICA

Re: pg_auth_members.grantor is bunk

2022-09-02 Thread Robert Haas
Thanks for having a look. On Thu, Sep 1, 2022 at 4:34 PM Jeff Davis wrote: > There's still some weirdness around superusers: > > 1. "GRANTED BY current_user" differs from not specifying "GRANTED BY" > at all. Yes. I figured that, when GRANTED BY is not specified, it is OK to infer a valid

Re: Missing CFI in iterate_word_similarity()

2022-09-02 Thread Daniel Gustafsson
> On 2 Sep 2022, at 15:16, Tom Lane wrote: > What's annoying me about the one-liner fix is that it makes it > look like CFI is part of the "Get index" action. Thats a good point, I'll split the code up to make it clearer. -- Daniel Gustafsson https://vmware.com/

Re: windows resource files, bugs and what do we actually want

2022-09-02 Thread Magnus Hagander
On Fri, Sep 2, 2022 at 3:26 AM Andres Freund wrote: > Hi, > > On 2022-08-29 15:13:14 -0700, Andres Freund wrote: > > 1) For make based builds, all libraries that are built with MODULES > rather > >than MODULES_big have the wrong "FILETYPE", because Makefile.win32 > checks > >$(shlib),

Re: Missing CFI in iterate_word_similarity()

2022-09-02 Thread Tom Lane
Daniel Gustafsson writes: >> On 2 Sep 2022, at 14:57, Tom Lane wrote: >> I noticed the same thing, but sticking the CFI immediately after the >> declaration didn't read well either. I was considering moving it to >> the bottom of the loop instead of that. > I was contemplating that too, but

Re: Missing CFI in iterate_word_similarity()

2022-09-02 Thread Daniel Gustafsson
> On 2 Sep 2022, at 14:57, Tom Lane wrote: > > Daniel Gustafsson writes: >> Placing code before declarations will generate a compiler warning, so the >> check >> must go after trgindex is declared. I've fixed that in the attached to get >> the >> cfbot green. Marking this ready for

Re: Missing CFI in iterate_word_similarity()

2022-09-02 Thread Tom Lane
Daniel Gustafsson writes: > Placing code before declarations will generate a compiler warning, so the > check > must go after trgindex is declared. I've fixed that in the attached to get > the > cfbot green. Marking this ready for committer in the meantime. I noticed the same thing, but

Re: broken table formatting in psql

2022-09-02 Thread Alvaro Herrera
On 2022-Sep-02, Kyotaro Horiguchi wrote: > UnicodeData.txt > 174:00AD;SOFT HYPHEN;Cf;0;BN;N; > > Soft-hyphen seems like not zero-width.. usually... Soft-hyphen *is* zero width. It should not be displayed. It's just a marker so that typesetting software knows where to add real

Re: Fix possible bogus array out of bonds (src/backend/access/brin/brin_minmax_multi.c)

2022-09-02 Thread Ranier Vilela
Em sex., 2 de set. de 2022 às 09:01, Justin Pryzby escreveu: > On Mon, Aug 29, 2022 at 10:06:55AM +0900, Kyotaro Horiguchi wrote: > > At Fri, 26 Aug 2022 10:28:50 -0300, Ranier Vilela > wrote in > > > At function has_matching_range, if variable ranges->nranges == 0, > > > we exit quickly with a

Re: Missing CFI in iterate_word_similarity()

2022-09-02 Thread Daniel Gustafsson
> On 2 Aug 2022, at 04:41, Robins Tharakan wrote: > For long strings, iterate_word_similarity() can run into long-running > tight-loops without honouring interrupts or statement_timeouts. > Adding CHECK_FOR_INTERRUPTS() ensures that such queries respond to > statement_timeout & Ctrl-C signals.

Re: make additional use of optimized linear search routines

2022-09-02 Thread Richard Guo
On Fri, Sep 2, 2022 at 2:52 AM Nathan Bossart wrote: > I'm hoping to spend a bit more time looking for additional applications of > the pg_lfind*() suite of functions (and anywhere else where SIMD might be > useful, really). If you have any ideas in mind, I'm all ears. +1 for the proposal. I

Re: Fix possible bogus array out of bonds (src/backend/access/brin/brin_minmax_multi.c)

2022-09-02 Thread Justin Pryzby
On Mon, Aug 29, 2022 at 10:06:55AM +0900, Kyotaro Horiguchi wrote: > At Fri, 26 Aug 2022 10:28:50 -0300, Ranier Vilela wrote > in > > At function has_matching_range, if variable ranges->nranges == 0, > > we exit quickly with a result equal to false. > > > > This means that nranges can be zero.

Re: SQL/JSON features for v15

2022-09-02 Thread Justin Pryzby
On Wed, Aug 31, 2022 at 03:51:18PM +0900, Amit Langote wrote: > Finally, I get this warning: > > execExprInterp.c: In function ‘ExecJsonCoerceCStringToText’: > execExprInterp.c:4765:3: warning: missing braces around initializer > [-Wmissing-braces] >NameData encoding = {0}; >^ >

Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints

2022-09-02 Thread Justin Pryzby
On Tue, Aug 02, 2022 at 12:50:43PM -0500, Justin Pryzby wrote: > Also, if I understand correctly, this patch seems to assume that nobody is > connected to the source database. But what's actually enforced is just that > nobody *else* is connected. Is it any issue that the current DB can be used

Re: Different compression methods for FPI

2022-09-02 Thread Justin Pryzby
On Sun, Jun 13, 2021 at 08:24:12PM -0500, Justin Pryzby wrote: > In this patch series, I added compression information to the errcontext from > xlog_block_info(), and allow specifying compression levels like zlib-2. I'll > rearrange that commit earlier if we decide that's desirable to include.

Re: [POC] Allow flattening of subquery with a link to upper query

2022-09-02 Thread Andrey Lepikhov
On 9/1/22 17:24, Richard Guo wrote: On Wed, Aug 31, 2022 at 2:35 PM Andrey Lepikhov mailto:a.lepik...@postgrespro.ru>> wrote: Before flattening procedure we just look through the quals of subquery, pull to the upper level OpExpr's containing variables from the upper relation and

RE: test_decoding assertion failure for the loss of top-sub transaction relationship

2022-09-02 Thread kuroda.hay...@fujitsu.com
> > I'm basically fine, too. But this is a bug that needs back-patching > > back to 10. > > > > I have not verified but I think we need to backpatch this till 14 > because prior to that in DecodeCommit, we use to set the top-level txn > as having catalog changes based on the if there are

Re: [PATCH] Compression dictionaries for JSONB

2022-09-02 Thread Aleksander Alekseev
Hi hackers, Here is the rebased version of the patch. > I invite anyone interested to join this effort as a co-author! (since, > honestly, rewriting the same feature over and over again alone is > quite boring :D). > Overall structure could look like this: > pg_dict >| >| dictionary

Re: Handle infinite recursion in logical replication setup

2022-09-02 Thread vignesh C
On Fri, 2 Sept 2022 at 13:51, Peter Smith wrote: > > Here are my review comments for the latest patch v44-0001. > > == > > 1. doc/src/sgml/logical-replication.sgml > > + > + Specifying origins for subscription > > I thought the title is OK, but maybe can be better. OTOH, I am not > sure if

Re: Handle infinite recursion in logical replication setup

2022-09-02 Thread vignesh C
On Mon, 29 Aug 2022 at 16:35, Amit Kapila wrote: > > On Wed, Aug 24, 2022 at 7:27 PM vignesh C wrote: > > > > Since there was no objections to change it to throw a warning, I have > > made the changes for the same. > > > > Review comments for v42-0001* > == > 1. Can we

Re: test_decoding assertion failure for the loss of top-sub transaction relationship

2022-09-02 Thread Amit Kapila
On Fri, Sep 2, 2022 at 12:25 PM Kyotaro Horiguchi wrote: > > At Fri, 2 Sep 2022 11:27:23 +0530, Dilip Kumar wrote > in > > On Fri, Sep 2, 2022 at 11:25 AM kuroda.hay...@fujitsu.com > > wrote: > > > How about following? > > > > > > diff --git a/src/backend/replication/logical/snapbuild.c > > >

Re: Clarify restriction on partitioned tables primary key / unique indexes

2022-09-02 Thread David Rowley
On Fri, 2 Sept 2022 at 22:01, Erik Rijkers wrote: > Minimal changes: > > 'To create a unique or primary key constraints on partitioned table' > > should be > > 'To create unique or primary key constraints on partitioned tables' Thanks. I ended up adjusting it to: "To create a unique or primary

Re: Updatable Views and INSERT INTO ... ON CONFLICT

2022-09-02 Thread walther
Joel Jacobson: I note it's not yet possible to INSERT INTO an Updatable View using the ON CONFLICT feature. To be clear, it seems to be supported for AUTO-updatable views and for views with manually created RULES, but not for views with INSTEAD OF triggers. Not saying it is desired, just

Re: Clarify restriction on partitioned tables primary key / unique indexes

2022-09-02 Thread Erik Rijkers
Op 02-09-2022 om 11:44 schreef David Rowley: Over on [1], there was a question about why it wasn't possible to create the following table: CREATE TABLE foobar( id BIGINT NOT NULL PRIMARY KEY, baz VARCHAR NULL DEFAULT NULL ) PARTITION BY HASH(my_func(id)); The attached attempts to

Remove dead code from sepgsql

2022-09-02 Thread Daniel Gustafsson
Commit 4232c4b40 introduced userspace access vector cache in sepgsql, and removed all callers of sepgsql_check_perms. Searching the usual repos for usage in 3rd party code comes up blank. Is there any reason not to remove it as per the attached? -- Daniel Gustafsson

Clarify restriction on partitioned tables primary key / unique indexes

2022-09-02 Thread David Rowley
Over on [1], there was a question about why it wasn't possible to create the following table: CREATE TABLE foobar( id BIGINT NOT NULL PRIMARY KEY, baz VARCHAR NULL DEFAULT NULL ) PARTITION BY HASH(my_func(id)); The above is disallowed by 2 checks in DefineIndex(). 1. If the partitioned

Re: Allow foreign keys to reference a superset of unique columns

2022-09-02 Thread Wolfgang Walther
Kaiting Chen: I'd like to propose a change to PostgreSQL to allow the creation of a foreign key constraint referencing a superset of uniquely constrained columns. +1 Tom Lane: TBH, I think this is a fundamentally bad idea and should be rejected outright. It fuzzes the semantics of the FK

Re: add test: pg_rowlocks extension

2022-09-02 Thread Dong Wook Lee
On Fri, Sep 2, 2022 at 4:07 AM Tom Lane wrote: > Pushed with some revisions. Notably, I didn't see any point in > repeating each test case four times, so I trimmed it down to once > per case. I checked it. Thank you for correcting it in a better way.

Re: plpgsql-trigger.html: Format TG_ variables as table (patch)

2022-09-02 Thread Daniel Gustafsson
> On 1 Sep 2022, at 15:07, Christoph Berg wrote: > Re: Dagfinn Ilmari Mannsåker >>> I also shortened some "name of table" to just "table". Since the data >>> type is "name", it's clear what "table" means. >> >> I think it reads better with the definite article and initial capital, >> e.g. "The

Re: Add the ability to limit the amount of memory that can be allocated to backends.

2022-09-02 Thread David Rowley
On Thu, 1 Sept 2022 at 04:52, Reid Thompson wrote: > Add the ability to limit the amount of memory that can be allocated to > backends. Are you aware that relcache entries are stored in backend local memory and that once we've added a relcache entry for a relation that we have no current code

Re: Handle infinite recursion in logical replication setup

2022-09-02 Thread Peter Smith
On Fri, Sep 2, 2022 at 6:21 PM Peter Smith wrote: > > Here are my review comments for the latest patch v44-0001. > ... > > 6. src/backend/commands/subscriptioncmds.c > > + if (bsearch(, subrel_local_oids, > + subrel_count, sizeof(Oid), oid_cmp)) > + isnewtable = false; > > SUGGESTION (search PG

Re: Handle infinite recursion in logical replication setup

2022-09-02 Thread Peter Smith
Here are my review comments for the latest patch v44-0001. == 1. doc/src/sgml/logical-replication.sgml + + Specifying origins for subscription I thought the title is OK, but maybe can be better. OTOH, I am not sure if my suggestions below are improvements or not. Anyway, even if the

Re: broken table formatting in psql

2022-09-02 Thread Kyotaro Horiguchi
At Fri, 2 Sep 2022 13:43:50 +0700, John Naylor wrote in > On Fri, Sep 2, 2022 at 12:17 PM Kyotaro Horiguchi > wrote: > > > Including them into unicode_combining_table.h actually worked, but I'm > > > not sure it is valid to include Cf's among Mn/Me's.. > > Looking at the definition, Cf means

Re: [Commitfest 2022-09] Begins This Thursday

2022-09-02 Thread Michael Paquier
On Sun, Aug 28, 2022 at 12:28:26AM +0500, Ibrar Ahmed wrote: > Just a reminder that September 2022 commitfest will begin this > > coming Thursday, September 1. We are the 1st of September AoE [1], so I have taken the liberty to switch the CF as in progress. [1]:

Re: Reducing the chunk header sizes on all memory context types

2022-09-02 Thread David Rowley
On Thu, 1 Sept 2022 at 12:46, Tom Lane wrote: > > David Rowley writes: > > Maybe we should just consider always making room for a sentinel for > > chunks that are on dedicated blocks. At most that's an extra 8 bytes > > in some allocation that's either over 1024 or 8192 (depending on > >

Re: Avoid erroring out when unable to remove or parse logical rewrite files to save checkpoint work

2022-09-02 Thread Michael Paquier
On Wed, Aug 31, 2022 at 04:10:59PM +0900, Michael Paquier wrote: > Yeah, what you have here looks pretty fine to me, so this is IMO > committable. Let's wait a bit to see if there are any objections from > the others, in case. I had a few hours and I've spent them looking at what you had here in

Re: struct Trigger definition in trigger.sgml

2022-09-02 Thread Etsuro Fujita
Hi Richard, On Thu, Sep 1, 2022 at 4:29 PM Richard Guo wrote: > On Thu, Sep 1, 2022 at 2:18 PM Etsuro Fujita wrote: >> While working on something else, I noticed that commit 487e9861d added >> a new field to struct Trigger, but failed to update $SUBJECT to match. >> Attached is a small patch

Re: pg_receivewal and SIGTERM

2022-09-02 Thread Daniel Gustafsson
> On 2 Sep 2022, at 10:00, Michael Paquier wrote: > > On Fri, Aug 26, 2022 at 09:51:26AM +0900, Michael Paquier wrote: >> Fine by me if both you and Daniel want to be more careful with this >> change. We could always argue about a backpatch later if there is >> more ask for it, as well. > >

Re: pg_receivewal and SIGTERM

2022-09-02 Thread Michael Paquier
On Fri, Aug 26, 2022 at 09:51:26AM +0900, Michael Paquier wrote: > Fine by me if both you and Daniel want to be more careful with this > change. We could always argue about a backpatch later if there is > more ask for it, as well. Daniel, are you planning to apply this one on HEAD? -- Michael

Re: allowing for control over SET ROLE

2022-09-02 Thread Wolfgang Walther
Robert Haas: Beginning in e3ce2de09d814f8770b2e3b3c152b7671bcdb83f, the inheritance behavior of role-grants can be overridden for individual grants, so that some grants are inherited and others are not. That's a great thing to have! However, there is no similar facility for controlling

Re: [RFC] building postgres with meson - v12

2022-09-02 Thread John Naylor
On Thu, Sep 1, 2022 at 1:12 AM Andres Freund wrote: > [v12] +# Build a small utility static lib for the parser. This makes it easier to not +# depend on gram.h already having been generated for most of the other code +# (which depends on generated headers having been generated). The generation

Re: test_decoding assertion failure for the loss of top-sub transaction relationship

2022-09-02 Thread Kyotaro Horiguchi
At Fri, 2 Sep 2022 11:27:23 +0530, Dilip Kumar wrote in > On Fri, Sep 2, 2022 at 11:25 AM kuroda.hay...@fujitsu.com > wrote: > > How about following? > > > > diff --git a/src/backend/replication/logical/snapbuild.c > > b/src/backend/replication/logical/snapbuild.c > > index

  1   2   >