Re: small pg_dump code cleanup

2024-07-02 Thread Nathan Bossart
Committed. -- nathan

Re: small pg_dump code cleanup

2024-07-01 Thread Daniel Gustafsson
> On 11 Jun 2024, at 22:30, Nathan Bossart wrote: > At the moment, I'm inclined to commit v1 once v18 development opens up. We > can consider any additional adjustments separately. Patch LGTM and the tests pass, +1 on pushing this version. -- Daniel Gustafsson

Re: small pg_dump code cleanup

2024-06-11 Thread Nathan Bossart
On Wed, Jun 05, 2024 at 01:58:54PM -0400, Tom Lane wrote: > Nathan Bossart writes: >> On Wed, Jun 05, 2024 at 12:22:03PM -0400, Neil Conway wrote: >>> (2) These functions malloc() a single ntups * sizeof(struct) allocation and >>> then index into it to fill-in each struct before entering it into t

Re: small pg_dump code cleanup

2024-06-05 Thread Tom Lane
Nathan Bossart writes: > On Wed, Jun 05, 2024 at 12:22:03PM -0400, Neil Conway wrote: >> (1) Names like `getXXX` for these functions suggest to me that they return >> a value, rather than side-effecting. I realize some variants continue to >> return a value, but the majority no longer do. Perhaps

Re: small pg_dump code cleanup

2024-06-05 Thread Neil Conway
On Wed, Jun 5, 2024 at 12:37 PM Nathan Bossart wrote: > What about collectXXX() to match similar functions in pg_dump.c (e.g., > collectRoleNames(), collectComments(), collectSecLabels())? > sgtm. > > (2) These functions malloc() a single ntups * sizeof(struct) allocation > and > > then index

Re: small pg_dump code cleanup

2024-06-05 Thread Nathan Bossart
On Wed, Jun 05, 2024 at 12:22:03PM -0400, Neil Conway wrote: > Nice cleanup! Two minor comments: Thanks for taking a look. > (1) Names like `getXXX` for these functions suggest to me that they return > a value, rather than side-effecting. I realize some variants continue to > return a value, but

Re: small pg_dump code cleanup

2024-06-05 Thread Neil Conway
On Wed, Jun 5, 2024 at 11:14 AM Nathan Bossart wrote: > In fact, many of the functions in this area don't actually need to return anything, so we can trim some code and hopefully reduce confusion a > bit. Patch attached. > Nice cleanup! Two minor comments: (1) Names like `getXXX` for these f

small pg_dump code cleanup

2024-06-05 Thread Nathan Bossart
While reviewing Daniel's pg_dump patch [0], I was initially confused because the return value of getTypes() isn't saved anywhere. Once I found commit 92316a4, I realized that data was actually stored in a separate hash table. In fact, many of the functions in this area don't actually need to retu