Re: Perform streaming logical transactions by background workers and parallel apply

2022-06-30 Thread Peter Smith
Below are some review comments for patches v14-0001, and v14-0002: v14-0001 1.1 Commit message For now, 'parallel' means the streaming will be applied via a apply background worker if available. 'on' means the streaming transaction will be spilled to disk. By the way, we do no

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

2022-06-30 Thread Michael Paquier
On Fri, Jul 01, 2022 at 03:32:50PM +0900, Fujii Masao wrote: > Sounds good idea to me. I updated the patch in that way. Attached. Skimming quickly through the thread, this failure requires a termination of a backend running BASE_BACKUP. This is basically something done by the TAP test added in 04

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

2022-06-30 Thread Fujii Masao
On 2022/07/01 15:09, Masahiko Sawada wrote: The change looks good to me. I've also confirmed the change fixed the issues. Thanks for the review and test! @@ -233,6 +233,12 @@ perform_base_backup(basebackup_options *opt, bbsink *sink) StringInfo labelfile; StringInfo tblspc_map_f

Eliminating SPI from RI triggers - take 2

2022-06-30 Thread Amit Langote
Hi, I had proposed $subject for some RI trigger functions in the last dev cycle [1]. Briefly, the proposal was to stop using an SQL query (using the SPI interface) for RI checks that could be done by directly scanning the primary/unique key index of the referenced table, which must always be ther

Re: making relfilenodes 56 bits

2022-06-30 Thread Dilip Kumar
On Thu, Jun 30, 2022 at 10:57 PM Robert Haas wrote: > > On Wed, Jun 29, 2022 at 5:15 AM Dilip Kumar wrote: > > >- It looks to me like you need to give significantly more thought to > > > the proper way of adjusting the relfilenode-related test cases in > > > alter_table.out. > > > > It seems to m

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

2022-06-30 Thread Masahiko Sawada
Hi, On Thu, Jun 30, 2022 at 12:29 PM Fujii Masao wrote: > > Hi, > > I found that the assertion failure and the segmentation fault could > happen by running pg_backup_start(), pg_backup_stop() and BASE_BACKUP > replication command, in v15 or before. > > Here is the procedure to reproduce the asser

Re: Issue with pg_stat_subscription_stats

2022-06-30 Thread Amit Kapila
On Fri, Jul 1, 2022 at 7:12 AM Masahiko Sawada wrote: > > On Wed, Mar 16, 2022 at 11:34 PM Masahiko Sawada > wrote: > > > > While looking at this issue again, I realized there seems to be two > problems with subscription stats on shmem stats: > > Firstly, we call pgstat_create_subscription() whe

Re: Add 64-bit XIDs into PostgreSQL 15

2022-06-30 Thread Pavel Borisov
> > This seems to be causing cfbot/cirrusci to time out. > > Here's the build history > https://cirrus-ci.com/github/postgresql-cfbot/postgresql/commitfest/38/3594 > > https://cirrus-ci.com/task/4809278652416000 4 weeks ago on macos > https://cirrus-ci.com/task/5559884417597440 2 weeks ago on macos

Re: Add index item for MERGE.

2022-06-30 Thread Fujii Masao
On 2022/06/30 18:57, Alvaro Herrera wrote: On 2022-Jun-30, Fujii Masao wrote: Hi, I found that there is no index item for MERGE command, in the docs. Attached is the patch that adds the indexterm for MERGE to merge.sgml. +1 LGTM, thanks. Thanks for the review! Pushed. Regards, -- Fuji

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

2022-06-30 Thread Fujii Masao
On 2022/07/01 12:05, Kyotaro Horiguchi wrote: At Fri, 01 Jul 2022 11:56:14 +0900 (JST), Kyotaro Horiguchi wrote in At Fri, 01 Jul 2022 11:46:53 +0900 (JST), Kyotaro Horiguchi wrote in Please find the attached. Mmm. It forgot the duplicate-call prevention and query-cancel handling... Th

Re: generate_series for timestamptz and time zone problem

2022-06-30 Thread Gurjeet Singh
On Tue, Jun 21, 2022 at 7:56 AM Przemysław Sztoch wrote: > There is another patch. > It works, but one thing is wrongly done because I lack knowledge. Thank you for continuing to work on it despite this being your first time contributing, and despite the difficulties. I'll try to help as much as

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

2022-06-30 Thread Kyotaro Horiguchi
At Fri, 01 Jul 2022 11:56:14 +0900 (JST), Kyotaro Horiguchi wrote in > At Fri, 01 Jul 2022 11:46:53 +0900 (JST), Kyotaro Horiguchi > wrote in > > Please find the attached. > > Mmm. It forgot the duplicate-call prevention and query-cancel > handling... The first one is the same as you posted

Re: pg_checkpointer is not a verb or verb phrase

2022-06-30 Thread Justin Pryzby
On Fri, Jul 01, 2022 at 10:22:16AM +0900, Michael Paquier wrote: > On Thu, Jun 30, 2022 at 08:57:04AM -0400, Isaac Morland wrote: > > I was going to point out that pg_database_owner is the same way, but it is > > fundamentally different in that it has no special allowed access and is > > meant to b

Re: pg_checkpointer is not a verb or verb phrase

2022-06-30 Thread Isaac Morland
On Thu, 30 Jun 2022 at 21:22, Michael Paquier wrote: > On Thu, Jun 30, 2022 at 08:57:04AM -0400, Isaac Morland wrote: > > I was going to point out that pg_database_owner is the same way, but it > is > > fundamentally different in that it has no special allowed access and is > > meant to be the ta

Re: replacing role-level NOINHERIT with a grant-level option

2022-06-30 Thread Nathan Bossart
On Thu, Jun 30, 2022 at 10:21:53PM -0400, Robert Haas wrote: > On Thu, Jun 30, 2022 at 7:29 PM Nathan Bossart > wrote: >> IIUC you are suggesting that we'd leave rolinherit in pg_authid alone, but >> we'd add the ability to specify a grant-level option that would always take >> precedence. The d

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

2022-06-30 Thread Kyotaro Horiguchi
At Fri, 01 Jul 2022 11:46:53 +0900 (JST), Kyotaro Horiguchi wrote in > Please find the attached. Mmm. It forgot the duplicate-call prevention and query-cancel handling... The first one is the same as you posted but the second one is still a problem.. regards. -- Kyotaro Horiguchi NTT Open So

Re: Add 64-bit XIDs into PostgreSQL 15

2022-06-30 Thread Justin Pryzby
This seems to be causing cfbot/cirrusci to time out. Here's the build history https://cirrus-ci.com/github/postgresql-cfbot/postgresql/commitfest/38/3594 https://cirrus-ci.com/task/4809278652416000 4 weeks ago on macos https://cirrus-ci.com/task/5559884417597440 2 weeks ago on macos https://cirru

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

2022-06-30 Thread Kyotaro Horiguchi
At Thu, 30 Jun 2022 12:28:43 +0900, Fujii Masao wrote in > The root cause of these failures seems that sessionBackupState flag > is not reset to SESSION_BACKUP_NONE even when BASE_BACKUP is aborted. > So attached patch changes do_pg_abort_backup callback so that > it resets sessionBackupState. I

Re: margay fails assertion in stats/dsa/dsm code

2022-06-30 Thread Thomas Munro
On Fri, Jul 1, 2022 at 4:02 AM Robert Haas wrote: > On Wed, Jun 29, 2022 at 12:01 AM Thomas Munro wrote: > > - if (errno != EEXIST) > > + if (op == DSM_OP_ATTACH || errno != EEXIST) > > ereport(elevel, > >

Re: replacing role-level NOINHERIT with a grant-level option

2022-06-30 Thread Robert Haas
On Thu, Jun 30, 2022 at 7:29 PM Nathan Bossart wrote: > IIUC you are suggesting that we'd leave rolinherit in pg_authid alone, but > we'd add the ability to specify a grant-level option that would always take > precedence. The default (WITH INHERIT DEFAULT) would cause things to work > exactly as

Re: Issue with pg_stat_subscription_stats

2022-06-30 Thread Masahiko Sawada
Hi, On Wed, Mar 16, 2022 at 11:34 PM Masahiko Sawada wrote: > > On Wed, Mar 16, 2022 at 8:51 PM Amit Kapila wrote: > > > > On Tue, Mar 15, 2022 at 10:09 AM Masahiko Sawada > > wrote: > > > > > > On Tue, Mar 15, 2022 at 3:34 AM Melanie Plageman > > > wrote: > > > > > > > > On Mon, Mar 14, 20

Re: pg_checkpointer is not a verb or verb phrase

2022-06-30 Thread Michael Paquier
On Thu, Jun 30, 2022 at 08:57:04AM -0400, Isaac Morland wrote: > I was going to point out that pg_database_owner is the same way, but it is > fundamentally different in that it has no special allowed access and is > meant to be the target of permission grants rather than being granted to > other ro

Re: PATCH: Add Table Access Method option to pgbench

2022-06-30 Thread Michael Paquier
On Fri, Jul 01, 2022 at 10:06:49AM +0900, Michael Paquier wrote: > And the conclusion back then is that one can already achieve this by > using PGOPTIONS: > PGOPTIONS='-c default_table_access_method=wuzza' pgbench [...] > > So there is no need to complicate more pgbench, particularly when it > com

Re: PATCH: Add Table Access Method option to pgbench

2022-06-30 Thread Michael Paquier
On Thu, Jun 30, 2022 at 01:07:53PM -0700, Michel Pelletier wrote: > I've got CI setup and building and the tests now pass, I was missing a > CASCADE in my test. New patch attached: The exact same patch has been proposed back in November 2020: https://www.postgresql.org/message-id/0177f78c-4702-69

Re: Logging query parmeters in auto_explain

2022-06-30 Thread Michael Paquier
On Wed, Jun 29, 2022 at 09:17:49AM +0900, Michael Paquier wrote: > The majority of TAP scripts have their subroutines at the beginning of > the script, and there are few having that at the end. I won't fight > you on that, but the former is more consistent. I have kept things as I originally inte

Re: Comments referring to pg_start/stop_backup

2022-06-30 Thread Michael Paquier
On Tue, Jun 28, 2022 at 07:47:04AM -0400, David Steele wrote: > Yes, these also look good to me. They are a bit tricky to search for so I > can see how we missed them. Thanks for double-checking. Applied. -- Michael signature.asc Description: PGP signature

Re: SLRUs in the main buffer pool - Page Header definitions

2022-06-30 Thread Shawn Debnath
On Fri, Jun 24, 2022 at 03:45:34PM -0700, Andres Freund wrote: > Outside the database you'll know the path to the file, which will tell you > it's not another kind of relation. > > This really makes no sense to me. We don't have page flags indicating whether > a page is a heap, btree, visibility,

Re: [PoC/RFC] Multiple passwords, interval expirations

2022-06-30 Thread Gurjeet Singh
I am planning on picking it up next week; right now picking up steam, and reviewing a different, smaller patch. At his behest, I had a conversation with Joshua (OP), and have his support to pick up and continue working on this patch. I have a some ideas of my own, on what this patch should do, but

Re: replacing role-level NOINHERIT with a grant-level option

2022-06-30 Thread Nathan Bossart
On Thu, Jun 30, 2022 at 09:42:11AM -0400, Robert Haas wrote: > On Wed, Jun 29, 2022 at 7:19 PM Nathan Bossart > wrote: >> I'm guessing we'll also need a new pg_dumpall option for generating pre-v16 >> style role commands versus the v16+ style ones. When run on v16 and later, >> you'd have to req

Re: [PoC] Let libpq reject unexpected authentication requests

2022-06-30 Thread Jacob Champion
On Wed, Jun 29, 2022 at 6:36 AM Peter Eisentraut wrote: > It's not strictly related to your patch, but maybe this hint has > outlived its usefulness? I mean, we don't list all available tables > when you try to reference a table that doesn't exist. And unordered on > top of that. Yeah, maybe it

Re: [PATCH] minor reloption regression tests improvement

2022-06-30 Thread Jacob Champion
On Wed, Jun 29, 2022 at 9:04 PM Nikolay Shaplov wrote: > В письме от четверг, 30 июня 2022 г. 06:47:48 MSK пользователь Nikolay Shaplov > написал: > > > Hi! I am surely feel this patch is important. I have bigger patch > > https://commitfest.postgresql.org/38/3536/ and this test makes sense as a >

Re: doc: Clarify what "excluded" represents for INSERT ON CONFLICT

2022-06-30 Thread Peter Geoghegan
On Thu, Jun 30, 2022 at 3:07 PM David G. Johnston wrote: > Yes, and based on a single encounter I agree this doesn't seem like a broadly > encountered issue. My takeaway from that eventually led to this proposal. > The "Other Person" who is complaining about the docs is one of the mentors on

Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)

2022-06-30 Thread Peter Eisentraut
On 19.05.22 18:09, Ranier Vilela wrote: Taking it a step further. Created a new patch into commitfest, targeting 16 version. https://commitfest.postgresql.org/38/3645/ I have committed your 001 patch, which was clearly a (harmless) mistake. I have

Re: doc: Clarify what "excluded" represents for INSERT ON CONFLICT

2022-06-30 Thread David G. Johnston
On Thu, Jun 30, 2022 at 2:31 PM Peter Geoghegan wrote: > On Thu, Jun 30, 2022 at 2:07 PM David G. Johnston > wrote: > > Current: > > "The SET and WHERE clauses in ON CONFLICT DO UPDATE have access to the > > existing row using the table's name (or an alias), and to [rows] proposed > > for insert

Re: doc: Clarify what "excluded" represents for INSERT ON CONFLICT

2022-06-30 Thread Peter Geoghegan
On Thu, Jun 30, 2022 at 2:07 PM David G. Johnston wrote: > Current: > "The SET and WHERE clauses in ON CONFLICT DO UPDATE have access to the > existing row using the table's name (or an alias), and to [rows] proposed > for insertion using the special excluded table." > > The word table in that sen

Re: doc: Clarify what "excluded" represents for INSERT ON CONFLICT

2022-06-30 Thread David G. Johnston
On Thu, Jun 30, 2022 at 1:43 PM Robert Haas wrote: > On Thu, Jun 9, 2022 at 11:40 AM David G. Johnston > wrote: > > As one cannot place excluded in a FROM clause (subquery) in the > > ON CONFLICT clause referring to it as a table, ... > > Well, it would be nice if you had included a test

Re: doc: Clarify what "excluded" represents for INSERT ON CONFLICT

2022-06-30 Thread Peter Geoghegan
On Thu, Jun 30, 2022 at 1:43 PM Robert Haas wrote: > rhaas=# insert into foo values (1, 'frob') on conflict (a) do update > set b = (select b || 'nitz' from excluded); > ERROR: relation "excluded" does not exist > LINE 1: ...ct (a) do update set b = (select b || 'nitz' from excluded); > > I do fi

Re: [Proposal] Global temporary tables

2022-06-30 Thread Jacob Champion
On 3/3/22 13:20, Andres Freund wrote: > On 2022-03-03 16:07:37 -0500, Robert Haas wrote: >> I agree that the feature is desirable, but I think getting there is >> going to require a huge amount of effort that may amount to a total >> rewrite of the patch. > > Agreed. I think this needs very fundam

Re: doc: Clarify what "excluded" represents for INSERT ON CONFLICT

2022-06-30 Thread Robert Haas
On Thu, Jun 9, 2022 at 11:40 AM David G. Johnston wrote: > As one cannot place excluded in a FROM clause (subquery) in the > ON CONFLICT clause referring to it as a table, ... Well, it would be nice if you had included a test case rather than leaving it to the reviewer or committer to con

Re: Pluggable toaster

2022-06-30 Thread Nikita Malakhov
Rebased onto 15 REL BETA 2

Re: PATCH: Add Table Access Method option to pgbench

2022-06-30 Thread Michel Pelletier
I've got CI setup and building and the tests now pass, I was missing a CASCADE in my test. New patch attached: On Thu, 30 Jun 2022 at 10:50, Michel Pelletier wrote: > On Thu, 30 Jun 2022 at 09:51, Justin Pryzby wrote: > >> On Thu, Jun 30, 2022 at 09:09:17AM -0700, Michel Pelletier wrote: >>

[PATCH] fix wait_event of pg_stat_activity in case of high amount of connections

2022-06-30 Thread Michael Zhilin
Hi, I would like to submit patch for column wait_event of view pg_stat_activity. Please find it attached. The view pg_stat_activity provides snapshot of actual backends' state with following columns: - wait_event contains event name for which backend is waiting for; - state of backend, f

Patch to address creation of PgStat* contexts with null parent context

2022-06-30 Thread Reid Thompson
Hi, There are instances where pgstat_setup_memcxt() and pgstat_prep_pending_entry() are invoked before the CacheMemoryContext has been created.  This results in PgStat* contexts being created without a parent context.  Most easily reproduced/seen in autovacuum worker via pgstat_setup_memcxt(). A

[PATCH] Allow specification of custom slot for custom nodes

2022-06-30 Thread Alexander Korotkov
Hackers, we have supported custom nodes for while. Custom slots are a bit more "recent" feature. Since we now support custom slots, which could handle custom tuple format, why not allow custom nodes to use them? For instance, a custom table access method can have its own tuple format and use a cu

Re: Add red-black tree missing comparison searches

2022-06-30 Thread Alexander Korotkov
Hi, Steve! Thank you for working on this. On Thu, Jun 30, 2022 at 7:51 PM Steve Chavez wrote: > Currently the red-black tree implementation only has an equality search. > Other extensions might need other comparison searches, like less-or-equal or > greater-or-equal. For example OrioleDB defin

Re: making relfilenodes 56 bits

2022-06-30 Thread Robert Haas
On Wed, Jun 29, 2022 at 5:15 AM Dilip Kumar wrote: > PFA, the remaining set of patches. It might need to fix some > indentation but lets first see how is the overall idea then we can > work on it So just playing around with this patch set, and also looking at the code a bit, here are a few rand

Re: postgres_fdw: commit remote (sub)transactions in parallel during pre-commit

2022-06-30 Thread Jacob Champion
On 5/12/22 01:46, Etsuro Fujita wrote: > On Wed, May 11, 2022 at 7:39 PM Etsuro Fujita wrote: >> I’m planning to commit this as a follow-up patch for commit 04e706d42. > > Done. FYI, I think cfbot is confused about the patch under review here. (When I first opened the thread I thought the patch

Re: Write visibility map during CLUSTER/VACUUM FULL

2022-06-30 Thread Jacob Champion
Justin Pryzby wrote: > I'm planning to close this patch until someone can shepherd it. I've marked it RwF for now. --Jacob

Re: PSA: Autoconf has risen from the dead

2022-06-30 Thread Peter Eisentraut
On 24.01.22 09:11, Peter Eisentraut wrote: On 23.01.22 17:29, Tom Lane wrote: While chasing something else, I was surprised to learn that the Autoconf project has started to make releases again.  There are 2.70 (2020-12-08) and 2.71 (2021-01-28) versions available at https://ftp.gnu.org/gnu/auto

Re: PATCH: Add Table Access Method option to pgbench

2022-06-30 Thread Michel Pelletier
On Thu, 30 Jun 2022 at 09:51, Justin Pryzby wrote: > On Thu, Jun 30, 2022 at 09:09:17AM -0700, Michel Pelletier wrote: > > This change was originally authored by Alexander Korotkov, I have updated > > it and added a test to the pgbench runner. I'm hoping to make the > deadline > > for this curre

Re: making relfilenodes 56 bits

2022-06-30 Thread Robert Haas
On Wed, Jun 29, 2022 at 5:15 AM Dilip Kumar wrote: > >- It looks to me like you need to give significantly more thought to > > the proper way of adjusting the relfilenode-related test cases in > > alter_table.out. > > It seems to me that this test case is just testing whether the > table/child tab

Re: Hardening PostgreSQL via (optional) ban on local file system access

2022-06-30 Thread Bruce Momjian
On Thu, Jun 30, 2022 at 11:52:20AM -0400, Robert Haas wrote: > I don't think this would be very convenient in most scenarios, and I > think it would also be difficult to implement correctly. I don't think > you can get by with just having superuser() return false sometimes > despite pg_authid.rolsu

Re: vacuum verbose no longer reveals anything about pins

2022-06-30 Thread Peter Geoghegan
On Thu, Jun 30, 2022 at 8:43 AM Robert Haas wrote: > Ah, I missed that. I think that in the test case I was using, there > was a conflicting pin but there were no dead tuples, so that line > wasn't present in the output. Even if there was a DEAD tuple, your test would still have to account for op

Re: Add red-black tree missing comparison searches

2022-06-30 Thread Steve Chavez
Yes, I've already added it here: https://commitfest.postgresql.org/38/3742/ Thanks! On Thu, 30 Jun 2022 at 12:09, Greg Stark wrote: > Please add this to the commitfest at > https://commitfest.postgresql.org/38/ so it doesn't get missed. The > commitfest starts imminently so best add it today. >

Re: Add red-black tree missing comparison searches

2022-06-30 Thread Greg Stark
Please add this to the commitfest at https://commitfest.postgresql.org/38/ so it doesn't get missed. The commitfest starts imminently so best add it today.

Re: PATCH: Add Table Access Method option to pgbench

2022-06-30 Thread Justin Pryzby
On Thu, Jun 30, 2022 at 09:09:17AM -0700, Michel Pelletier wrote: > This change was originally authored by Alexander Korotkov, I have updated > it and added a test to the pgbench runner. I'm hoping to make the deadline > for this currently open Commit Fest? This is failing check-world http://cfbo

Add red-black tree missing comparison searches

2022-06-30 Thread Steve Chavez
Hello hackers, Currently the red-black tree implementation only has an equality search. Other extensions might need other comparison searches, like less-or-equal or greater-or-equal. For example OrioleDB defines a greater-or-equal search on its postgres fork: https://github.com/orioledb/postgres/

PATCH: Add Table Access Method option to pgbench

2022-06-30 Thread Michel Pelletier
Hello! This patch adds a `--tableam=TABLEAM` option to the pgbench command line which allows the user to specify which table am is used to create tables initialized with `-i`. This change was originally authored by Alexander Korotkov, I have updated it and added a test to the pgbench runner. I'm

Re: margay fails assertion in stats/dsa/dsm code

2022-06-30 Thread Robert Haas
On Wed, Jun 29, 2022 at 12:01 AM Thomas Munro wrote: > As for whether PostgreSQL needs to do anything, perhaps we should > ereport for this unexpected error as a matter of self-preservation, to > avoid the NULL dereference you'd presumably get on a non-cassert build > with the current coding? May

Re: Hardening PostgreSQL via (optional) ban on local file system access

2022-06-30 Thread Robert Haas
On Wed, Jun 29, 2022 at 3:46 AM Hannu Krosing wrote: > terminal 1: > psql > hannuk=# select pg_backend_pid(); > pg_backend_pid > > 1749025 > (1 row) > > terminal 2: > echo 1749025 > $PGDATA/allow_superuser > > back to terminal 1 still connected to backend with pid 1749025

Re: vacuum verbose no longer reveals anything about pins

2022-06-30 Thread Robert Haas
On Thu, Jun 30, 2022 at 11:33 AM Peter Geoghegan wrote: > On Thu, Jun 30, 2022 at 5:57 AM Robert Haas wrote: > > I was dismayed to learn that VACUUM VERBOSE on a table no longer tells > > you anything about whether any pages were skipped due to pins. > > VACUUM VERBOSE will show a dedicated line

Re: vacuum verbose no longer reveals anything about pins

2022-06-30 Thread Peter Geoghegan
On Thu, Jun 30, 2022 at 5:57 AM Robert Haas wrote: > I was dismayed to learn that VACUUM VERBOSE on a table no longer tells > you anything about whether any pages were skipped due to pins. VACUUM VERBOSE will show a dedicated line that reports on the number of pages that we couldn't get a cleanup

[Commitfest 2022-07] Begins Tomorrow

2022-06-30 Thread Jacob Champion
Hello all, I'll be opening the July Commitfest in approximately 24 hours, so you have a little more time to register any patchsets you'd like the community to review. And remember to keep your review karma positive: over the next month, try to review other patches of equivalent complexity to the p

Re: pg_auth_members.grantor is bunk

2022-06-30 Thread Robert Haas
On Fri, Jun 24, 2022 at 4:46 PM Robert Haas wrote: > Interesting. I hadn't thought about changing the behavior of DROP > OWNED BY and REASSIGN OWNED BY. A quick experiment supports your > interpretation: Here is a minimal patch fixing exactly $SUBJECT. Granting a role to another role now creates

Implement missing join selectivity estimation for range types

2022-06-30 Thread Mahmoud Sakr
Hi, Given a query: SELECT * FROM t1, t2 WHERE t1.r << t2.r where t1.r, t2.r are of range type, currently PostgreSQL will estimate a constant selectivity for the << predicate, which is equal to 0.005, not utilizing the statistics that the optimizer collects for range attributes. We have worked out

Re: Removing unneeded self joins

2022-06-30 Thread Andrey Lepikhov
On 19/5/2022 16:47, Ronan Dunklau wrote: I'll take a look at that one. New version of the patch, rebased on current master: 1. pgindent over the patch have passed. 2. number of changed files is reduced. 3. Some documentation and comments is added. -- regards, Andrey Lepikhov Postgres Profession

Re: replacing role-level NOINHERIT with a grant-level option

2022-06-30 Thread Robert Haas
On Wed, Jun 29, 2022 at 7:19 PM Nathan Bossart wrote: > > Here's a rather small patch that does it the first way. > > I've been thinking about whether we ought to WARNING or ERROR with the > deprecated syntax. WARNING has the advantage of not breaking existing > scripts, but users might not catch

Making pg_rewind faster

2022-06-30 Thread vignesh ravichandran
Hi Hackers, I have been using pg_rewind in production for 2 years. One of the things that I noticed in pg_rewind is if it doesn't know what to do with a file "it copies". I understand it's the more safer option. After all, the alternative, pg_basebackup copies all the files from source to tar

Re: pg_checkpointer is not a verb or verb phrase

2022-06-30 Thread Isaac Morland
On Thu, 30 Jun 2022 at 08:48, Robert Haas wrote: Almost all of these are verbs or verb phrases: having this role gives > you the ability to read all data, or write all data, or read all > settings, or whatever. But you can't say that having this role gives > you the ability to checkpointer. It gi

vacuum verbose no longer reveals anything about pins

2022-06-30 Thread Robert Haas
Hi, I was dismayed to learn that VACUUM VERBOSE on a table no longer tells you anything about whether any pages were skipped due to pins. Now the obvious explanation for that is that we no longer skip pages entirely just because we find that they are pinned. But I think failing to fully process a

pg_checkpointer is not a verb or verb phrase

2022-06-30 Thread Robert Haas
Hi, I was just looking at the list of predefined roles that we have, and pg_checkpointer is conspicuously not like the others: rhaas=# select rolname from pg_authid where oid!=10; rolname --- pg_database_owner pg_read_all_data pg_write_all_data pg_monitor pg

Re: pg_walcleaner - new tool to detect, archive and delete the unneeded wal files (was Re: pg_archivecleanup - add the ability to detect, archive and delete the unneeded wal files on the primary)

2022-06-30 Thread Peter Eisentraut
On 25.04.22 20:39, Stephen Frost wrote: All of which isn't an issue if we don't have an external tool trying to do this and instead have the server doing it as the server knows its internal status, that the archive command has been failing long enough to pass the configuration threshold, and that

Re: Add index item for MERGE.

2022-06-30 Thread Alvaro Herrera
On 2022-Jun-30, Fujii Masao wrote: > Hi, > > I found that there is no index item for MERGE command, in the docs. > Attached is the patch that adds the indexterm for MERGE to merge.sgml. +1 LGTM, thanks. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/

Support TRUNCATE triggers on foreign tables

2022-06-30 Thread Yugo NAGATA
Hello, I propose supporting TRUNCATE triggers on foreign tables because some FDW now supports TRUNCATE. I think such triggers are useful for audit logging or for preventing undesired truncate. Patch attached. Regards, Yugo Nagata -- Yugo NAGATA diff --git a/contrib/postgres_fdw/expected/postg

Re: doc phrase: "inheritance child"

2022-06-30 Thread Justin Pryzby
On Fri, May 27, 2022 at 03:22:38PM +0900, Amit Langote wrote: > On Wed, May 25, 2022 at 1:30 PM Ashutosh Bapat > wrote: > > > > - If true, the stats include inheritance child columns, not just the > > + If true, the stats include child tables, not just the > > > > We are repla

Re: [PATCH] Log details for client certificate failures

2022-06-30 Thread Graham Leggett
On 30 Jun 2022, at 10:43, Peter Eisentraut wrote: > I wrote that pg_stat_ssl uses the *issuer* plus serial number to identify a > certificate. What your patch shows is the subject and the serial number, > which isn't the same thing. Let's get that sorted out one way or the other. Quick obse

Re: [PATCH] Log details for client certificate failures

2022-06-30 Thread Peter Eisentraut
On 13.05.22 00:36, Jacob Champion wrote: On Thu, 2022-05-05 at 15:12 +, Jacob Champion wrote: On Wed, 2022-05-04 at 15:53 +0200, Peter Eisentraut wrote: In terms of aligning what is printed, I meant that pg_stat_ssl uses the issuer plus serial number to identify the certificate unambiguousl

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

2022-06-30 Thread Hamid Akhtar
On Thu, 30 Jun 2022 at 14:27, Bharath Rupireddy < bharath.rupireddyforpostg...@gmail.com> wrote: > On Thu, Jun 30, 2022 at 1:54 PM Hamid Akhtar > wrote: > > > >> Do we have any > >> difference in the execution times for the above query vs the new > >> function introduced in the v1 patch? If there

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

2022-06-30 Thread Bharath Rupireddy
On Thu, Jun 30, 2022 at 1:54 PM Hamid Akhtar wrote: > >> Do we have any >> difference in the execution times for the above query vs the new >> function introduced in the v1 patch? If there's not much difference, I >> would suggest adding an SQL function around the generate_series >> approach in th

Re: Patch proposal: New hooks in the connection path

2022-06-30 Thread Bharath Rupireddy
On Thu, Jun 30, 2022 at 1:31 PM Drouvot, Bertrand wrote: > > Hi hackers, > > While commit 960869da08 added some information about connections that have > been successfully authenticated, there is no metrics for connections that > have not (or did not reached the authentication stage). > > Adding

Re: fix stats_fetch_consistency value in postgresql.conf.sample

2022-06-30 Thread Kyotaro Horiguchi
Thanks! At Wed, 22 Jun 2022 16:07:10 -0700, Andres Freund wrote in > Hi, > > On 2022-06-17 09:43:58 +0900, Kyotaro Horiguchi wrote: > > +/* > > + * Convert value to unitless value according to the specified GUC variable > > + */ > > +Datum > > +pg_config_unitless_value(PG_FUNCTION_ARGS) > > +{

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

2022-06-30 Thread Hamid Akhtar
On Mon, 27 Jun 2022 at 15:52, Bharath Rupireddy < bharath.rupireddyforpostg...@gmail.com> wrote: > On Mon, Jun 27, 2022 at 1:40 PM Drouvot, Bertrand > wrote: > > > > Hi, > > > > On 6/27/22 9:31 AM, Hamid Akhtar wrote: > > > > > > Hello Hackers, > > > > While working on one of my blogs on the B-Tr

Re: Strange failures on chipmunk

2022-06-30 Thread Heikki Linnakangas
On 30/06/2022 09:31, Noah Misch wrote: On Thu, Jun 30, 2022 at 10:07:18AM +1200, Thomas Munro wrote: Then there's this one-off, that smells like WAL corruption: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=chipmunk&dt=2022-06-13%2015%3A12%3A44 2022-06-13 23:02:06.988 EEST [30121:5]

Re: JSON/SQL: jsonpath: incomprehensible error message

2022-06-30 Thread Amit Kapila
On Wed, Jun 29, 2022 at 6:58 PM Erik Rijkers wrote: > > Op 29-06-2022 om 15:00 schreef Amit Kapila: > > On Mon, Jun 27, 2022 at 8:46 PM Andrew Dunstan wrote: > >> > >> On 2022-06-26 Su 11:44, Erik Rijkers wrote: > >>> JSON/SQL jsonpath > >>> > >>> For example, a jsonpath string with deliberate ty

Re: Support logical replication of DDLs

2022-06-30 Thread Amit Kapila
On Thu, Jun 30, 2022 at 11:44 AM Amit Kapila wrote: > > On Wed, Jun 29, 2022 at 3:17 PM houzj.f...@fujitsu.com > wrote: > > > > On Tuesday, June 28, 2022 11:27 AM Amit Kapila > > > > > > +1. I think it doesn't make sense to replicate temporary tables. > > > Similarly, we don't need to replicate

Re: making relfilenodes 56 bits

2022-06-30 Thread Simon Riggs
On Thu, 30 Jun 2022 at 03:43, Thomas Munro wrote: > > On Thu, Jun 30, 2022 at 12:41 AM Simon Riggs > wrote: > > The reason to mention this now is that it would give more space than > > 56bit limit being suggested here. > > Isn't 2^56 enough, though? For me, yes. To the above comment, I followed

Patch proposal: New hooks in the connection path

2022-06-30 Thread Drouvot, Bertrand
Hi hackers, While commit 960869da08 added some information about connections that have been successfully authenticated, there is no metrics for connections that have not (or did not reached the authentication stage). Adding metrics about failed connections attempts could also help, for examp