Re: JUMBLE_SIZE macro in two files

2022-10-04 Thread Michael Paquier
On Tue, Oct 04, 2022 at 11:17:09PM -0400, Tom Lane wrote: > Nah, feel free. Okay, thanks. Applied, then. -- Michael signature.asc Description: PGP signature

Re: Assorted fixes related to WAL files (was: Use XLogFromFileName() in pg_resetwal to parse position from WAL file)

2022-10-04 Thread Michael Paquier
On Tue, Oct 04, 2022 at 06:24:18PM +0530, Bharath Rupireddy wrote: > I'm fine with doing either of these things. Let's hear from others. > > I've added a CF entry - https://commitfest.postgresql.org/40/3927/ About 0002, I am not sure that it is worth bothering. Sure, this wastes a few bytes,

Re: New strategies for freezing, advancing relfrozenxid early

2022-10-04 Thread Peter Geoghegan
On Tue, Oct 4, 2022 at 7:59 PM Jeff Davis wrote: > I am fine with that, but I'd like us all to understand what the > downsides are. Although I'm sure that there must be one case that loses measurably, it's not particularly obvious where to start looking for one. I mean it's easy to imagine

Re: Data is copied twice when specifying both child and parent table in publication

2022-10-04 Thread Peter Smith
Hi Wang-san. Here are my review comments for HEAD_v12-0001 patch. == 1. Missing documentation. In [1] you wrote: > I think the behaviour of multiple publications with parameter > publish_via_partition_root could be added to the pg-doc later in a separate > patch. ~ That doesn't seem

Re: JUMBLE_SIZE macro in two files

2022-10-04 Thread Tom Lane
Michael Paquier writes: > On Tue, Oct 04, 2022 at 09:16:44AM -0400, Tom Lane wrote: >> I would go more for taking it out of queryjumble.h. I see no >> reason why that constant needs to be world-visible. > I was just looking at the patch before seeing your reply, and thought > the exact same

Re: JUMBLE_SIZE macro in two files

2022-10-04 Thread Michael Paquier
On Tue, Oct 04, 2022 at 09:16:44AM -0400, Tom Lane wrote: > I would go more for taking it out of queryjumble.h. I see no > reason why that constant needs to be world-visible. I was just looking at the patch before seeing your reply, and thought the exact same thing. Perhaps you'd prefer apply

Re: New strategies for freezing, advancing relfrozenxid early

2022-10-04 Thread Jeff Davis
On Tue, 2022-10-04 at 11:09 -0700, Peter Geoghegan wrote: > So a simplistic threshold > (combined with dynamic per-page decisions about freezing) should be > enough to avoid most of the downside of eager freezing. ... > I want to keep > the cost as low as possible (often "negative cost" relative

Re: Miscellaneous tab completion issue fixes

2022-10-04 Thread Michael Paquier
On Tue, Oct 04, 2022 at 10:35:25AM +0100, Dagfinn Ilmari Mannsåker wrote: > LGTM, +1 to commit. Fine by me, so done. -- Michael signature.asc Description: PGP signature

Re: Startup process on a hot standby crashes with an error "invalid memory alloc request size 1073741824" while replaying "Standby/LOCK" records

2022-10-04 Thread Kyotaro Horiguchi
At Tue, 4 Oct 2022 17:15:31 -0700, Nathan Bossart wrote in > On Tue, Oct 04, 2022 at 07:53:11PM -0400, Tom Lane wrote: > > I wrote: > >> PFA a quick-hack fix that solves this issue by making per-transaction > >> subsidiary hash tables. That's overkill perhaps; I'm a little worried > >> about

Re: Startup process on a hot standby crashes with an error "invalid memory alloc request size 1073741824" while replaying "Standby/LOCK" records

2022-10-04 Thread Nathan Bossart
On Tue, Oct 04, 2022 at 07:53:11PM -0400, Tom Lane wrote: > I wrote: >> PFA a quick-hack fix that solves this issue by making per-transaction >> subsidiary hash tables. That's overkill perhaps; I'm a little worried >> about whether this slows down normal cases more than it's worth. >> But we

Re: Startup process on a hot standby crashes with an error "invalid memory alloc request size 1073741824" while replaying "Standby/LOCK" records

2022-10-04 Thread Tom Lane
I wrote: > PFA a quick-hack fix that solves this issue by making per-transaction > subsidiary hash tables. That's overkill perhaps; I'm a little worried > about whether this slows down normal cases more than it's worth. > But we ought to do something about this, because aside from the >

Re: problems with making relfilenodes 56-bits

2022-10-04 Thread Andres Freund
Hi, On 2022-10-03 10:01:25 -0700, Andres Freund wrote: > On 2022-10-03 08:12:39 -0400, Robert Haas wrote: > > On Fri, Sep 30, 2022 at 8:20 PM Andres Freund wrote: > > I thought about trying to buy back some space elsewhere, and I think > > that would be a reasonable approach to getting this

Re: [PATCH] Expand character set for ltree labels

2022-10-04 Thread Garen Torikian
No, not quite. Valid Punycode characters are `[A-Za-z0-9-]`. This proposal includes `-`, as well as `#` and `;` for HTML entities. I double-checked the RFC to see the valid Punycode characters and the set above is indeed correct:

Re: Move backup-related code to xlogbackup.c/.h

2022-10-04 Thread Nathan Bossart
On Wed, Sep 28, 2022 at 08:16:08PM +0530, Bharath Rupireddy wrote: > In doing so, I had to add a few Get/Set functions > for XLogCtl variables so that xlogbackup.c can use them. I would suggest moving this to a separate prerequisite patch that can be reviewed independently from the patches that

Re: Startup process on a hot standby crashes with an error "invalid memory alloc request size 1073741824" while replaying "Standby/LOCK" records

2022-10-04 Thread Tom Lane
[ redirecting to -hackers because patch attached ] David Rowley writes: > So that confirms there were 950k relations in the xl_standby_locks. > The contents of that message seem to be produced by standby_desc(). > That should be the same WAL record that's processed by standby_redo() > which adds

Re: [PATCH] Expand character set for ltree labels

2022-10-04 Thread Nathan Bossart
On Tue, Oct 04, 2022 at 12:54:46PM -0400, Garen Torikian wrote: > The punycode range of characters is the exact same set as the existing > ltree range, with the addition of a hyphen (-). Within this system, any > human language can be encoded using just A-Za-z0-9-. IIUC ASCII characters like '!'

Re: Warning about using pg_stat_reset() and pg_stat_reset_shared()

2022-10-04 Thread David Rowley
On Thu, 29 Sept 2022 at 04:45, Bruce Momjian wrote: > > We have discussed the problems caused by the use of pg_stat_reset() and > pg_stat_reset_shared(), specifically the removal of information needed > by autovacuum. I don't see these risks documented anywhere. Should we > do that? Are there

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

2022-10-04 Thread Zhihong Yu
Hi, For contain_placeholders(): + if (IsA(node, Query)) + return query_tree_walker((Query *) node, contain_placeholders, context, 0); + else if (IsA(node, PlaceHolderVar)) The `else` is not needed. For correlated_t struct, it would be better if the fields have comments. +

Re: Pluggable toaster

2022-10-04 Thread Nikita Malakhov
Hi hackers! cfbot is unhappy again, with documentation package.Here's corrected patchset. Patchset consists of: v21-0001-toaster-interface.patch - Pluggable TOAST API interface along with reference TOAST mechanics - new API is introduced but reference TOAST is still unchanged;

Re: problems with making relfilenodes 56-bits

2022-10-04 Thread Robert Haas
On Tue, Oct 4, 2022 at 2:30 PM Andres Freund wrote: > Consider the following sequence: > > 1) we write WAL like this: > > [record A][tear boundary][record B, prev A_lsn][tear boundary][record C, prev > B_lsn] > > 2) crash, the sectors with A and C made it to disk, the one with B didn't > > 3) We

Re: installcheck-world concurrency issues

2022-10-04 Thread Andres Freund
Hi, On 2022-10-04 17:05:40 +0900, Michael Paquier wrote: > On Mon, Oct 03, 2022 at 04:41:11PM -0700, Andres Freund wrote: > > There's a few further roles that seem to pose some danger goign forward: > > I have never seen that myself, but 0001 is a nice cleanup. > generated.sql includes a user

Re: problems with making relfilenodes 56-bits

2022-10-04 Thread Andres Freund
Hi, On 2022-10-04 13:36:33 -0400, Robert Haas wrote: > On Tue, Oct 4, 2022 at 11:34 AM Andres Freund wrote: > > > Example: Page { [ record A ] | tear boundary | [ record B ] } gets > > > recycled and receives a new record C at the place of A with the same > > > length. > > > > > > With your

Re: New strategies for freezing, advancing relfrozenxid early

2022-10-04 Thread Peter Geoghegan
On Tue, Oct 4, 2022 at 10:39 AM Jeff Davis wrote: > On Mon, 2022-10-03 at 22:45 -0700, Peter Geoghegan wrote: > > Once a table becomes larger than vacuum_freeze_strategy_threshold, > > VACUUM stops marking pages all-visible in the first place, > > consistently marking them all-frozen instead. > >

Re: Can we avoid chdir'ing in resolve_symlinks() ?

2022-10-04 Thread Tom Lane
Thomas Munro writes: > I tried lots of crazy stuff[1] to try to get an error out of this > thing, but came up empty handed. Unlike realpath(), _fullpath() > doesn't resolve symlinks (or junctions), so I guess there's less to go > wrong. It still needs the present working directory, which is a >

Re: Suppressing useless wakeups in walreceiver

2022-10-04 Thread Nathan Bossart
Here is an updated patch set with the following changes: * The creation of the struct for non-shared WAL receiver state is moved to a prerequisite 0001 patch. This should help ease review of 0002 a bit. * I updated the nap time calculation to round up to the next millisecond, as discussed

Re: New strategies for freezing, advancing relfrozenxid early

2022-10-04 Thread Jeff Davis
On Mon, 2022-10-03 at 22:45 -0700, Peter Geoghegan wrote: > Once a table becomes larger than vacuum_freeze_strategy_threshold, > VACUUM stops marking pages all-visible in the first place, > consistently marking them all-frozen instead. What are the trade-offs here? Why does it depend on table

Re: problems with making relfilenodes 56-bits

2022-10-04 Thread Robert Haas
On Tue, Oct 4, 2022 at 11:34 AM Andres Freund wrote: > > Example: Page { [ record A ] | tear boundary | [ record B ] } gets > > recycled and receives a new record C at the place of A with the same > > length. > > > > With your proposal, record B would still be a valid record when it > > follows

Re: interrupted tap tests leave postgres instances around

2022-10-04 Thread Andres Freund
Hi, On 2022-10-04 10:24:19 +0200, Peter Eisentraut wrote: > On 30.09.22 06:07, Andres Freund wrote: > > When tap tests are interrupted (e.g. with ctrl-c), we don't cancel running > > postgres instances etc. That doesn't strike me as a good thing. > > > > In contrast, the postgres instances

[PATCH] Expand character set for ltree labels

2022-10-04 Thread Garen Torikian
Dear hackers, I am submitting a patch to expand the label requirements for ltree. The current format is restricted to alphanumeric characters, plus _. Unfortunately, for non-English labels, this set is insufficient. Rather than figure out how to expand this set to include characters beyond the

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

2022-10-04 Thread Tom Lane
I wrote: > I think what we should look at is extending the aggregate/window > function APIs so that such functions can report where they put their > output, and then we can nuke MemoryContextContains(), with the > code code set up to assume that it has to copy if the called function > didn't

Re: problems with making relfilenodes 56-bits

2022-10-04 Thread Andres Freund
Hi, On 2022-10-04 15:05:47 +0200, Matthias van de Meent wrote: > On Mon, 3 Oct 2022 at 23:26, Andres Freund wrote: > > On 2022-10-03 19:40:30 +0200, Matthias van de Meent wrote: > > > On Mon, 3 Oct 2022, 19:01 Andres Freund, wrote: > > > > Random idea: xl_prev is large. Store a full xl_prev in

Re: get rid of Abs()

2022-10-04 Thread Tom Lane
Peter Eisentraut writes: > I was wondering why we have a definition of Abs() in c.h when there are > more standard functions such as abs() and fabs() in widespread use. I > think this one is left over from pre-ANSI-C days. The attached patches > replace all uses of Abs() with more standard

Re: JUMBLE_SIZE macro in two files

2022-10-04 Thread Tom Lane
bt22nakamorit writes: > queryjumble.c and queryjumble.h both define a macro JUMBLE_SIZE = 1024. > Since queryjumble.c includes queryjumble.h, the JUMBLE_SIZE definition > in queryjumble.c should be deleted. I would go more for taking it out of queryjumble.h. I see no reason why that constant

Re: [patch] \g with multiple result sets and \watch with copy queries

2022-10-04 Thread Tom Lane
"Daniel Verite" writes: > Tom Lane wrote: >> Given the time pressure, I did not worry about installing regression >> test coverage for this stuff, but I wonder if we shouldn't add some. > Currently, test/regress/sql/psql.sql doesn't AFAICS write anything > outside of stdout, but \g, \o,

Re: problems with making relfilenodes 56-bits

2022-10-04 Thread Matthias van de Meent
On Mon, 3 Oct 2022 at 23:26, Andres Freund wrote: > > Hi, > > On 2022-10-03 19:40:30 +0200, Matthias van de Meent wrote: > > On Mon, 3 Oct 2022, 19:01 Andres Freund, wrote: > > > Random idea: xl_prev is large. Store a full xl_prev in the page header, > > > but > > > only store a 2 byte offset

Re: [patch] \g with multiple result sets and \watch with copy queries

2022-10-04 Thread Daniel Verite
Tom Lane wrote: > Pushed after making some corrections. Thanks! > Given the time pressure, I did not worry about installing regression > test coverage for this stuff, but I wonder if we shouldn't add some. Currently, test/regress/sql/psql.sql doesn't AFAICS write anything outside of

Re: Assorted fixes related to WAL files (was: Use XLogFromFileName() in pg_resetwal to parse position from WAL file)

2022-10-04 Thread Bharath Rupireddy
On Tue, Oct 4, 2022 at 2:01 PM Kyotaro Horiguchi wrote: > > > 1. 0001 replaces explicit WAL file parsing code with > > Looks good to me. > > > 2. 0002 replaces MAXPGPATH with MAXFNAMELEN for WAL file names. > > Looks reasonable, too. I don't find other instances of the same mistake. Thanks for

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

2022-10-04 Thread Ranier Vilela
Em ter., 4 de out. de 2022 às 08:29, Ranier Vilela escreveu: > Em ter., 4 de out. de 2022 às 05:36, David Rowley > escreveu: > >> On Tue, 4 Oct 2022 at 13:35, Ranier Vilela wrote: >> > Revisiting my work on reducing memory consumption, I found this patch >> left out. >> > I'm not sure I can

Re: possibility of partial data dumps with pg_dump

2022-10-04 Thread Julien Rouhaud
Hi, On Tue, Oct 04, 2022 at 02:15:16PM +0200, Pavel Stehule wrote: > > út 4. 10. 2022 v 12:48 odesílatel Никита Старовойтов > napsal: > > > Hello, > > with a view to meeting with postgres code and to get some practice with > > it, I am making a small patch that adds the possibility of partial

Re: possibility of partial data dumps with pg_dump

2022-10-04 Thread Pavel Stehule
Hi út 4. 10. 2022 v 12:48 odesílatel Никита Старовойтов napsal: > Hello, > with a view to meeting with postgres code and to get some practice with > it, I am making a small patch that adds the possibility of partial tables > dump. > A rule of filtering is specified with standard SQL where

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

2022-10-04 Thread Ranier Vilela
Em ter., 4 de out. de 2022 às 05:36, David Rowley escreveu: > On Tue, 4 Oct 2022 at 13:35, Ranier Vilela wrote: > > Revisiting my work on reducing memory consumption, I found this patch > left out. > > I'm not sure I can help. > > But basically I was able to write and read the block size, in

Re: Small miscellaneous fixes

2022-10-04 Thread Ranier Vilela
Em ter., 4 de out. de 2022 às 01:18, Michael Paquier escreveu: > On Mon, Oct 03, 2022 at 08:05:57AM -0300, Ranier Vilela wrote: > > Em seg., 3 de out. de 2022 às 05:01, Masahiko Sawada < > sawada.m...@gmail.com> > > escreveu: > >> On Fri, Sep 30, 2022 at 9:08 AM Ranier Vilela > wrote: > >>> 1.

possibility of partial data dumps with pg_dump

2022-10-04 Thread Никита Старовойтов
Hello, with a view to meeting with postgres code and to get some practice with it, I am making a small patch that adds the possibility of partial tables dump. A rule of filtering is specified with standard SQL where clause (without "where" keyword) There are three ways to send data filters over

Re: Pluggable toaster

2022-10-04 Thread Nikita Malakhov
Hi hackers! Now cfbot is happy, but there were warnings due to recent changes in PointerGetDatum function, so here's corrected patchset. Sorry, forgot to attach patch files. My fault. Patchset consists of: v20-0001-toaster-interface.patch - Pluggable TOAST API interface along with reference TOAST

Re: JUMBLE_SIZE macro in two files

2022-10-04 Thread Julien Rouhaud
Hi, On Tue, Oct 04, 2022 at 05:41:12PM +0900, bt22nakamorit wrote: > > queryjumble.c and queryjumble.h both define a macro JUMBLE_SIZE = 1024. > Since queryjumble.c includes queryjumble.h, the JUMBLE_SIZE definition in > queryjumble.c should be deleted. +1

Re: Pluggable toaster

2022-10-04 Thread Nikita Malakhov
Hi hackers! Now cfbot is happy, but there were warnings due to recent changes in PointerGetDatum function, so here's corrected patchset. Patchset consists of: v20-0001-toaster-interface.patch - Pluggable TOAST API interface along with reference TOAST mechanics - new API is introduced but

Re: Miscellaneous tab completion issue fixes

2022-10-04 Thread Dagfinn Ilmari Mannsåker
vignesh C writes: > On Tue, 4 Oct 2022 at 09:13, Michael Paquier wrote: >> >> On Mon, Oct 03, 2022 at 06:29:32PM +0100, Dagfinn Ilmari Mannsåker wrote: >> > vignesh C writes: >> >> +else if (TailMatchesCS("\\dRp*")) >> >> +

Re: future of serial and identity columns

2022-10-04 Thread Laurenz Albe
On Tue, 2022-10-04 at 09:41 +0200, Peter Eisentraut wrote: > In PostgreSQL 10, we added identity columns, as an alternative to serial > columns (since 6.something).  They mostly work the same.  Identity > columns are SQL-conforming, have some more features (e.g., overriding > clause), and are a

Re: Miscellaneous tab completion issue fixes

2022-10-04 Thread vignesh C
On Tue, 4 Oct 2022 at 09:13, Michael Paquier wrote: > > On Mon, Oct 03, 2022 at 06:29:32PM +0100, Dagfinn Ilmari Mannsåker wrote: > > vignesh C writes: > >> +else if (TailMatchesCS("\\dRp*")) > >> +COMPLETE_WITH_QUERY(Query_for_list_of_publications[0].query); > >> +else if

Re: Add LSN along with offset to error messages reported for WAL file read/write/validate header failures

2022-10-04 Thread Bharath Rupireddy
On Thu, Sep 29, 2022 at 7:43 PM Bharath Rupireddy wrote: > > Please see the attached v1 patch. FWIW, I'm attaching Nathan's patch that introduced the new function pg_walfile_offset_lsn as 0002 in the v1 patch set. Here's the CF entry - https://commitfest.postgresql.org/40/3909/. Please consider

Re: get rid of Abs()

2022-10-04 Thread Zhang Mingli
Hi, On Oct 4, 2022, 15:07 +0800, Peter Eisentraut , wrote: > I was wondering why we have a definition of Abs() in c.h when there are > more standard functions such as abs() and fabs() in widespread use. I > think this one is left over from pre-ANSI-C days. The attached patches > replace all uses

JUMBLE_SIZE macro in two files

2022-10-04 Thread bt22nakamorit
Hi, queryjumble.c and queryjumble.h both define a macro JUMBLE_SIZE = 1024. Since queryjumble.c includes queryjumble.h, the JUMBLE_SIZE definition in queryjumble.c should be deleted. Thoughts? Tatsudiff --git a/src/backend/utils/misc/queryjumble.c b/src/backend/utils/misc/queryjumble.c index

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

2022-10-04 Thread David Rowley
On Tue, 4 Oct 2022 at 13:35, Ranier Vilela wrote: > Revisiting my work on reducing memory consumption, I found this patch left > out. > I'm not sure I can help. > But basically I was able to write and read the block size, in the chunk. > Could it be the case of writing and reading the context

Re: Assorted fixes related to WAL files (was: Use XLogFromFileName() in pg_resetwal to parse position from WAL file)

2022-10-04 Thread Kyotaro Horiguchi
At Tue, 4 Oct 2022 13:20:54 +0530, Bharath Rupireddy wrote in > On Tue, Oct 4, 2022 at 12:11 PM Kyotaro Horiguchi > wrote: > > > > > > > > > static uint32 minXlogTli = 0; > > > > I have found other three instances of this in xlog.c and > > pg_receivewal.c. Do they worth fixing? > > > >

Re: interrupted tap tests leave postgres instances around

2022-10-04 Thread Peter Eisentraut
On 30.09.22 06:07, Andres Freund wrote: When tap tests are interrupted (e.g. with ctrl-c), we don't cancel running postgres instances etc. That doesn't strike me as a good thing. In contrast, the postgres instances started by pg_regress do terminate. I assume this is because pg_regress starts

Re: log_heap_visible(): remove unused parameter and update comment

2022-10-04 Thread Peter Eisentraut
On 04.10.22 09:19, Bharath Rupireddy wrote: We have the pg_attribute_unused() macro already. I'm not sure if adding -Wunused-parameter for compilation plus using pg_attribute_unused() for unused-yet-contextually-required variables is a great idea. But it has some merits as it avoids unused

Re: Fix some newly modified tab-complete changes

2022-10-04 Thread Peter Smith
On Thu, Sep 29, 2022 at 12:50 PM shiy.f...@fujitsu.com wrote: > > On Wed, Sep 28, 2022 1:49 PM Kyotaro Horiguchi > wrote: > > > > At Wed, 28 Sep 2022 14:14:01 +1000, Peter Smith > > wrote in ... > > > > > > 2. tab complete for GRANT > > > > > > test_pub=# grant > > > ALL

pid_t on mingw

2022-10-04 Thread Peter Eisentraut
I wanted to propose the attached patch to get rid of the custom pgpid_t typedef in pg_ctl. Since we liberally use pid_t elsewhere, this seemed plausible. However, this patch fails the CompilerWarnings job on Cirrus, because apparently under mingw, pid_t is "volatile long long int", so all

Re: installcheck-world concurrency issues

2022-10-04 Thread Michael Paquier
On Mon, Oct 03, 2022 at 04:41:11PM -0700, Andres Freund wrote: > There's a few further roles that seem to pose some danger goign forward: I have never seen that myself, but 0001 is a nice cleanup. generated.sql includes a user named "regress_user11". Perhaps that's worth renaming while on it? >

Assorted fixes related to WAL files (was: Use XLogFromFileName() in pg_resetwal to parse position from WAL file)

2022-10-04 Thread Bharath Rupireddy
On Tue, Oct 4, 2022 at 12:11 PM Kyotaro Horiguchi wrote: > > > > > > static uint32 minXlogTli = 0; > > I have found other three instances of this in xlog.c and > pg_receivewal.c. Do they worth fixing? > > (pg_upgarade.c has "uint32 tli/logid/segno but I'm not sure they need > to be "fixed". At

future of serial and identity columns

2022-10-04 Thread Peter Eisentraut
In PostgreSQL 10, we added identity columns, as an alternative to serial columns (since 6.something). They mostly work the same. Identity columns are SQL-conforming, have some more features (e.g., overriding clause), and are a bit more robust in schema management. Some of that was described

Re: log_heap_visible(): remove unused parameter and update comment

2022-10-04 Thread Bharath Rupireddy
On Fri, Sep 30, 2022 at 7:48 PM Japin Li wrote: > > On Fri, 30 Sep 2022 at 22:09, Bharath Rupireddy > wrote: > > On Fri, Sep 30, 2022 at 7:30 PM Japin Li wrote: > >> > >> When I try to use -Wunused-parameter, I find there are many warnings :-( . > > > > Great! > > > > I think we can't just

get rid of Abs()

2022-10-04 Thread Peter Eisentraut
I was wondering why we have a definition of Abs() in c.h when there are more standard functions such as abs() and fabs() in widespread use. I think this one is left over from pre-ANSI-C days. The attached patches replace all uses of Abs() with more standard functions. The first patch

Re: GUC tables - use designated initializers

2022-10-04 Thread Peter Smith
On Tue, Oct 4, 2022 at 5:48 PM Michael Paquier wrote: > > On Tue, Oct 04, 2022 at 04:20:36PM +1100, Peter Smith wrote: > > The v2 patches are updated as follows: > > > > 0001 - Now this patch only fixes a comment that had a wrong enum name. > > This was wrong, so fixed. Thanks for pushing! > >

Re: Convert macros to static inline functions

2022-10-04 Thread Amul Sul
On Tue, Oct 4, 2022 at 12:00 PM Peter Eisentraut wrote: > > On 16.05.22 10:27, Peter Eisentraut wrote: > > Inspired by [0], I looked to convert more macros to inline functions. > > Here is another one from the same batch of work that I somehow didn't > send in last time. > I think assertion can

Re: GUC tables - use designated initializers

2022-10-04 Thread Michael Paquier
On Tue, Oct 04, 2022 at 04:20:36PM +1100, Peter Smith wrote: > The v2 patches are updated as follows: > > 0001 - Now this patch only fixes a comment that had a wrong enum name. This was wrong, so fixed. > 0002 - Removes unnecessary whitespace (same as v1-0002) This one does not seem worth

Re: Use XLogFromFileName() in pg_resetwal to parse position from WAL file

2022-10-04 Thread Kyotaro Horiguchi
At Tue, 04 Oct 2022 15:23:48 +0900 (JST), Kyotaro Horiguchi wrote in > This is not directly related to this patch, pg_resetwal.c has the > following line.. > > > static uint32 minXlogTli = 0; I have found other three instances of this in xlog.c and pg_receivewal.c. Do they worth fixing?

Re: Convert macros to static inline functions

2022-10-04 Thread Peter Eisentraut
On 16.05.22 10:27, Peter Eisentraut wrote: Inspired by [0], I looked to convert more macros to inline functions. Here is another one from the same batch of work that I somehow didn't send in last time. (IMO it's questionable whether this one should be an inline function or macro at all,

Re: Use XLogFromFileName() in pg_resetwal to parse position from WAL file

2022-10-04 Thread Michael Paquier
On Tue, Oct 04, 2022 at 03:17:06PM +0900, Kyotaro Horiguchi wrote: > Nice finding. I found a few '%08X%08X's but they don't seem to fit > similar fix. Nice cleanup. > Couldn't we use XLByteToSeg() here? > > Other than that, it looks good to me. Yep. It looks that you're right here. -- Michael

Re: Use XLogFromFileName() in pg_resetwal to parse position from WAL file

2022-10-04 Thread Kyotaro Horiguchi
At Tue, 04 Oct 2022 15:17:06 +0900 (JST), Kyotaro Horiguchi wrote in > Other than that, it looks good to me. Sorry I have another comment. > - unsigned int tli, > - log, > - seg; > +

Re: Use XLogFromFileName() in pg_resetwal to parse position from WAL file

2022-10-04 Thread Bharath Rupireddy
On Tue, Oct 4, 2022 at 11:47 AM Kyotaro Horiguchi wrote: > > > - segs_per_xlogid = (UINT64CONST(0x0001) / > > ControlFile.xlog_seg_size); > > newXlogSegNo = ControlFile.checkPointCopy.redo / > > ControlFile.xlog_seg_size; > > Couldn't we use XLByteToSeg() here? Yes, we

Re: Use XLogFromFileName() in pg_resetwal to parse position from WAL file

2022-10-04 Thread Kyotaro Horiguchi
At Tue, 4 Oct 2022 11:06:15 +0530, Bharath Rupireddy wrote in > It looks like there's an opportunity to replace explicit WAL file > parsing code with XLogFromFileName() in pg_resetwal.c. This was not > done then (in PG 10) because the XLogFromFileName() wasn't accepting > file size as an input