Re: printf %s with NULL pointer (was Re: BUG #17098: Assert failed on composing an error message when adding a type to an extension being dropped)

2021-07-12 Thread Laurenz Albe
On Mon, 2021-07-12 at 13:20 -0400, Tom Lane wrote: > > However, that root issue is converted from a relatively minor bug into > > a server crash because snprintf.c treats a NULL pointer passed to %s > > as a crash-worthy error. I have advocated for that behavior in the > > past, but I'm starting

Re: Failed transaction statistics to measure the logical replication progress

2021-07-12 Thread vignesh C
On Thu, Jul 8, 2021 at 12:25 PM osumi.takami...@fujitsu.com wrote: > > Hello, hackers > > > When the current HEAD fails during logical decoding, the failure > increments txns count in pg_stat_replication_slots - [1] and adds > the transaction size to the sum of bytes in the same repeatedly > on

Re: [HACKERS] WIP aPatch: Pgbench Serialization and deadlock errors

2021-07-12 Thread Tatsuo Ishii
>> > I would tend to agree with this behavior, that is not to start any new >> > transaction or transaction attempt once -T has expired. > > That is the behavior in the latest patch. Once -T has expired, any new > transaction or retry does not start. Actually v14 has not changed the behavior in

Re: row filtering for logical replication

2021-07-12 Thread Amit Kapila
On Mon, Jul 12, 2021 at 3:01 PM Tomas Vondra wrote: > > On 7/12/21 6:46 AM, Amit Kapila wrote: > > On Mon, Jul 12, 2021 at 7:19 AM Alvaro Herrera > > wrote: > > > Now, the other idea I had in mind was to traverse the WHERE clause > > expression in publication_add_relation and identify if it

Re: Add proper planner support for ORDER BY / DISTINCT aggregates

2021-07-12 Thread David Rowley
Thanks for having a look at this. On Tue, 13 Jul 2021 at 11:04, Ranier Vilela wrote: >> 0001 Adds planner support for ORDER BY aggregates. > > /* Normal transition function without ORDER BY / DISTINCT. */ > Is it possible to avoid entering to initialize args if 'argno >= >

Re: proposal - psql - use pager for \watch command

2021-07-12 Thread Pavel Stehule
út 13. 7. 2021 v 2:01 odesílatel Thomas Munro napsal: > On Tue, Jul 13, 2021 at 8:20 AM Pavel Stehule > wrote: > > po 12. 7. 2021 v 18:12 odesílatel vignesh C > napsal: > >> Thanks for fixing the comments, CFbot also passes for the same. I have > >> changed the status back to "Ready for

Re: [HACKERS] WIP aPatch: Pgbench Serialization and deadlock errors

2021-07-12 Thread Yugo NAGATA
On Tue, 13 Jul 2021 13:00:49 +0900 (JST) Tatsuo Ishii wrote: > >>> Or, we should terminate the last cycle of benchmark regardless it is > >>> retrying or not if -T expires. This will make pgbench behaves much > >>> more consistent. > > > > I would tend to agree with this behavior, that is not

Re: Diagnostic comment in LogicalIncreaseXminForSlot

2021-07-12 Thread Ashutosh Bapat
On Mon, Jul 12, 2021 at 6:23 PM Amit Kapila wrote: > On Mon, Jul 12, 2021 at 5:28 PM Ashutosh Bapat > wrote: > > > > On Mon, Jul 12, 2021 at 8:39 AM Amit Kapila > wrote: > >> > >> I have noticed that > >> a nearby function LogicalIncreaseRestartDecodingForSlot() logs similar > >> information

Re: Bogus HAVE_DECL_FOO entries in msvc/Solution.pm

2021-07-12 Thread Tom Lane
Michael Paquier writes: > On Mon, Jul 12, 2021 at 07:46:32PM -0400, Tom Lane wrote: >> Autoconf's AC_CHECK_DECLS always defines HAVE_DECL_whatever >> as 1 or 0, but some of the entries in msvc/Solution.pm show >> such symbols as "undef" instead. Shouldn't we fix it as >> per attached? This is

Re: Bogus HAVE_DECL_FOO entries in msvc/Solution.pm

2021-07-12 Thread Peter Eisentraut
On 13.07.21 01:46, Tom Lane wrote: Autoconf's AC_CHECK_DECLS always defines HAVE_DECL_whatever as 1 or 0, but some of the entries in msvc/Solution.pm show such symbols as "undef" instead. Shouldn't we fix it as per attached? This is probably only cosmetic at the moment, but it could bite us

RE: Transactions involving multiple postgres foreign servers, take 2

2021-07-12 Thread r.takahash...@fujitsu.com
Hi Sawada-san, Thank you for your reply. > Not sure but it might be possible to keep holding an xlogreader for > reading PREPARE WAL records even after the transaction commit. But I > wonder how much open() for wal segment file accounts for the total > execution time of 2PC. 2PC requires 2

Re: [HACKERS] WIP aPatch: Pgbench Serialization and deadlock errors

2021-07-12 Thread Tatsuo Ishii
>>> Or, we should terminate the last cycle of benchmark regardless it is >>> retrying or not if -T expires. This will make pgbench behaves much >>> more consistent. > > I would tend to agree with this behavior, that is not to start any new > transaction or transaction attempt once -T has expired.

Re: [CLOBBER_CACHE]Server crashed with segfault 11 while executing clusterdb

2021-07-12 Thread Amul Sul
Thanks a lot Tom. On Tue, Jul 13, 2021 at 2:37 AM Tom Lane wrote: > > Amul Sul writes: > > [ v5_Add-RelationGetSmgr-inline-function.patch ] > > Pushed with minor cosmetic adjustments. > > RelationCopyStorage() kind of gives me the willies. > It's not really an smgr-level function, but we call

Re: row filtering for logical replication

2021-07-12 Thread Peter Smith
On Mon, Jul 12, 2021 at 5:39 AM Euler Taveira wrote: > > On Fri, Jul 2, 2021, at 4:29 AM, Peter Smith wrote: > > Hi. > > I have been looking at the latest patch set (v16). Below are my review > comments and some patches. > > Peter, thanks for your detailed review. Comments are inline. > Hi

Re: [PATCH] Use optimized single-datum tuplesort in ExecSort

2021-07-12 Thread David Rowley
On Tue, 13 Jul 2021 at 01:59, Ronan Dunklau wrote: > > 3. This seems to be a bug fix where byval datum sorts do not properly > > handle bounded sorts. I think that maybe that should be fixed and > > backpatched. I don't see anything that says Datum sorts can't be > > bounded and if there were

Question about non-blocking mode in libpq

2021-07-12 Thread Yugo NAGATA
Hello, During reading the documentation of libpq [1] , I found the following description: In the nonblocking state, calls to PQsendQuery, PQputline, PQputnbytes, PQputCopyData, and PQendcopy will not block but instead return an error if they need to be called again. [1]

Re: Synchronous commit behavior during network outage

2021-07-12 Thread Jeff Davis
On Fri, 2021-07-09 at 23:10 +0500, Andrey Borodin wrote: > In my experience SIGTERM coped fine so far. OK. I don't think ignoring SIGTERM in the way my patch does it is a great solution, and it's not getting much support, so I think I'll back away from that idea. I had a separate discussion with

Re: Remove useless int64 range checks on BIGINT sequence MINVALUE/MAXVALUE values

2021-07-12 Thread David Rowley
On Tue, 13 Jul 2021 at 06:50, Peter Eisentraut wrote: > Your version looks better to me than the original version, but I'm still > -0.05 on changing this at all. I was more +0.4. It does not seem worth the trouble of too much discussion so, just to try and bring this to a close, instead of

Re: Bogus HAVE_DECL_FOO entries in msvc/Solution.pm

2021-07-12 Thread Michael Paquier
On Mon, Jul 12, 2021 at 07:46:32PM -0400, Tom Lane wrote: > Autoconf's AC_CHECK_DECLS always defines HAVE_DECL_whatever > as 1 or 0, but some of the entries in msvc/Solution.pm show > such symbols as "undef" instead. Shouldn't we fix it as > per attached? This is probably only cosmetic at the

Re: O_DIRECT on macOS

2021-07-12 Thread Andres Freund
Hi, On 2021-07-13 13:25:50 +1200, Thomas Munro wrote: > On Mon, May 31, 2021 at 10:29 AM Thomas Munro wrote: > > For comparison, here is my sketch of idea #1. I pick an arbitrary > > value to use as PG_O_DIRECT (I don't want to define O_DIRECT for fear > > of breaking other code that might see

Re: Introduce pg_receivewal gzip compression tests

2021-07-12 Thread Michael Paquier
On Mon, Jul 12, 2021 at 04:46:29PM +, gkokola...@pm.me wrote: > On Monday, July 12th, 2021 at 17:07, wrote: >> ‐‐‐ Original Message ‐‐‐ Are you using outlook? The format of your messages gets blurry on the PG website, so does it for me. >> I am admittedly not so well versed on

Re: Is tuplesort meant to support bounded datum sorts?

2021-07-12 Thread David Rowley
On Tue, 13 Jul 2021 at 04:10, Tom Lane wrote: > > David Rowley writes: > > It looks like this has likely never come up before because the only > > time we use tuplesort_set_bound() is in nodeSort.c and > > nodeIncrementalSort.c, none of those currently use datum sorts. > > However, I'm thinking

Re: O_DIRECT on macOS

2021-07-12 Thread Thomas Munro
On Mon, May 31, 2021 at 10:29 AM Thomas Munro wrote: > For comparison, here is my sketch of idea #1. I pick an arbitrary > value to use as PG_O_DIRECT (I don't want to define O_DIRECT for fear > of breaking other code that might see it and try to pass it into > open()... for all I know, it might

Re: Fix comments of heap_prune_chain()

2021-07-12 Thread Kyotaro Horiguchi
(This is out of topic) At Mon, 12 Jul 2021 20:17:55 -0400, Alvaro Herrera wrote in > Oh, apologies, I didn't realize there was an attachment. That seems > specific enough :-) > > In my defense, the archives don't show the attachment either: >

Re: Small documentation improvement for ALTER SUBSCRIPTION

2021-07-12 Thread Masahiko Sawada
Hi, On Thu, Jul 8, 2021 at 10:14 PM Daniel Gustafsson wrote: > > > On 8 Jul 2021, at 15:00, Masahiko Sawada wrote: > > > I think we can improve it by changing to > > 'refresh_option'. Thoughts? > > My first thought was that the existing wording is clearer, referring to > “options to refresh”.

Re: [PATCH] Pull general SASL framework out of SCRAM

2021-07-12 Thread Michael Paquier
On Tue, Jul 13, 2021 at 12:01:46AM +, Jacob Champion wrote: > Ah, right. I think the (!done && !success) case is probably indicative > of an API smell, but that's probably something to clean up in a future > pass. Yeah, agreed. I feel that it would should be cleaner to replace those two

Re: Incorrect usage of strtol, atoi for non-numeric junk inputs

2021-07-12 Thread Michael Paquier
On Fri, Jul 09, 2021 at 04:50:28PM +0900, Kyotaro Horiguchi wrote: > At Fri, 9 Jul 2021 10:29:07 +0900, Michael Paquier > wrote in >> Er, wait. We've actually allowed negative values for pg_ctl >> --timeout or the subcommand kill!? > > --timeout accepts values less than 1, which values cause

Re: Fix comments of heap_prune_chain()

2021-07-12 Thread Alvaro Herrera
On 2021-Jul-12, Alvaro Herrera wrote: > On 2021-Jul-12, ikeda...@oss.nttdata.com wrote: > > > While I’m reading source codes related to vacuum, I found comments which > > don’t seem to fit the reality. I think the commit[1] just forgot to fix > > them. > > What do you think? > > > > [1] > >

Re: proposal - psql - use pager for \watch command

2021-07-12 Thread Thomas Munro
On Tue, Jul 13, 2021 at 8:20 AM Pavel Stehule wrote: > po 12. 7. 2021 v 18:12 odesílatel vignesh C napsal: >> Thanks for fixing the comments, CFbot also passes for the same. I have >> changed the status back to "Ready for Committer". > > I tested this version with the last release and with a

Re: enable_resultcache confusion

2021-07-12 Thread David Rowley
On Tue, 13 Jul 2021 at 01:38, Tom Lane wrote: > > David Rowley writes: > > On Mon, 12 Jul 2021 at 03:22, Justin Pryzby wrote: > >> |This is useful if only a small percentage of rows is checked on > >> |the inner side and is controlled by >> |

Re: [PATCH] Pull general SASL framework out of SCRAM

2021-07-12 Thread Jacob Champion
On Sun, 2021-07-11 at 13:16 +0900, Michael Paquier wrote: > On Fri, Jul 09, 2021 at 11:31:48PM +, Jacob Champion wrote: > > On Thu, 2021-07-08 at 16:27 +0900, Michael Paquier wrote: > > > + * outputlen: The length (0 or higher) of the client response > > > buffer, > > > + *

Bogus HAVE_DECL_FOO entries in msvc/Solution.pm

2021-07-12 Thread Tom Lane
Autoconf's AC_CHECK_DECLS always defines HAVE_DECL_whatever as 1 or 0, but some of the entries in msvc/Solution.pm show such symbols as "undef" instead. Shouldn't we fix it as per attached? This is probably only cosmetic at the moment, but it could bite us someday if someone wrote a complex

Re: proposal: possibility to read dumped table's name from file

2021-07-12 Thread Tom Lane
Alvaro Herrera writes: > [1] your proposal of "[+-] OBJTYPE OBJIDENT" plus empty lines allowed > plus lines starting with # are comments, seems plenty. Any line not > following that format would cause an error to be thrown. I'd like to see some kind of keyword on each line, so that we

Re: Add proper planner support for ORDER BY / DISTINCT aggregates

2021-07-12 Thread Ranier Vilela
Em seg., 12 de jul. de 2021 às 09:04, David Rowley escreveu: > On Sun, 13 Jun 2021 at 03:07, David Rowley wrote: > > > > Please find attached my WIP patch. It's WIP due to what I mentioned > > in the above paragraph and also because I've not bothered to add JIT > > support for the new

Re: [PATCH] Don't block HOT update by BRIN index

2021-07-12 Thread Josef Šimánek
po 12. 7. 2021 v 23:15 odesílatel Tomas Vondra napsal: > > > > On 7/12/21 11:02 PM, Alvaro Herrera wrote: > > On 2021-Jul-12, Josef Šimánek wrote: > > > >>> 2) Do we actually need to calculate and store hotblockingattrs > >>> separately in RelationGetIndexAttrBitmap? It seems to me it's either >

Re: [PATCH] Don't block HOT update by BRIN index

2021-07-12 Thread Alvaro Herrera
On 2021-Jul-12, Tomas Vondra wrote: > I'm not sure how to verify no external code depends on that flag. I have > no idea if there's a plausible use case for it, though. But we don't *have* to, do we? -- Álvaro Herrera Valdivia, Chile — https://www.EnterpriseDB.com/ "Tiene valor

Re: proposal: possibility to read dumped table's name from file

2021-07-12 Thread Alvaro Herrera
On 2021-Jul-13, Tomas Vondra wrote: > I'm not going to fight against some sort of versioning, but I think keeping > the scope as narrow as possible would make it unnecessary. That is, let's > stick to the original goal to allow passing filtering rules that would not > fit on the command-line, and

Re: proposal: possibility to read dumped table's name from file

2021-07-12 Thread Tomas Vondra
On 7/13/21 12:08 AM, Daniel Gustafsson wrote: On 10 Jul 2021, at 17:47, Tomas Vondra wrote: So if it was up to me, I'd go back to the original format or something close it. So something like this: [+-] OBJECT_TYPE_PATTERN OBJECT_NAME_PATTERN That still leaves the parsing with quoting and

Re: proposal: possibility to read dumped table's name from file

2021-07-12 Thread Daniel Gustafsson
> On 10 Jul 2021, at 17:47, Tomas Vondra wrote: > So if it was up to me, I'd go back to the original format or something close > it. So something like this: > > [+-] OBJECT_TYPE_PATTERN OBJECT_NAME_PATTERN That still leaves the parsing with quoting and escaping that needs to be done less

Re: [PATCH v3 1/1] Fix detection of preadv/pwritev support for OSX.

2021-07-12 Thread Tom Lane
Thomas Munro writes: > Clearly there is a more general question though, which is "should we > buy into Apple's ABI management system or not", and I don't have a > strong opinion on that. Well, I definitely don't wish to clutter our core code with any explicit dependencies on

Re: What are exactly bootstrap processes, auxiliary processes, standalone backends, normal backends(user sessions)?

2021-07-12 Thread Stephen Frost
Greetings, * Bharath Rupireddy (bharath.rupireddyforpostg...@gmail.com) wrote: > I've always had a hard time distinguishing various types of > processes/terms used in postgres. I look at the source code every time > to understand them, yet I don't feel satisfied with my understanding. > I request

Re: Support kerberos authentication for postgres_fdw

2021-07-12 Thread Stephen Frost
Greetings, * Magnus Hagander (mag...@hagander.net) wrote: > On Mon, Jul 12, 2021 at 5:43 AM Peifeng Qiu wrote: > > >As you note, this'd have to be restricted to superusers, which makes it > > >seem like a pretty bad idea. We really don't want to be in a situation > > >of pushing people to run

Re: [PATCH] Don't block HOT update by BRIN index

2021-07-12 Thread Tomas Vondra
On 7/12/21 11:02 PM, Alvaro Herrera wrote: > On 2021-Jul-12, Josef Šimánek wrote: > >>> 2) Do we actually need to calculate and store hotblockingattrs >>> separately in RelationGetIndexAttrBitmap? It seems to me it's either >>> NULL (with amhotblocking=false) or equal to indexattrs. So why not

Re: [CLOBBER_CACHE]Server crashed with segfault 11 while executing clusterdb

2021-07-12 Thread Tom Lane
Amul Sul writes: > [ v5_Add-RelationGetSmgr-inline-function.patch ] Pushed with minor cosmetic adjustments. RelationCopyStorage() kind of gives me the willies. It's not really an smgr-level function, but we call it everywhere with smgr pointers that belong to relcache entries: /* copy

Re: [PATCH] Don't block HOT update by BRIN index

2021-07-12 Thread Alvaro Herrera
On 2021-Jul-12, Josef Šimánek wrote: > > 2) Do we actually need to calculate and store hotblockingattrs > > separately in RelationGetIndexAttrBitmap? It seems to me it's either > > NULL (with amhotblocking=false) or equal to indexattrs. So why not to > > just get rid of hotblockingattr and

Re: [PATCH] Don't block HOT update by BRIN index

2021-07-12 Thread Tomas Vondra
On 7/12/21 10:55 PM, Alvaro Herrera wrote: > On 2021-Jul-12, Tomas Vondra wrote: > >> Well, one of us is confused and it might be me ;-) > > :-) > >> The point is that BRIN is the only index type with amhotblocking=false, >> so it would return NULL (and thus it does not block HOT). All other >>

Re: Fix comments of heap_prune_chain()

2021-07-12 Thread Matthias van de Meent
On Mon, 12 Jul 2021 at 13:14, wrote: > > Hi, > > While I’m reading source codes related to vacuum, I found comments which > don’t seem to fit the reality. I think the commit[1] just forgot to fix them. > What do you think? Hmm, yes, those are indeed some leftovers. Some comments on the

Re: [PATCH] Don't block HOT update by BRIN index

2021-07-12 Thread Alvaro Herrera
On 2021-Jul-12, Tomas Vondra wrote: > Well, one of us is confused and it might be me ;-) :-) > The point is that BRIN is the only index type with amhotblocking=false, > so it would return NULL (and thus it does not block HOT). All other > indexes AMs have amblocking=true and so should return

Re: [PATCH] Don't block HOT update by BRIN index

2021-07-12 Thread Tomas Vondra
On 7/12/21 10:45 PM, Josef Šimánek wrote: > po 12. 7. 2021 v 22:31 odesílatel Tomas Vondra > napsal: >> >> On 6/30/21 1:43 AM, Josef Šimánek wrote: >>> st 30. 6. 2021 v 1:20 odesílatel Tomas Vondra >>> napsal: On 6/30/21 12:53 AM, Josef Šimánek wrote: > st 30. 6. 2021

Re: [PATCH] Don't block HOT update by BRIN index

2021-07-12 Thread Josef Šimánek
po 12. 7. 2021 v 22:31 odesílatel Tomas Vondra napsal: > > On 6/30/21 1:43 AM, Josef Šimánek wrote: > > st 30. 6. 2021 v 1:20 odesílatel Tomas Vondra > > napsal: > >> > >> > >> > >> On 6/30/21 12:53 AM, Josef Šimánek wrote: > >>> st 30. 6. 2021 v 0:31 odesílatel Josef Šimánek > >>> napsal: >

Re: [PATCH v3 1/1] Fix detection of preadv/pwritev support for OSX.

2021-07-12 Thread Thomas Munro
On Tue, Jul 13, 2021 at 7:39 AM Peter Eisentraut wrote: > On 06.07.21 22:34, Tom Lane wrote: > > 2. We'd really like to use preadv/pwritev where available. > > A couple of things that I haven't seen made clear in this thread yet: > > - Where is the availability boundary for preadv/pwritev on

Re: [PATCH] Don't block HOT update by BRIN index

2021-07-12 Thread Tomas Vondra
On 7/12/21 10:37 PM, Alvaro Herrera wrote: > On 2021-Jul-12, Tomas Vondra wrote: > >> 2) Do we actually need to calculate and store hotblockingattrs >> separately in RelationGetIndexAttrBitmap? It seems to me it's either >> NULL (with amhotblocking=false) or equal to indexattrs. So why not to

Re: [PATCH] Don't block HOT update by BRIN index

2021-07-12 Thread Alvaro Herrera
On 2021-Jul-12, Tomas Vondra wrote: > 2) Do we actually need to calculate and store hotblockingattrs > separately in RelationGetIndexAttrBitmap? It seems to me it's either > NULL (with amhotblocking=false) or equal to indexattrs. So why not to > just get rid of hotblockingattr and

Re: Fix comments of heap_prune_chain()

2021-07-12 Thread Alvaro Herrera
On 2021-Jul-12, ikeda...@oss.nttdata.com wrote: > While I’m reading source codes related to vacuum, I found comments which > don’t seem to fit the reality. I think the commit[1] just forgot to fix them. > What do you think? > > [1] >

Re: [PATCH] Don't block HOT update by BRIN index

2021-07-12 Thread Tomas Vondra
On 6/30/21 1:43 AM, Josef Šimánek wrote: > st 30. 6. 2021 v 1:20 odesílatel Tomas Vondra > napsal: >> >> >> >> On 6/30/21 12:53 AM, Josef Šimánek wrote: >>> st 30. 6. 2021 v 0:31 odesílatel Josef Šimánek >>> napsal: Hello! Tomáš Vondra has shared a few ideas to improve BRIN

Re: proposal - psql - use pager for \watch command

2021-07-12 Thread Pavel Stehule
po 12. 7. 2021 v 18:12 odesílatel vignesh C napsal: > On Mon, Jul 12, 2021 at 4:29 AM Thomas Munro > wrote: > > > > On Sun, Jul 11, 2021 at 1:18 AM vignesh C wrote: > > > On Wed, May 12, 2021 at 5:45 PM Pavel Stehule > wrote: > > > > looks so with your patch psql doesn't work on ms > > > >

Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?

2021-07-12 Thread Peter Eisentraut
On 22.04.21 11:23, Julien Rouhaud wrote: The statistics gathered by the module are made available via a view named pg_stat_statements. This view - contains one row for each distinct database ID, user ID and query - ID (up to the maximum number of distinct statements that the

Re: row filtering for logical replication

2021-07-12 Thread Euler Taveira
On Mon, Jul 12, 2021, at 8:44 AM, Tomas Vondra wrote: > While looking at the other logrep patch [1] (column filtering) I noticed > Alvaro's comment regarding a new parsenode (PublicationTable) not having > read/out/equal/copy funcs. I'd bet the same thing applies here, so > perhaps see if the

Re: speed up verifying UTF-8

2021-07-12 Thread John Naylor
I wrote: > I don't think the new structuring will pose any challenges for rebasing 0002, either. This might need some experimentation, though: > > + * Subroutine of pg_utf8_verifystr() to check on char. Returns the length of the > + * character at *s in bytes, or 0 on invalid input or premature

Re: [PATCH v3 1/1] Fix detection of preadv/pwritev support for OSX.

2021-07-12 Thread Peter Eisentraut
On 06.07.21 22:34, Tom Lane wrote: 2. We'd really like to use preadv/pwritev where available. A couple of things that I haven't seen made clear in this thread yet: - Where is the availability boundary for preadv/pwritev on macOS? - What is the impact of having vs. not having these functions?

Re: Partition Check not updated when insert into a partition

2021-07-12 Thread Alvaro Herrera
On 2021-Jun-23, houzj.f...@fujitsu.com wrote: > For a multi-level partition, for example: table 'A' is partition of table > 'B', and 'B' is also partition of table 'C'. After I 'ALTER TABLE C DETACH B', > I thought partition constraint check of table 'C' does not matter anymore if > INSERT INTO

Re: Remove useless int64 range checks on BIGINT sequence MINVALUE/MAXVALUE values

2021-07-12 Thread Peter Eisentraut
On 12.07.21 10:44, David Rowley wrote: What I was trying to get to here was something that was more reasonable that might make sense to commit. I'm just not certain where Peter stands on this now that the latest patch is a net zero when it comes to adding lines. Peter? Your version looks

Re: "debug_invalidate_system_caches_always" is too long

2021-07-12 Thread Tom Lane
Noah Misch writes: > On Thu, Jul 08, 2021 at 04:34:55PM -0400, Tom Lane wrote: >> Robert Haas writes: >>> I like debug_discard_caches best. >> I can live with that. Anyone strongly against it? > I like it. Hearing no votes against, here's a proposed patch for that. (This is for HEAD; I

printf %s with NULL pointer (was Re: BUG #17098: Assert failed on composing an error message when adding a type to an extension being dropped)

2021-07-12 Thread Tom Lane
[ moved from -bugs list for more visibility ] I wrote: > However, that root issue is converted from a relatively minor bug into > a server crash because snprintf.c treats a NULL pointer passed to %s > as a crash-worthy error. I have advocated for that behavior in the > past, but I'm starting to

Re: Introduce pg_receivewal gzip compression tests

2021-07-12 Thread gkokolatos
‐‐‐ Original Message ‐‐‐ On Monday, July 12th, 2021 at 17:07, wrote: > ‐‐‐ Original Message ‐‐‐ > > On Monday, July 12th, 2021 at 13:04, Michael Paquier mich...@paquier.xyz > wrote: > > > On Mon, Jul 12, 2021 at 09:42:32AM +, gkokola...@pm.me wrote: > > > > > This to my

Re: Inaccurate error message when set fdw batch_size to 0

2021-07-12 Thread Bharath Rupireddy
On Mon, Jul 12, 2021 at 9:20 PM Fujii Masao wrote: > + > + Avoid Using non-negative Word in Error > Messages > + > + > +Do not use non-negative word in error messages as it looks > +ambiguous. Instead, use foo must be an integer value greater than > zero > +or foo must be an

Re: Enhanced error message to include hint messages for redundant options error

2021-07-12 Thread vignesh C
On Sun, Jul 11, 2021 at 3:23 PM Dean Rasheed wrote: > > On Sat, 10 Jul 2021 at 18:09, vignesh C wrote: > > > > I'm planning to handle conflicting errors separately after this > > current work is done, once the patch is changed to have just the valid > > scenarios(removing the scenarios you have

Re: PROXY protocol support

2021-07-12 Thread Magnus Hagander
On Fri, Jul 9, 2021 at 1:42 AM Jacob Champion wrote: > > Hi Magnus, > > I'm only just starting to page this back into my head, so this is by no > means a full review of the v7 changes -- just stuff I've noticed over > the last day or so of poking around. > > On Tue, 2021-06-29 at 11:48 +0200,

Re: Protect against possible memory corruption (src/backend/access/nbtree/nbtxlog.c)

2021-07-12 Thread Ranier Vilela
Em seg., 12 de jul. de 2021 às 05:20, Heikki Linnakangas escreveu: > On 12/07/2021 02:34, Ranier Vilela wrote: > > If it is not possible, know the upper limits, before the loop. > > It is necessary to do this inside the loop. > > > @@ -49,10 +47,14 @@ _bt_restore_page(Page page, char *from, int

Re: proposal - psql - use pager for \watch command

2021-07-12 Thread vignesh C
On Mon, Jul 12, 2021 at 4:29 AM Thomas Munro wrote: > > On Sun, Jul 11, 2021 at 1:18 AM vignesh C wrote: > > On Wed, May 12, 2021 at 5:45 PM Pavel Stehule > > wrote: > > > looks so with your patch psql doesn't work on ms > > Here's a fix for Windows. The pqsignal() calls are #ifdef'd out. I

Re: Is tuplesort meant to support bounded datum sorts?

2021-07-12 Thread Tom Lane
David Rowley writes: > It looks like this has likely never come up before because the only > time we use tuplesort_set_bound() is in nodeSort.c and > nodeIncrementalSort.c, none of those currently use datum sorts. > However, I'm thinking this is still a bug that should be fixed > separately from

Use WaitLatch for {pre, post}_auth_delay instead of pg_usleep

2021-07-12 Thread Bharath Rupireddy
Hi, As suggested in [1], starting a new thread for discussing $subject separately. {pre, post}_auth_delay waiting logic currently uses pg_usleep which can't detect postmaster death. So, there are chances that some of the backends still stay in the system even when a postmaster crashes (for

Re: Inaccurate error message when set fdw batch_size to 0

2021-07-12 Thread Fujii Masao
On 2021/07/09 11:41, Bharath Rupireddy wrote: PSA v6 patch. Thanks for updating the patch! + + Avoid Using non-negative Word in Error Messages + + +Do not use non-negative word in error messages as it looks +ambiguous. Instead, use foo must be an integer value greater than

Re: Zedstore - compressed in-core columnar storage

2021-07-12 Thread Andy Fan
Greetings. Thanks for the project. I see the code in github has not been updated for a long time, is it still in active development? Thanks -- Best Regards Andy Fan (https://www.aliyun.com/)

Re: Introduce pg_receivewal gzip compression tests

2021-07-12 Thread gkokolatos
‐‐‐ Original Message ‐‐‐ On Monday, July 12th, 2021 at 13:04, Michael Paquier wrote: > On Mon, Jul 12, 2021 at 09:42:32AM +, gkokola...@pm.me wrote: > > > This to my understanding means that gzip is expected to exist. > > > > If this is correct, then simply checking for the

Re: Introduce pg_receivewal gzip compression tests

2021-07-12 Thread gkokolatos
‐‐‐ Original Message ‐‐‐ On Monday, July 12th, 2021 at 13:00, Gilles Darold wrote: > Le 12/07/2021 à 12:27, gkokola...@pm.me a écrit : > > > > > > Shouldn't this be coded as a loop going through @gzip_wals? > > > > > > > > > > I would hope that there is only one gz file created.

Re: Column Filtering in Logical Replication

2021-07-12 Thread Alvaro Herrera
On 2021-Jul-12, Tomas Vondra wrote: > FWIW "make check" fails for me with this version, due to segfault in > OpenTableLists. Apparenly there's some confusion - the code expects the > list to contain PublicationTable nodes, and tries to extract the > RangeVar from the elements. But the list

Re: ATTACH PARTITION locking documentation for DEFAULT partitions

2021-07-12 Thread Matthias van de Meent
On Mon, 12 Jul 2021 at 15:28, David Rowley wrote: > > On Tue, 13 Jul 2021 at 00:14, Matthias van de Meent > wrote: > > Sorry for the delay. I think that covers the basics of what I was > > missing in these docs, and although it does not cover the recursive > > 'if the check is implied by

Re: [PATCH] Use optimized single-datum tuplesort in ExecSort

2021-07-12 Thread Ronan Dunklau
Le lundi 12 juillet 2021, 15:11:17 CEST David Rowley a écrit : > On Wed, 7 Jul 2021 at 21:32, Ronan Dunklau wrote: > > In the meantime I fixed some formatting issues, please find attached a new > > patch. > > I started to look at this. Thank you ! I'm attaching a new version of the patch taking

Re: enable_resultcache confusion

2021-07-12 Thread Tom Lane
David Rowley writes: > On Mon, 12 Jul 2021 at 03:22, Justin Pryzby wrote: >> |This is useful if only a small percentage of rows is checked on >> |the inner side and is controlled by > |linkend="guc-enable-resultcache"/>. > You might be right there, but I'm not too sure

Re: ATTACH PARTITION locking documentation for DEFAULT partitions

2021-07-12 Thread David Rowley
On Tue, 13 Jul 2021 at 00:14, Matthias van de Meent wrote: > Sorry for the delay. I think that covers the basics of what I was > missing in these docs, and although it does not cover the recursive > 'if the check is implied by constraints don't lock this partition', > I'd say that your suggested

Is tuplesort meant to support bounded datum sorts?

2021-07-12 Thread David Rowley
Over on [1], Ronan is working on allowing Datum sorts for nodeSort.c when we're just sorting a single Datum. I was looking at his v4 patch and noticed that he'd modified free_sort_tuple() to conditionally only free the sort tuple if it's non-NULL. Without this change, the select.sql regression

Re: [PATCH] Use optimized single-datum tuplesort in ExecSort

2021-07-12 Thread David Rowley
On Wed, 7 Jul 2021 at 21:32, Ronan Dunklau wrote: > In the meantime I fixed some formatting issues, please find attached a new > patch. I started to look at this. First I wondered how often we might be able to apply this optimisation, so I ran make check after adding some elog(NOTICE) calls to

Re: pg_stats and range statistics

2021-07-12 Thread Tomas Vondra
On 7/12/21 1:10 PM, Egor Rogov wrote: > Hi, > > thanks for the review and corrections. > > On 11.07.2021 21:54, Soumyadeep Chakraborty wrote: >> Hello, >> >> This should have been added with [1]. >> >> Excerpt from the documentation: >> "pg_stats is also designed to present the information in a

Re: Column Filtering in Logical Replication

2021-07-12 Thread Tomas Vondra
On 7/12/21 11:38 AM, Rahila Syed wrote: > Hi Alvaro, > > Thank you for comments. > > The patch adds a function get_att_num_by_name; but we have a lsyscache.c > function for that purpose, get_attnum.  Maybe that one should be used > instead? > > Thank you for pointing that out, I

Re: Diagnostic comment in LogicalIncreaseXminForSlot

2021-07-12 Thread Amit Kapila
On Mon, Jul 12, 2021 at 5:28 PM Ashutosh Bapat wrote: > > On Mon, Jul 12, 2021 at 8:39 AM Amit Kapila wrote: >> >> I have noticed that >> a nearby function LogicalIncreaseRestartDecodingForSlot() logs similar >> information after releasing spinlock, so it is better to follow the >> same here as

Re: Unused function parameter in get_qual_from_partbound()

2021-07-12 Thread John Naylor
On Tue, Jun 8, 2021 at 10:50 PM Michael Paquier wrote: > > At first glance, this looked to me like breaking something just for > sake of breaking it, but removing the rel argument could be helpful > to simplify any external code calling it as there would be no need for > this extra Relation. So

Re: Column Filtering in Logical Replication

2021-07-12 Thread Tomas Vondra
On 7/12/21 10:32 AM, Rahila Syed wrote: > Hi Peter, > > Hi, I was wondering if/when a subset of cols is specified then does > that mean it will be possible for the table to be replicated to a > *smaller* table at the subscriber side?  > > e.g Can a table with 7 cols replicated

Re: refactoring basebackup.c

2021-07-12 Thread tushar
On 7/8/21 9:26 PM, Robert Haas wrote: Here at last is a new version. Please refer this scenario ,where backup target using --server-compression is closing the server unexpectedly if we don't provide -no-manifest option [tushar@localhost bin]$ ./pg_basebackup --server-compression=gzip4  -t

Re: [PATCH] improve the pg_upgrade error message

2021-07-12 Thread Justin Pryzby
On Mon, Jul 12, 2021 at 02:06:31PM +0200, Laurenz Albe wrote: > On Mon, 2021-07-12 at 16:58 +0530, Jeevan Ladhe wrote: > > While looking into one of the pg_upgrade issue, I found it > > challenging to find out the database that has the datallowconn set to > > 'false' that was throwing following

Re: PostmasterIsAlive() in recovery (non-USE_POST_MASTER_DEATH_SIGNAL builds)

2021-07-12 Thread Thomas Munro
On Fri, Jun 11, 2021 at 1:18 PM Tom Lane wrote: > Heikki Linnakangas writes: > > On 09/04/2021 07:01, Thomas Munro wrote: > >> This seems to work on Linux, macOS, FreeBSD and OpenBSD (and I assume > >> any other BSD). Can anyone tell me if it works on illumos, AIX or > >> HPUX, and if not, how

Re: ATTACH PARTITION locking documentation for DEFAULT partitions

2021-07-12 Thread Matthias van de Meent
On Mon, 12 Jul 2021 at 14:06, David Rowley wrote: > > On Mon, 5 Jul 2021 at 01:01, David Rowley wrote: > > I've spent a bit of time hacking at this and I've come up with the > > attached patch. > > Matthias, any thoughts on my revised version of the patch? Sorry for the delay. I think that

Re: [PATCH] improve the pg_upgrade error message

2021-07-12 Thread Suraj Kharage
+1 for the change. Patch looks good to me. On Mon, Jul 12, 2021 at 4:59 PM Jeevan Ladhe wrote: > While looking into one of the pg_upgrade issue, I found it > > challenging to find out the database that has the datallowconn set to > > 'false' that was throwing following error: > > > *"All

Re: ATTACH PARTITION locking documentation for DEFAULT partitions

2021-07-12 Thread David Rowley
On Mon, 5 Jul 2021 at 01:01, David Rowley wrote: > I've spent a bit of time hacking at this and I've come up with the > attached patch. Matthias, any thoughts on my revised version of the patch? David

Re: [PATCH] improve the pg_upgrade error message

2021-07-12 Thread Laurenz Albe
On Mon, 2021-07-12 at 16:58 +0530, Jeevan Ladhe wrote: > While looking into one of the pg_upgrade issue, I found it > challenging to find out the database that has the datallowconn set to > 'false' that was throwing following error: > > "All non-template0 databases must allow connections, i.e.

Re: Add proper planner support for ORDER BY / DISTINCT aggregates

2021-07-12 Thread David Rowley
On Sun, 13 Jun 2021 at 03:07, David Rowley wrote: > > Please find attached my WIP patch. It's WIP due to what I mentioned > in the above paragraph and also because I've not bothered to add JIT > support for the new expression evaluation steps. I've split this patch into two parts. 0001 Adds

2021-07 CF now in progress

2021-07-12 Thread Ibrar Ahmed
Hackers, The Commitfest 2021-07 is now in progress. It is one of the biggest one. Total number of patches of this commitfest is 342. Needs review: 204. Waiting on Author: 40. Ready for Committer: 18. Committed: 57. Moved to next CF: 3. Withdrawn: 15. Rejected: 3. Returned with Feedback: 2.

Re: Diagnostic comment in LogicalIncreaseXminForSlot

2021-07-12 Thread Ashutosh Bapat
On Mon, Jul 12, 2021 at 8:39 AM Amit Kapila wrote: > On Mon, Jul 5, 2021 at 12:54 PM Masahiko Sawada > wrote: > > > > On Fri, May 21, 2021 at 6:00 PM Ashutosh Bapat > > wrote: > > > > > > It's there in CF. I am fine with PG-15. It will be good to patch the > back-branches to have this extra

Re: Skipping logical replication transactions on subscriber side

2021-07-12 Thread Amit Kapila
On Mon, Jul 12, 2021 at 11:13 AM Masahiko Sawada wrote: > > On Mon, Jul 12, 2021 at 1:15 PM Amit Kapila wrote: > > > > On Mon, Jul 12, 2021 at 9:37 AM Alexey Lesovsky wrote: > > > > > > On Mon, Jul 12, 2021 at 8:36 AM Amit Kapila > > > wrote: > > >> > > >> > > > >> > Ok, looks nice. But I am

Re: row filtering for logical replication

2021-07-12 Thread Tomas Vondra
While looking at the other logrep patch [1] (column filtering) I noticed Alvaro's comment regarding a new parsenode (PublicationTable) not having read/out/equal/copy funcs. I'd bet the same thing applies here, so perhaps see if the patch needs the same fix. [1]

  1   2   >