RE: Partial aggregates pushdown

2022-07-31 Thread fujii.y...@df.mitsubishielectric.co.jp
Hi Mr.Vondra, Mr.Pyhalov. I'm interesied in Mr.Pyhalov's patch due to the following background. --Background I develop postgresql's extension such as fdw in my work. I'm interested in using postgresql for OLAP. I think the function of a previous patch "Push aggregation down to base relations

Re: making relfilenodes 56 bits

2022-07-31 Thread Dilip Kumar
On Fri, Jul 29, 2022 at 10:55 PM Robert Haas wrote: > > On Thu, Jul 28, 2022 at 10:29 AM Robert Haas wrote: > > > I have done some cleanup in 0002 as well, basically, earlier we were > > > storing the result of the BufTagGetRelFileLocator() in a separate > > > variable which is not required

RE: Handle infinite recursion in logical replication setup

2022-07-31 Thread shiy.f...@fujitsu.com
On Fri, Jul 29, 2022 1:22 PM vignesh C wrote: > > > Thanks for the comments, the attached v41 patch has the changes for the > same. > Thanks for updating the patch. I wonder in the case that the publisher uses PG15 (or before), subscriber uses PG16, should we have this check (check if

Re: making relfilenodes 56 bits

2022-07-31 Thread Dilip Kumar
On Sat, Jul 30, 2022 at 1:35 AM Tom Lane wrote: > > Alvaro Herrera writes: > > On 2022-Jul-29, Robert Haas wrote: > >> Yeah, if we think it's OK to pass around structs, then that seems like > >> the right solution. Otherwise functions that take RelFileLocator > >> should be changed to take const

Re: Checking pgwin32_is_junction() errors

2022-07-31 Thread Thomas Munro
On Thu, Jul 28, 2022 at 9:31 PM Thomas Munro wrote: > There's one curious change in the draft patch attached: you can't > unlink() a junction point, you have to rmdir() it. Previously, things > that traverse directories without ever calling pgwin32_is_junction() > would see junction points as

Re: Schema variables - new implementation for Postgres 15

2022-07-31 Thread Julien Rouhaud
Hi, On Wed, Jul 27, 2022 at 09:59:18PM +0200, Pavel Stehule wrote: > > ne 24. 7. 2022 v 13:12 odesílatel Julien Rouhaud > napsal: > > > Hi, > > > > On Fri, Jul 22, 2022 at 10:58:25AM +0200, Pavel Stehule wrote: > > > > Apparently most of the changes in catalogs.sgml didn't survive the last > >

Re: Support logical replication of DDLs

2022-07-31 Thread Peter Smith
FYI, I found that the v14-0001 patch does not currently apply [1]. Can you please rebase it? -- [1] http://cfbot.cputube.org/patch_38_3595.log Kind Regards, Peter Smith. Fujitsu Australia

Re: Fast COPY FROM based on batch insert

2022-07-31 Thread Etsuro Fujita
On Wed, Jul 27, 2022 at 2:42 PM Andrey Lepikhov wrote: > On 7/22/22 13:14, Etsuro Fujita wrote: > > On Fri, Jul 22, 2022 at 3:39 PM Andrey Lepikhov > > wrote: > >> Analyzing multi-level heterogeneous partitioned configurations I > >> realized, that single write into a partition with a trigger

Re: enable/disable broken for statement triggers on partitioned tables

2022-07-31 Thread Amit Langote
On Sat, Jul 30, 2022 at 5:25 AM Tom Lane wrote: > Alvaro Herrera writes: > > Yeah, I don't know about adding tons of values to that enum just so that > > we can use that to hide a boolean inside. Why not add a boolean to the > > containing struct? Something like the attached. > > I do not

RE: Collect ObjectAddress for ATTACH DETACH PARTITION to use in event trigger

2022-07-31 Thread houzj.f...@fujitsu.com
On Sunday, July 31, 2022 12:12 PM Michael Paquier wrote: > > On Sat, Jul 30, 2022 at 01:13:52PM +, houzj.f...@fujitsu.com wrote: > > I am not against returning the objaddr for cases related to RLS and > RelOption. > > But just to confirm, do you have a use case to use the returned > >

Re: ci: update to freebsd 13.1 / remove minor versions from image names

2022-07-31 Thread Andres Freund
Hi, On 2022-07-31 16:27:37 -0700, Andres Freund wrote: > On 2022-08-01 10:07:32 +1200, Thomas Munro wrote: > > > > I suspect it'd be better to remove the minor version numbers from the > > > > image name, so that switches from 13.0 -> 13.1 don't require CI > > > > changes. Any argument against? >

Re: standby recovery fails (tablespace related) (tentative patch and discussion)

2022-07-31 Thread Andres Freund
Hi, On 2022-07-30 10:37:55 -0400, Tom Lane wrote: > Alvaro Herrera writes: > > WFM, pushed that way. > > Looks like conchuela is still intermittently unhappy. > > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=conchuela=2022-07-30%2004%3A57%3A51 CI as well:

Re: [Refactor]Avoid to handle FORCE_NOT_NULL/FORCE_NULL options when COPY TO

2022-07-31 Thread Zhang Mingli
HI, More assertions added. Thanks. Regards, Zhang Mingli On Jul 29, 2022, 11:24 +0800, Richard Guo , wrote: > > > On Thu, Jul 28, 2022 at 9:04 PM Zhang Mingli wrote: > > > Assertions added. > > > > Can we also add assertions to make sure force_quote, force_notnull and > > force_null are

Re: pg_buffercache: add sql test

2022-07-31 Thread Julien Rouhaud
On Sun, Jul 31, 2022 at 3:39 AM Tom Lane wrote: > > * A .gitignore file is needed so that "git status" won't whine after > running the test. This tends to be pretty much boilerplate; I copied > it from another contrib directory. Is there any reason we don't add a .gitignore in the contrib/

Re: Allow file inclusion in pg_hba and pg_ident files

2022-07-31 Thread Julien Rouhaud
On Tue, Jul 26, 2022 at 1:14 PM Michael Paquier wrote: > > On Tue, Jul 26, 2022 at 01:04:02PM +0800, Julien Rouhaud wrote: > > It doesn't have much impact most of the time. The filename is reported if > > there's an IO error while reading the already opened correct file. The real > > problem is

Re: Backup command and functions can cause assertion failure and segmentation fault

2022-07-31 Thread Michael Paquier
On Wed, Jul 20, 2022 at 03:49:17PM +0900, Michael Paquier wrote: > Adding an extra test to cover the second scenario is easier. So I > have added one as of the attached, addressing your other comments > while on it. I have also decided to add the tests at the bottom of > 001_stream_rep.pl, as

Re: pg_upgrade errno

2022-07-31 Thread Michael Paquier
On Sun, Jul 31, 2022 at 07:43:25PM -0400, Tom Lane wrote: > It's been wrong a lot longer than that, no? Since the beginning of times. But we've never really cared about fixing such errno behaviors based on their unlikeliness, have we? I don't mind doing a backpatch here, though, that's isolated

Re: pg_upgrade errno

2022-07-31 Thread Tom Lane
Michael Paquier writes: > On Sun, Jul 31, 2022 at 08:41:35AM -0500, Justin Pryzby wrote: >> But errno should be saved before strerror/%m. > Good catch, Justin. Will fix on HEAD. It's been wrong a lot longer than that, no? regards, tom lane

Re: pg_upgrade errno

2022-07-31 Thread Michael Paquier
On Sun, Jul 31, 2022 at 08:41:35AM -0500, Justin Pryzby wrote: > Since 3a769d823 (pg_upgrade: Allow use of file cloning) > file.c has had: > > - if (ioctl(dest_fd, FICLONE, src_fd) < 0) > - { > - unlink(dst); > - pg_fatal("error while cloning relation

Re: ci: update to freebsd 13.1 / remove minor versions from image names

2022-07-31 Thread Andres Freund
Hi, On 2022-08-01 10:07:32 +1200, Thomas Munro wrote: > > > I suspect it'd be better to remove the minor version numbers from the > > > image name, so that switches from 13.0 -> 13.1 don't require CI > > > changes. Any argument against? > > Yeah, that makes sense; it'd remove the need for

Re: The "char" type versus non-ASCII characters

2022-07-31 Thread Tom Lane
I wrote: > This came up again today [1], so here's a concrete proposal. > Let's use \ooo for high-bit-set chars, but keep backslash as just > backslash (so it's only semi-compatible with bytea). Hearing no howls of protest, here's a fleshed out, potentially-committable version. I added some

Re: ci: update to freebsd 13.1 / remove minor versions from image names

2022-07-31 Thread Thomas Munro
On Mon, Aug 1, 2022 at 7:43 AM Andres Freund wrote: > On 2022-07-28 02:57:04 -0700, Andres Freund wrote: > > Freebsd 13.0, so far used by CI, is out of support. I've changed the > > image to be built against 13.1, so we can switch to that. > > I pushed that bit. Thanks, belated +1. > > I

Re: [PATCH] Fix pg_upgrade test from v10

2022-07-31 Thread Anton A. Melnikov
Hello! On 06.07.2022 08:58, Michael Paquier wrote: That's the kind of things I already proposed on this thread, aimed at improving the coverage, and this takes care of more issues than what's proposed here: https://www.postgresql.org/message-id/flat/Yox1ME99GhAemMq1(at)paquier(dot)xyz I'll

[PATCH] Backport perl tests for pg_upgrade from 322becb60

2022-07-31 Thread Anton A. Melnikov
Hello! In previous discussion (https://www.postgresql.org/message-id/flat/6b05291c-f252-4fae-317d-b50dba69c311%40inbox.ru) On 05.07.2022 22:08, Justin Pryzby wrote: I'm not sure if anyone is interested in patching test.sh in backbranches. I'm not sure, but there may be more interest to

Re: pg_auth_members.grantor is bunk

2022-07-31 Thread Stephen Frost
Greetings, On Sun, Jul 31, 2022 at 11:44 David G. Johnston wrote: > On Sun, Jul 31, 2022 at 11:18 AM Stephen Frost wrote: > >> Greetings, >> >> * Robert Haas (robertmh...@gmail.com) wrote: >> > On Tue, Jul 26, 2022 at 12:46 PM Robert Haas >> wrote: >> >> + } >> + >> + /* >> +

Re: [Proposal] vacuumdb --schema only

2022-07-31 Thread Andrew Dunstan
On 2022-04-26 Tu 00:46, Nathan Bossart wrote: > On Tue, Apr 26, 2022 at 11:36:02AM +0900, Michael Paquier wrote: >> The refactoring logic to build the queries is clear to follow. I have >> a few comments about the shape of the patch, though. > Thanks for taking a look! > >> case

Re: Cirrus CI (Windows help wanted)

2022-07-31 Thread Andres Freund
Hi, On 2022-07-28 19:49:43 -0500, Justin Pryzby wrote: > On Tue, Jan 12, 2021 at 09:04:51AM -0500, Andrew Dunstan wrote: > > On 1/5/21 11:19 PM, Thomas Munro wrote: > > > > > > It seems we can make our own, either on-the-fly with caching, or > > > hosted somewhere, like this: > > > > > >

Re: How to retain lesser paths at add_path()?

2022-07-31 Thread Tom Lane
... BTW, a question I think we're going to be forced to face up to if we put a hook here is: is path cost/FOM comparison guaranteed transitive? That is, if we find that path A dominates path B and that path B dominates path C, is it guaranteed that comparing A directly to C would conclude that A

Re: ci: update to freebsd 13.1 / remove minor versions from image names

2022-07-31 Thread Andres Freund
Hi, On 2022-07-28 02:57:04 -0700, Andres Freund wrote: > Freebsd 13.0, so far used by CI, is out of support. I've changed the > image to be built against 13.1, so we can switch to that. I pushed that bit. > I suspect it'd be better to remove the minor version numbers from the > image name, so

Re: How to retain lesser paths at add_path()?

2022-07-31 Thread Tom Lane
Nils Dijk writes: > Attached you will find 3 patches that implement a way for extensions > to introduce 'a figure of merit' by the means of path comparisons. I took a brief look through this. I quite like your idea of expressing PathComparison merging as an OR of suitably-chosen values. I do

Re: pg_auth_members.grantor is bunk

2022-07-31 Thread David G. Johnston
On Sun, Jul 31, 2022 at 11:18 AM Stephen Frost wrote: > Greetings, > > * Robert Haas (robertmh...@gmail.com) wrote: > > On Tue, Jul 26, 2022 at 12:46 PM Robert Haas > wrote: > > + } > + > + /* > +* Disallow attempts to grant ADMIN OPTION back to a user who > granted it > +

Re: pg_auth_members.grantor is bunk

2022-07-31 Thread Tom Lane
Stephen Frost writes: > * Robert Haas (robertmh...@gmail.com) wrote: >> OK, so I fixed that, and also updated the documentation a bit more. I >> think these patches are basically done, and I'd like to get them >> committed before too much more time goes by, because I have other >> things that

Re: pg_auth_members.grantor is bunk

2022-07-31 Thread Stephen Frost
Greetings, * Robert Haas (robertmh...@gmail.com) wrote: > On Tue, Jul 26, 2022 at 12:46 PM Robert Haas wrote: > > I believe that these patches are mostly complete, but I think that > > dumpRoleMembership() probably needs some more work. I don't know what > > exactly, but there's nothing to cause

Re: [Patch] Fix bounds check in trim_array()

2022-07-31 Thread Tom Lane
Nathan Bossart writes: > On Mon, Jul 25, 2022 at 04:40:51PM +0200, Martin Kalcher wrote: >> +SELECT trim_array(ARRAY[]::int[], 1); -- fail >> +ERROR: number of elements to trim must be between 0 and 0 > Can we improve the error message? Maybe it should look something like > ERROR:

Re: TAP tests vs log_error verbosity=verbose

2022-07-31 Thread Andrew Dunstan
On 2022-07-31 Su 12:14, Tom Lane wrote: > Andrew Dunstan writes: >> Twice recently (b998196bb5 and 19408aae7f) I have had to adjust new TAP >> tests to handle log_error_verbosity=verbose, and there's a third case >> needing adjustment in the new auto_explain tests (7c34555f8c). I'm >> wondering

Re: TAP tests vs log_error verbosity=verbose

2022-07-31 Thread Tom Lane
Andrew Dunstan writes: > Twice recently (b998196bb5 and 19408aae7f) I have had to adjust new TAP > tests to handle log_error_verbosity=verbose, and there's a third case > needing adjustment in the new auto_explain tests (7c34555f8c). I'm > wondering if it would be better to set

TAP tests vs log_error verbosity=verbose

2022-07-31 Thread Andrew Dunstan
Twice recently (b998196bb5 and 19408aae7f) I have had to adjust new TAP tests to handle log_error_verbosity=verbose, and there's a third case needing adjustment in the new auto_explain tests (7c34555f8c). I'm wondering if it would be better to set log_error_verbosity to default for TAP tests, no

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

2022-07-31 Thread Tom Lane
David Rowley writes: > I'd like to take a serious look at pushing this patch on the first few > days of August, so if anyone is following along here that might have > objections, can you do so before then? Are you going to push the other patch (adjusting select_outer_pathkeys_for_merge) first,

Re: Improve TAP tests of pg_upgrade for cross-version tests

2022-07-31 Thread Anton A. Melnikov
Hello! On 30.07.2022 10:29, Michael Paquier wrote: [ - 'psql', '-X', + "$newbindir/psql", '-X', Found that adding $newbindir to psql gives an error when upgrading from versions 14 and below to master when the test tries to run

Re: pg_receivewal fail to streams when the partial file to write is not fully initialized present in the wal receiver directory

2022-07-31 Thread mahendrakar s
Hi Bharath, Idea to atomically allocate WAL file by creating tmp file and renaming it is nice. I have one question though: How is partially temp file created will be cleaned if the VM crashes or out of disk space cases? Does it endup creating multiple files for every VM crash/disk space during

pg_upgrade errno

2022-07-31 Thread Justin Pryzby
Since 3a769d823 (pg_upgrade: Allow use of file cloning) file.c has had: - if (ioctl(dest_fd, FICLONE, src_fd) < 0) - { - unlink(dst); - pg_fatal("error while cloning relation \"%s.%s\" (\"%s\" to \"%s\"): %s", -schemaName,

Re: Allow pageinspect's bt_page_stats function to return a set of rows instead of a single row

2022-07-31 Thread Hamid Akhtar
On Sun, 31 Jul 2022 at 18:00, Hamid Akhtar wrote: > > > On Thu, 28 Jul 2022 at 00:36, Tom Lane wrote: > >> Hamid Akhtar writes: >> > That attached patch is based on the master branch. It makes the >> following >> > changes to the pageinspect contrib module: >> > - Updates

Re: Allow pageinspect's bt_page_stats function to return a set of rows instead of a single row

2022-07-31 Thread Hamid Akhtar
On Thu, 28 Jul 2022 at 00:36, Tom Lane wrote: > Hamid Akhtar writes: > > That attached patch is based on the master branch. It makes the following > > changes to the pageinspect contrib module: > > - Updates bt_page_stats_internal function to accept 3 arguments instead > of > > 2. > > - The

Re: Reducing the maintenance overhead of test_oat_hooks

2022-07-31 Thread Alvaro Herrera
On 2022-Jul-30, Tom Lane wrote: > I do not > think that test_oat_hooks.c has any business imposing > an extra maintenance burden on us all, so I propose > nuking nodetag_to_string() from orbit, as attached. +1 -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/

Re: remove more archiving overhead

2022-07-31 Thread Noah Misch
On Fri, Jul 08, 2022 at 09:54:50AM -0700, Nathan Bossart wrote: > Since it's okay to return true or false in the identical/persisted file > case, I didn't think it deserved emphasis. I think returning false is not-okay: > --- a/doc/src/sgml/backup.sgml > +++ b/doc/src/sgml/backup.sgml > @@

Re: Race between KeepFileRestoredFromArchive() and restartpoint

2022-07-31 Thread Noah Misch
On Tue, Jul 26, 2022 at 07:21:29AM -0400, David Steele wrote: > On 6/19/21 16:39, Noah Misch wrote: > >On Tue, Feb 02, 2021 at 07:14:16AM -0800, Noah Misch wrote: > >>Recycling and preallocation are wasteful during archive recovery, because > >>KeepFileRestoredFromArchive() unlinks every entry in