Re: Virtual generated columns

2025-01-08 Thread Richard Guo
On Fri, Nov 29, 2024 at 7:14 PM Peter Eisentraut wrote: > Here is a new patch version, with several updates. > - Added support for ALTER TABLE ... SET EXPRESSION. When using ALTER TABLE to set expression for virtual generated columns, we don't enforce a rewrite, which means we don't have the opp

Re: Conflict detection for update_deleted in logical replication

2025-01-08 Thread Masahiko Sawada
On Tue, Jan 7, 2025 at 2:49 AM Amit Kapila wrote: > > On Mon, Jan 6, 2025 at 4:52 PM Zhijie Hou (Fujitsu) > wrote: > > > > On Friday, January 3, 2025 2:36 PM Masahiko Sawada > > wrote: > > > > > > > > + /* > > > +* The changes made by this and later transactions are still > > > no

Fix a wrong errmsg in AlterRole()

2025-01-08 Thread cca5507
Hi, ``` postgres=# create group g1; CREATE ROLE postgres=# create role r1 in group g1; CREATE ROLE postgres=# set session authorization r1; SET postgres=> alter group g1 drop user r1; ERROR:  permission denied to alter role DETAIL:  Only roles with the ADMIN option on role "g1" may add members. `

Re: EphemeralNamedRelation and materialized view

2025-01-08 Thread Yugo NAGATA
On Mon, 30 Dec 2024 16:06:06 -0500 Tom Lane wrote: > Yugo NAGATA writes: > > On Wed, 20 Nov 2024 12:43:16 -0500 > > Tom Lane wrote: > >> ... It seems to me that we should > >> think about this, for MVs as well as those other object types, > >> as fundamentally a dependency problem. That is, th

Re: Conflict detection for update_deleted in logical replication

2025-01-08 Thread Amit Kapila
On Wed, Jan 8, 2025 at 2:15 PM Masahiko Sawada wrote: > > On Tue, Jan 7, 2025 at 2:49 AM Amit Kapila wrote: > > > > > > We thought of another approach, which is to create/drop this slot first as > > > soon as one enables/disables detect_update_deleted (E.g. create/drop slot > > > during DDL). But

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-01-08 Thread Kashif Zeeshan
On Wed, Jan 8, 2025 at 3:21 AM Jacob Champion < jacob.champ...@enterprisedb.com> wrote: > On Fri, Dec 20, 2024 at 2:21 PM Daniel Gustafsson wrote: > > > > > On 20 Dec 2024, at 02:00, Jacob Champion < > jacob.champ...@enterprisedb.com> wrote: > > > > Thanks for the new version, I was doing a v39 r

Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints

2025-01-08 Thread Alvaro Herrera
On 2024-Nov-25, Suraj Kharage wrote: > Another case which needs conclusion is - > When changing from INHERIT to NO INHERIT, we need to walk all children and > decrement coninhcount for the corresponding constraint. If a constraint in > one child reaches zero, should we drop it? not sure. If we do

Re: Conflict detection for update_deleted in logical replication

2025-01-08 Thread Masahiko Sawada
On Thu, Dec 19, 2024 at 11:11 PM Nisha Moond wrote: > > Here is further performance test analysis with v16 patch-set. > > > In the test scenarios already shared on -hackers [1], where pgbench was run > only on the publisher node in a pub-sub setup, no performance degradation was > observed on ei

Re: Re: proposal: schema variables

2025-01-08 Thread jian he
hi. you forgot change acldefault should add 'V' for SESSION VARIABLE in doc/src/sgml/ddl.sgml maybe some examples () of session variables being shadowed would be great. because doc/src/sgml/ref/create_variable.sgml said Session variables can be shadowed by other identifiers. For

Re: pg_settings.unit and DefineCustomXXXVariable

2025-01-08 Thread Matthias van de Meent
On Wed, 8 Jan 2025 at 11:13, Luca Ferrari wrote: > > Hi all, > I need to define a few GUCs, and for that purpose I'm using > DefineCustomXXXVariable functions that provide hooks for assignment, > show and check. However it is not clear to me if it is possible to > populate the unit column in pg_se

Re: Conflict detection for update_deleted in logical replication

2025-01-08 Thread Masahiko Sawada
On Wed, Jan 8, 2025 at 1:53 AM Amit Kapila wrote: > > On Wed, Jan 8, 2025 at 3:02 PM Masahiko Sawada wrote: > > > > On Thu, Dec 19, 2024 at 11:11 PM Nisha Moond > > wrote: > > > > > > Here is further performance test analysis with v16 patch-set. > > > > > > > > > In the test scenarios already s

Re: Coccinelle for PostgreSQL development [1/N]: coccicheck.py

2025-01-08 Thread Andrew Dunstan
On 2025-01-07 Tu 2:44 PM, Mats Kindahl wrote: I got some time over during the holidays, so I spent some of it doing something I've been thinking about for a while. For those of you that are not aware of it: Coccinelle is a tool for pattern matching and text transformation for C code and can

Re: per backend WAL statistics

2025-01-08 Thread Bertrand Drouvot
Hi, On Wed, Jan 08, 2025 at 03:21:26PM +0900, Michael Paquier wrote: > On Tue, Jan 07, 2025 at 08:48:51AM +, Bertrand Drouvot wrote: > > Now that commit 9aea73fc61 added backend-level statistics to pgstats (and > > per backend IO statistics), we can more easily add per backend statistics. > >

Re: Enhancing Memory Context Statistics Reporting

2025-01-08 Thread Rahila Syed
Hi Fujii-san, Thank you for testing the feature. > Issue 1: Error with pg_get_process_memory_contexts() > When I used pg_get_process_memory_contexts() on the PID of a backend > process > that had just caused an error but hadn’t rolled back yet, > the following error occurred: > >Session 1 (P

Re: Enhancing Memory Context Statistics Reporting

2025-01-08 Thread Fujii Masao
On 2025/01/08 21:03, Rahila Syed wrote: I have not been able to reproduce this issue. Could you please clarify which process you ran |pg_get_process_memory_context()| on, with the interval of 0.1? I used the following query for testing: =# SELECT count(*) FROM pg_stat_activity, pg_get_proc

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-01-08 Thread Jacob Champion
On Tue, Jan 7, 2025 at 2:24 PM Jacob Champion wrote: > Along those lines, though, Michael Paquier suggested that maybe I > could pull the require_auth prefactoring up to the front of the > patchset. That might look a bit odd until OAuth support lands, since > it won't be adding any new useful valu

Re: New GUC autovacuum_max_threshold ?

2025-01-08 Thread Frédéric Yhuel
On 1/7/25 23:57, Nathan Bossart wrote: Here is a rebased patch for cfbot. AFAICT we are still pretty far from consensus on which approach to take, unfortunately. For what it's worth, although I would have preferred the sub-linear growth thing, I'd much rather have this than nothing. And

Re: psql: Option to use expanded mode for various meta-commands

2025-01-08 Thread Dean Rasheed
On Mon, 30 Dec 2024 at 15:48, Greg Sabino Mullane wrote: > > I like this, very useful. It's a shame about the conflict with \dx (lesson > for the future: think extra carefully about option namings!). I am impressed > that \dx \d \d+ \d+x and even \dxx all work as one might intuit with >

Logical replication - proposal for a custom conflict resolution function

2025-01-08 Thread Diego Fronza
Hello hackers, I'd like some feedback on a logical replication feature I would like to write a patch for. The feature would allow users to register a custom conflict handler function to be executed for each conflicting row, after the built-in conflict resolver has run. Running after the built-in c

Re: Virtual generated columns

2025-01-08 Thread Marcos Pegoraro
Em qua., 8 de jan. de 2025 às 16:23, Vik Fearing escreveu: > This is lying to the planner, and you get to enjoy whatever breaks > because of it. A function that accesses external data is not immutable; > it is stable at best. > I understand that, but it's not documented, so users can think that

Re: using PGOPTIONS in meson

2025-01-08 Thread Andres Freund
Hi, On 2025-01-08 23:27:42 +0800, jian he wrote: > hi. > i am wondering ways to do > ``make check PGOPTIONS="-c debug_parallel_query=regress -c work_mem=50MB"`` > in meson way, especially the PGOPTIONS part. > > I have looked at [1] and [2]. > [1] > https://www.postgresql.org/docs/current/regres

Re: Fwd: Re: A new look at old NFS readdir() problems?

2025-01-08 Thread Tom Lane
Bruce Momjian writes: > Will people now always get a clear error on failure? Crazy idea, but > could we have initdb or postmaster start test this? It'd require adding quite a lot of cycles: I'd guess you'd need to create/drop a hundred or a thousand files to be sure of seeing the problem. Anot

Re: Fwd: Re: A new look at old NFS readdir() problems?

2025-01-08 Thread Bruce Momjian
On Wed, Jan 8, 2025 at 03:21:27PM -0500, Tom Lane wrote: > Bruce Momjian writes: > > Will people now always get a clear error on failure? Crazy idea, but > > could we have initdb or postmaster start test this? > > It'd require adding quite a lot of cycles: I'd guess you'd need to > create/drop

Re: improve DEBUG1 logging of parallel workers for CREATE INDEX?

2025-01-08 Thread Guillaume Lelarge
Hi, Le mer. 8 janv. 2025 à 18:37, Sami Imseih a écrit : > > s/parallel vacuum workers for index vacuuming/parallel workers for index > creation/? > > oops, that's my oversight from copying the message from vacuum. fixed. > > > I'd add "in parallel" to match its counterpart "serially" above. That

Re: use a non-locking initial test in TAS_SPIN on AArch64

2025-01-08 Thread Tom Lane
Nathan Bossart writes: > Are there any objections to proceeding with this change? So far, it's been > tested on a c8g.24xlarge and an Apple M3 (which seems to be too small to > show any effect). If anyone has access to a larger ARM machine, additional > testing would be greatly appreciated. I t

Re: AIO v2.0

2025-01-08 Thread Andres Freund
Hi, On 2025-01-08 15:04:39 +0100, Jakub Wartak wrote: > On Mon, Jan 6, 2025 at 5:28 PM Andres Freund wrote: > > I didn't think that pg_stat_* was quite the right namespace, given that it > > shows not stats, but the currently ongoing IOs. I am going with pg_aios for > > now, but I don't particul

Re: improve DEBUG1 logging of parallel workers for CREATE INDEX?

2025-01-08 Thread Tom Lane
Sami Imseih writes: > I am curious what are the thoughts on introducing a > CREATE INDEX VERBOSE which can provide this info? > similar to users scripting VACUUM VERBOSE to log > more details about the vacuum operation including parallel > usage. What I can recall being discussed in the past is t

Re: Non-text mode for pg_dumpall

2025-01-08 Thread Guillaume Lelarge
Hi, Le mer. 8 janv. 2025 à 17:41, Mahendra Singh Thalor a écrit : > On Wed, 8 Jan 2025 at 20:07, Mahendra Singh Thalor > wrote: > > > > Hi all, > > > > On Wed, 8 Jan 2025 at 00:34, Mahendra Singh Thalor > wrote: > > > > > > On Mon, 6 Jan 2025 at 23:05, Nathan Bossart > wrote: > > > > > > > >

Re: Add the ability to limit the amount of memory that can be allocated to backends.

2025-01-08 Thread James Hunter
On Mon, Jan 6, 2025 at 1:07 PM Jim Nasby wrote: > > I’ve been saying “workload management” for lack of a better term, but my > initial suggestion upthread was to simply stop allowing new transactions to > start if global work_mem consumption exceeded some threshold. That’s > simplistic enough t

Re: New GUC autovacuum_max_threshold ?

2025-01-08 Thread Robert Treat
On Wed, Jan 8, 2025 at 3:01 PM Nathan Bossart wrote: > > On Wed, Jan 08, 2025 at 02:48:10PM +0100, Frédéric Yhuel wrote: > > For what it's worth, although I would have preferred the sub-linear growth > > thing, I'd much rather have this than nothing. > > +1, this is how I feel, too. But I also do

Re: Conflict detection for update_deleted in logical replication

2025-01-08 Thread Masahiko Sawada
On Wed, Jan 8, 2025 at 3:00 AM Zhijie Hou (Fujitsu) wrote: > > On Wednesday, January 8, 2025 6:33 PM Masahiko Sawada > wrote: > > Hi, > > > On Wed, Jan 8, 2025 at 1:53 AM Amit Kapila > > wrote: > > > On Wed, Jan 8, 2025 at 3:02 PM Masahiko Sawada > > wrote: > > > > > > > > On Thu, Dec 19, 2024

Re: Moving the vacuum GUCs' docs out of the Client Connection Defaults section

2025-01-08 Thread Melanie Plageman
On Wed, Jan 8, 2025 at 8:39 AM Peter Eisentraut wrote: > > On 07.01.25 18:31, Melanie Plageman wrote: > > > > Oh, one thing I forgot to say. Though I increased the indentation of > > some of the subsections that I moved, I didn't rewrap the lines > > because they were already not wrapped to 78. I

Re: Fix a wrong errmsg in AlterRole()

2025-01-08 Thread cca5507
Hi, I modified the patch according to Tom's suggestion. -- Regards, ChangAo Chen v2-0001-Fix-a-wrong-errdetail-in-AlterRole.patch Description: Binary data

Re: pgindent exit status if a file encounters an error

2025-01-08 Thread Ashutosh Bapat
On Wed, Jan 8, 2025 at 9:35 PM Andrew Dunstan wrote: > > > > I forget now what I was intending here, so I have committed this with minor > tweaks. > > Thanks Andrew for taking care of this. -- Best Wishes, Ashutosh Bapat

Re: Make pg_stat_io view count IOs as bytes instead of blocks

2025-01-08 Thread Nazir Bilal Yavuz
Hi, Thanks for the review! On Thu, 9 Jan 2025 at 05:59, Michael Paquier wrote: > > On Thu, Dec 26, 2024 at 02:41:26PM +0300, Nazir Bilal Yavuz wrote: > > Thanks! v4 is attached. I quickly tested the pg_stat_get_backend_io() > > function and it seems it is working. > > Thanks a lot for the rebase

Re: per backend WAL statistics

2025-01-08 Thread Bertrand Drouvot
Hi, On Thu, Jan 09, 2025 at 01:03:15PM +0900, Michael Paquier wrote: > On Wed, Jan 08, 2025 at 11:11:59AM +, Bertrand Drouvot wrote: > > Yeah, that's more elegant as it also means that the main callback will not > > change > > (should we add even more stats in the future). Done that way in v2

RE: Log a warning in pg_createsubscriber for max_slot_wal_keep_size

2025-01-08 Thread Hayato Kuroda (Fujitsu)
Dear Shubham, Thanks for updating the patch. Few comments. ``` +#include "common/int.h"/* include for strtoi64 */ ``` I could build the source code without the inclusion. Can you remove? ``` + max_slot_wal_keep_size = strtoi64(PQgetvalue(res, 0, 6), NULL, 0); + +

Re: Several buildfarm animals fail tests because of shared memory error

2025-01-08 Thread Robins Tharakan
On Thu, 9 Jan 2025 at 15:30, Alexander Lakhin wrote: > > Maybe you could try to reproduce such failures without buildfarm client, just > by running select_parallel, for example, with the attached patch applied. > I mean running `make check` with parallel_schedule like: > ... > Or > TESTS="test_set

Re: per backend WAL statistics

2025-01-08 Thread Michael Paquier
On Wed, Jan 08, 2025 at 11:11:59AM +, Bertrand Drouvot wrote: > Yeah, that's more elegant as it also means that the main callback will not > change > (should we add even more stats in the future). Done that way in v2 attached. I've put my hands on v2-0002 to begin with something. +/* flag bi

Re: WAL-logging facility for pgstats kinds

2025-01-08 Thread Michael Paquier
On Thu, Jan 02, 2025 at 08:08:42PM -0500, Andres Freund wrote: > I can't think of a real case where we would want to WAL log the stats > themselves, rather than re-emitting stats during replay based on the WAL > record of the "underlying object". > > Do you have counter-examples? I'm not sure if

Re: Proposal: add new API to stringinfo

2025-01-08 Thread Tatsuo Ishii
> If it's not too much work to coax the compiler to do so, then I don't see a > strong reason to avoid it. Granted, there are probably much more expensive > parts of the StringInfo support functions (e.g., palloc()), but these are > hot enough code paths that IMHO it's worth saving whatever cycles

Re: Question about behavior of deletes with REPLICA IDENTITY NOTHING

2025-01-08 Thread Peter Smith
On Sat, Jan 4, 2025 at 4:23 AM Robert Treat wrote: > > On Wed, Dec 18, 2024 at 5:56 AM Amit Kapila wrote: > > > > On Thu, Feb 8, 2024 at 9:57 AM Laurenz Albe > > wrote: > > > > > > On Thu, 2024-02-08 at 13:40 +1100, Peter Smith wrote: > > > > - how to set the replica identity. If a table wit

RE: ecpg command does not warn COPY ... FROM STDIN;

2025-01-08 Thread Hayato Kuroda (Fujitsu)
Dear Tom, Fujii-san, > > ISTM that ecpg supports COPY TO STDOUT and includes the regression test > "copystdout" for it. No? > > Oh right. (Pokes at it...) It looks like the backend accepts > "FROM STDOUT" as a synonym for "FROM STDIN", so that's why this > is checking for both spellings. But I

Re: pure parsers and reentrant scanners

2025-01-08 Thread Peter Eisentraut
On 20.12.24 16:23, Tom Lane wrote: Ok, we can fix that, but maybe this is also a good moment to think about whether that is useful. I could not reproduce the issue with flex 2.5.39. I could find no download of flex 2.5.35. The github site only offers back to 2.5.39, the sourceforce site back t

Re: Coccinelle for PostgreSQL development [4/N]: correcting palloc() use

2025-01-08 Thread Mats Kindahl
On Wed, Jan 8, 2025 at 10:02 PM Peter Eisentraut wrote: > On 07.01.25 20:49, Mats Kindahl wrote: > > This is the first example semantic patch and shows how to capture and > > fix a common problem. > > > > If you use an palloc() to allocate memory for an object (or an array of > > objects) and by

Re: [PATCH] Add get_bytes() and set_bytes() functions

2025-01-08 Thread Michael Paquier
On Fri, Oct 18, 2024 at 05:20:42PM +0300, Aleksander Alekseev wrote: > Rebased, v5. v5-0001 includes the following output: --- a/src/test/regress/expected/opr_sanity.out +++ b/src/test/regress/expected/opr_sanity.out @@ -126,9 +126,12 @@ WHERE p1.oid < p2.oid AND p1.proretset != p2.proretse

RE: Conflict detection for update_deleted in logical replication

2025-01-08 Thread Zhijie Hou (Fujitsu)
On Thursday, January 9, 2025 9:48 AM Masahiko Sawada Hi, > > On Wed, Jan 8, 2025 at 3:00 AM Zhijie Hou (Fujitsu) > wrote: > > > > On Wednesday, January 8, 2025 6:33 PM Masahiko Sawada > wrote: > > > > Hi, > > > > > On Wed, Jan 8, 2025 at 1:53 AM Amit Kapila > > > wrote: > > > > On Wed, Jan 8

Re: Conflict detection for update_deleted in logical replication

2025-01-08 Thread Amit Kapila
On Wed, Jan 8, 2025 at 2:24 PM Amit Kapila wrote: > > On Wed, Jan 8, 2025 at 2:15 PM Masahiko Sawada wrote: > > > > On Tue, Jan 7, 2025 at 2:49 AM Amit Kapila wrote: > > > > > > > > We thought of another approach, which is to create/drop this slot first > > > > as > > > > soon as one enables/di

Re: Psql meta-command conninfo+

2025-01-08 Thread Hunaid Sohail
Hi, After looking at this ever more today, I think "Server Parameter Settings" > is confusing as well. I think "Connection Status" instead of > "Current Status" as is defined in v36 will work better. > This way we will have "Connection Info" and "Connection Status". > Connection Status will reflec

Re: Fix bank selection logic in SLRU

2025-01-08 Thread Alvaro Herrera
On 2024-Dec-27, Andrey Borodin wrote: > > On 19 Dec 2024, at 20:48, Yura Sokolov wrote: > > > > Here's version with type change bits16 -> uint16 > > Thanks! This version looks good to me. I’ll mark the CF entry as RfC. Thank you, I have pushed this. -- Álvaro Herrera 48°01'N 7°

Re: Log a warning in pg_createsubscriber for max_slot_wal_keep_size

2025-01-08 Thread Shubham Khanna
On Mon, Jan 6, 2025 at 3:22 AM Peter Smith wrote: > > Hi Shubham. > > The patch v6-0001 LGTM. > > OTOH, if you want to be picky, the docs wording could be slightly > modified to be more consistent with the coded warning message. > > CURRENT > Replication failures can occur if required WAL files ar

Re: Log a warning in pg_createsubscriber for max_slot_wal_keep_size

2025-01-08 Thread Shubham Khanna
On Mon, Jan 6, 2025 at 7:59 AM Hayato Kuroda (Fujitsu) wrote: > > Dear Shubham, > > Thanks for creating a patch. I have one comment about it. > > check_publisher() assumed that the SQL function > `pg_catalog.current_setting('max_slot_wal_keep_size')` > will return the numeric, but it just return

Orphaned users in PG16 and above can only be managed by Superusers

2025-01-08 Thread Ashutosh Sharma
Hi All, Starting from PG16, it seems that orphaned users can only be managed by superusers. For example, if userA creates userB, and userB creates userC, then both userB (the parent of userC) and userA (the grandparent of userC) would typically have the ability to manage/administer userC. However,

Re: Several buildfarm animals fail tests because of shared memory error

2025-01-08 Thread Alexander Lakhin
Hello Robins, 22.12.2024 09:27, Robins Tharakan wrote: - The only info about leafhopper may be relevant is that it's one of the newest machines (Graviton4) so it comes with a recent hardware / kernel / stock gcc 11.4.1. Could you please take a look at leafhopper. which is producing weird tes

Re: ecpg command does not warn COPY ... FROM STDIN;

2025-01-08 Thread Fujii Masao
On 2025/01/09 0:42, Tom Lane wrote: Fujii Masao writes: On 2025/01/08 23:04, Ryo Kanbayashi wrote: But it is not working. ecpg command fails to notice though code like above exits on pgc code. This issue seems to have been introduced in commit 3d009e45bd. Indeed :-( As for COPY FROM S

Re: pgindent exit status if a file encounters an error

2025-01-08 Thread Andrew Dunstan
On 2024-06-28 Fr 8:35 AM, Ashutosh Bapat wrote: On Wed, Jun 26, 2024 at 8:54 PM Tom Lane wrote: Ashutosh Bapat writes: > The usage help mentions exit code 2 specifically while describing --check > option but it doesn't mention exit code 1. Neither does the README. So I

Re: Virtual generated columns

2025-01-08 Thread Peter Eisentraut
On 04.12.24 05:55, jian he wrote: On Fri, Nov 29, 2024 at 6:13 PM Peter Eisentraut wrote: - Added support for virtual columns in trigger column lists. (For that, I renamed ExecInitStoredGenerated() to ExecInitGenerated(), which handles the computation of ri_extraUpdatedCols.) why not dupli

Re: Virtual generated columns

2025-01-08 Thread Peter Eisentraut
On 11.12.24 07:49, jian he wrote: On Fri, Nov 29, 2024 at 6:01 PM Peter Eisentraut wrote: The purpose of check_modified_virtual_generated() for trigger functions written in C. The prevent someone from inserting real values into the trigger tuples, because they would then be processed by the re

Re: Virtual generated columns

2025-01-08 Thread Peter Eisentraut
On 16.12.24 15:34, jian he wrote: hi. some minor issues... SET EXPRESSION AS This form replaces the expression of a generated column. Existing data in the column is rewritten and all the future changes will apply the new generation expression.

Re: Virtual generated columns

2025-01-08 Thread Peter Eisentraut
On 03.12.24 15:15, jian he wrote: -- check constraints CREATE TABLE gtest20 (a int PRIMARY KEY, b int GENERATED ALWAYS AS (a * 2) VIRTUAL CHECK (b < 50)); INSERT INTO gtest20 (a) VALUES (10); -- ok INSERT INTO gtest20 (a) VALUES (30); -- violates constraint ALTER TABLE gtest20 ALTER COLUMN b S

Re: ecpg command does not warn COPY ... FROM STDIN;

2025-01-08 Thread Tom Lane
Fujii Masao writes: > On 2025/01/09 0:42, Tom Lane wrote: >> There's another problem: the correct syntax is COPY TO STDOUT, >> and that won't trigger this warning either. > ISTM that ecpg supports COPY TO STDOUT and includes the regression test > "copystdout" for it. No? Oh right. (Pokes at it

Re: use a non-locking initial test in TAS_SPIN on AArch64

2025-01-08 Thread Nathan Bossart
On Tue, Oct 22, 2024 at 02:54:57PM -0500, Nathan Bossart wrote: > My colleague Salvatore Dipietro (CC'd) sent me a couple of profiles that > showed an enormous amount of s_lock() time going to the > __sync_lock_test_and_set() call in the AArch64 implementation of tas(). > Upon closer inspection, I

Re: doc: Mention clock synchronization recommendation for hot_standby_feedback

2025-01-08 Thread Jakub Wartak
On Wed, Dec 18, 2024 at 10:33 AM Amit Kapila wrote: Hi Amit! > On Thu, Dec 5, 2024 at 3:14 PM Jakub Wartak > wrote: > > > > One of our customers ran into a very odd case, where hot standby feedback > > backend_xmin propagation stopped working due to major (hours/days) clock > > time shifts on

Re: Reorder shutdown sequence, to flush pgstats later

2025-01-08 Thread Heikki Linnakangas
On 08/01/2025 04:10, Andres Freund wrote: I instead opted to somewhat rearrange the shutdown sequence: This commit changes the shutdown sequence so checkpointer is signalled to trigger writing the shutdown checkpoint without terminating it. Once checkpointer wrote the checkpoint i

Re: Moving the vacuum GUCs' docs out of the Client Connection Defaults section

2025-01-08 Thread Peter Eisentraut
On 07.01.25 18:31, Melanie Plageman wrote: On Tue, Jan 7, 2025 at 12:15 PM Melanie Plageman wrote: Cool, I've attached a patch to do this. I left a few of the GUCs under Resource Consumption (like autovacuum_work_mem and vacuum_buffer_usage_limit) where they are because it seemed appropriate.

Re: Non-text mode for pg_dumpall

2025-01-08 Thread Mahendra Singh Thalor
Hi all, On Wed, 8 Jan 2025 at 00:34, Mahendra Singh Thalor wrote: > > On Mon, 6 Jan 2025 at 23:05, Nathan Bossart wrote: > > > > On Thu, Jan 02, 2025 at 02:05:13AM +0530, Mahendra Singh Thalor wrote: > > > Here, I am attaching an updated patch. I fixed some bugs of v01 patch and > > > did some c

Re: improve DEBUG1 logging of parallel workers for CREATE INDEX?

2025-01-08 Thread Bertrand Drouvot
Hi, On Fri, Jan 03, 2025 at 12:30:14PM -0600, Sami Imseih wrote: > While reviewing patch [1], I realized that the DEBUG1 message > for CREATE INDEX could do better in providing information > about parallel workers launched. Currently, the message just > shows how many workers are planned, but a us

Re: ecpg command does not warn COPY ... FROM STDIN;

2025-01-08 Thread Ryo Kanbayashi
Kuroda-san, thank to your comment. > > I found a code validation bug in master branch. > > > > Now, ecpg does not support 'EXEC SQL COPY ... FROM STDIN ... ;' and > > code for warning it exits. > > > > https://github.com/postgres/postgres/blob/7b27f5fd36cb3270e8ac25aefd73b55 > > 2663d1392/src/inte

Re: AIO v2.0

2025-01-08 Thread Jakub Wartak
On Mon, Jan 6, 2025 at 5:28 PM Andres Freund wrote: > > Hi, > > On 2024-12-19 17:29:12 -0500, Andres Freund wrote: > > > Not about patch itself, but questions about related stack functionality: > > > --

Re: Reorder shutdown sequence, to flush pgstats later

2025-01-08 Thread Bertrand Drouvot
Hi, On Wed, Jan 08, 2025 at 03:10:03PM +0200, Heikki Linnakangas wrote: > On 08/01/2025 04:10, Andres Freund wrote: > > > elog(DEBUG1, "updating PMState from %d/%s to %d/%s", > > pmState, pmstate_name(pmState), newState, > > pmstate_name(newState)); > > I think the state names

Re: pg_settings.unit and DefineCustomXXXVariable

2025-01-08 Thread Tom Lane
Matthias van de Meent writes: > On Wed, 8 Jan 2025 at 11:13, Luca Ferrari wrote: >> I need to define a few GUCs, and for that purpose I'm using >> DefineCustomXXXVariable functions that provide hooks for assignment, >> show and check. However it is not clear to me if it is possible to >> populate

Re: ecpg command does not warn COPY ... FROM STDIN;

2025-01-08 Thread Fujii Masao
On 2025/01/08 23:04, Ryo Kanbayashi wrote: But it is not working. ecpg command fails to notice though code like above exits on pgc code. This issue seems to have been introduced in commit 3d009e45bd. Before that, as per my testing, ecpg successfully detected COPY FROM STDIN and reported a wa

Re: CREATE TABLE NOT VALID for check and foreign key

2025-01-08 Thread Alvaro Herrera
Hello, On 2025-Jan-07, Yasuo Honda wrote: > I'd like PostgreSQL to raise errors and/or warnings for the NOT VALID > check constraint for CREATE TABLE. > Ruby on Rails supports creating check constraints with the NOT VALID > option and I was not aware that it is just ignored until > https://github

RE: ecpg command does not warn COPY ... FROM STDIN;

2025-01-08 Thread Hayato Kuroda (Fujitsu)
Dear Kanbayashi-san, > I found a code validation bug in master branch. > > Now, ecpg does not support 'EXEC SQL COPY ... FROM STDIN ... ;' and > code for warning it exits. > > https://github.com/postgres/postgres/blob/7b27f5fd36cb3270e8ac25aefd73b55 > 2663d1392/src/interfaces/ecpg/preproc/ecpg.a

Re: Virtual generated columns

2025-01-08 Thread Peter Eisentraut
On 08.01.25 09:22, Richard Guo wrote: - Added support for ALTER TABLE ... SET EXPRESSION. When using ALTER TABLE to set expression for virtual generated columns, we don't enforce a rewrite, which means we don't have the opportunity to check whether the new values for these columns could cause an

Re: Separate GUC for replication origins

2025-01-08 Thread Euler Taveira
On Thu, Dec 19, 2024, at 10:31 AM, Peter Eisentraut wrote: > On 10.12.24 19:41, Euler Taveira wrote: > > I'm attaching a patch that adds max_replication_origins. It basically > > replaces > > all of the points that refers to max_replication_slots on the subscriber. It > > uses the same default val

Re: ecpg command does not warn COPY ... FROM STDIN;

2025-01-08 Thread Tom Lane
Fujii Masao writes: > On 2025/01/08 23:04, Ryo Kanbayashi wrote: > But it is not working. > ecpg command fails to notice though code like above exits on pgc code. > This issue seems to have been introduced in commit 3d009e45bd. Indeed :-( > As for COPY FROM STDOUT, while it's possible, mentioni

Re: improve DEBUG1 logging of parallel workers for CREATE INDEX?

2025-01-08 Thread Sami Imseih
> s/parallel vacuum workers for index vacuuming/parallel workers for index > creation/? oops, that's my oversight from copying the message from vacuum. fixed. > I'd add "in parallel" to match its counterpart "serially" above. That would > make it more clear in case one just look for "building in

Re: Fwd: Re: A new look at old NFS readdir() problems?

2025-01-08 Thread Bruce Momjian
On Tue, Jan 7, 2025 at 01:03:05AM +, David Steele wrote: > > > I'm more concerned about the report we saw on SUSE/NFS [1]. If that > > > report is accurate it indicates this may not be something we can just > > > document and move on from -- unless we are willing to entirely drop > > > support

Re: Fix a wrong errmsg in AlterRole()

2025-01-08 Thread Nathan Bossart
On Wed, Jan 08, 2025 at 10:29:12AM -0500, Tom Lane wrote: > "=?ISO-8859-1?B?Y2NhNTUwNw==?=" writes: >> postgres=> alter group g1 drop user r1; >> ERROR: permission denied to alter role >> DETAIL: Only roles with the ADMIN option on role "g1" may add members. > >> The errmsg is "add members", bu

Re: jsonb_strip_nulls with arrays?

2025-01-08 Thread Andrew Dunstan
On 2024-09-17 Tu 4:53 PM, Florents Tselai wrote: We could, if we're going to do anything at all in this area. Another possibility would be to provide a second optional parameter for json{b}_strip_nulls. That's probably a better way to go. Here's a patch that adds that argument (onl

Re: Virtual generated columns

2025-01-08 Thread Tom Lane
Peter Eisentraut writes: > On 03.12.24 15:15, jian he wrote: >> SELECT attrelid, attname, attgenerated FROM pg_attribute WHERE >> attgenerated IN ('v') and (attnotnull or not atthasdef); > I don't understand what the purpose of testing attnotnull is. That is > independent of attgenerated, I thi

Re: Non-text mode for pg_dumpall

2025-01-08 Thread Mahendra Singh Thalor
On Wed, 8 Jan 2025 at 20:07, Mahendra Singh Thalor wrote: > > Hi all, > > On Wed, 8 Jan 2025 at 00:34, Mahendra Singh Thalor wrote: > > > > On Mon, 6 Jan 2025 at 23:05, Nathan Bossart > > wrote: > > > > > > On Thu, Jan 02, 2025 at 02:05:13AM +0530, Mahendra Singh Thalor wrote: > > > > Here, I a

Re: Proposal: add new API to stringinfo

2025-01-08 Thread Nathan Bossart
On Tue, Jan 07, 2025 at 03:57:57PM +0900, Tatsuo Ishii wrote: > So the v2 patch version is 1.3787% slower than master. Do you think we > need further inlining? If it's not too much work to coax the compiler to do so, then I don't see a strong reason to avoid it. Granted, there are probably much m

Re: Fix a wrong errmsg in AlterRole()

2025-01-08 Thread Tom Lane
"=?ISO-8859-1?B?Y2NhNTUwNw==?=" writes: > postgres=> alter group g1 drop user r1; > ERROR: permission denied to alter role > DETAIL: Only roles with the ADMIN option on role "g1" may add members. > The errmsg is "add members", but we are doing a drop. > Here is a small patch to fix it. Hmm. S

using PGOPTIONS in meson

2025-01-08 Thread jian he
hi. i am wondering ways to do ``make check PGOPTIONS="-c debug_parallel_query=regress -c work_mem=50MB"`` in meson way, especially the PGOPTIONS part. I have looked at [1] and [2]. [1] https://www.postgresql.org/docs/current/regress-run.html#REGRESS-RUN-CUSTOM-SETTINGS [2] https://wiki.postgresql

Re: Fwd: Re: A new look at old NFS readdir() problems?

2025-01-08 Thread David Steele
On 1/8/25 12:40, Bruce Momjian wrote: On Tue, Jan 7, 2025 at 01:03:05AM +, David Steele wrote: I'm more concerned about the report we saw on SUSE/NFS [1]. If that report is accurate it indicates this may not be something we can just document and move on from -- unless we are willing to enti

Re: Virtual generated columns

2025-01-08 Thread Marcos Pegoraro
Em qua., 8 de jan. de 2025 às 13:14, Peter Eisentraut escreveu: > Here is a new patch version where I have gathered various pieces of > feedback and improvement suggestions that are scattered over this > thread. I hope I got them all. I will respond to the respective > messages directly to give

Re: Virtual generated columns

2025-01-08 Thread Peter Eisentraut
On 08.01.25 17:38, Tom Lane wrote: Peter Eisentraut writes: On 03.12.24 15:15, jian he wrote: SELECT attrelid, attname, attgenerated FROM pg_attribute WHERE attgenerated IN ('v') and (attnotnull or not atthasdef); I don't understand what the purpose of testing attnotnull is. That is indepe

Re: use a non-locking initial test in TAS_SPIN on AArch64

2025-01-08 Thread Andres Freund
Hi, On 2025-01-08 12:12:19 -0600, Nathan Bossart wrote: > On Tue, Oct 22, 2024 at 02:54:57PM -0500, Nathan Bossart wrote: > > My colleague Salvatore Dipietro (CC'd) sent me a couple of profiles that > > showed an enormous amount of s_lock() time going to the > > __sync_lock_test_and_set() call in

Re: Fwd: Re: A new look at old NFS readdir() problems?

2025-01-08 Thread Tom Lane
David Steele writes: > On 1/8/25 12:40, Bruce Momjian wrote: >> Will people now always get a clear error on failure? > The error will be something like "directory is not empty" when trying to > drop a database. So not very clear at all. Conceivably we could adjust rmtree() to print a HINT men

Re: Parameter NOT NULL to CREATE DOMAIN not the same as CHECK (VALUE IS NOT NULL)

2025-01-08 Thread Tom Lane
Bruce Momjian writes: > I think this needs some serious research. We've discussed this topic before. The spec's definition of IS [NOT] NULL for composite values is bizarre to say the least. I think there's been an intentional choice to keep most NOT NULL checks "simple", that is we look at the

Re: Sample rate added to pg_stat_statements

2025-01-08 Thread Ilia Evdokimov
On 08.01.2025 22:39, Ilia Evdokimov wrote: After the changes in v9-patch, won’t all the necessary queries now be normalized? Since there are no longer any restrictions in the parser hook, queries will be normalized as usual, and pgss_planner, pgss_ExecutorStart, and ExecutorEnd will simply

Re: New GUC autovacuum_max_threshold ?

2025-01-08 Thread Vinícius Abrahão
On Wed, Jan 8, 2025 at 8:01 PM Nathan Bossart wrote: > On Wed, Jan 08, 2025 at 02:48:10PM +0100, Frédéric Yhuel wrote: > > For what it's worth, although I would have preferred the sub-linear > growth > > thing, I'd much rather have this than nothing. > > +1, this is how I feel, too. But I also d

Re: EphemeralNamedRelation and materialized view

2025-01-08 Thread Tom Lane
Yugo NAGATA writes: > Thank you for your reviewing and editing the patch! > I agree with your proposal on the error message handling. Cool, pushed v4 then. regards, tom lane

Re: Non-text mode for pg_dumpall

2025-01-08 Thread Mahendra Singh Thalor
On Thu, 9 Jan 2025 at 02:30, Guillaume Lelarge wrote: > > Hi, > > Le mer. 8 janv. 2025 à 17:41, Mahendra Singh Thalor a > écrit : >> >> On Wed, 8 Jan 2025 at 20:07, Mahendra Singh Thalor >> wrote: >> > >> > Hi all, >> > >> > On Wed, 8 Jan 2025 at 00:34, Mahendra Singh Thalor >> > wrote: >> >

Re: Make pg_stat_io view count IOs as bytes instead of blocks

2025-01-08 Thread Michael Paquier
On Thu, Dec 26, 2024 at 02:41:26PM +0300, Nazir Bilal Yavuz wrote: > Thanks! v4 is attached. I quickly tested the pg_stat_get_backend_io() > function and it seems it is working. Thanks a lot for the rebased version. This looks pretty solid. Here are some comments. void -pgstat_count_io_op(IOOb

Re: Windows pg_basebackup unable to create >2GB pg_wal.tar tarballs ("could not close file: Invalid argument" when creating pg_wal.tar of size ~ 2^31 bytes)

2025-01-08 Thread Thomas Munro
On Tue, Jan 7, 2025 at 9:54 AM Thomas Munro wrote: > On Tue, Jan 7, 2025 at 5:23 AM Andrew Dunstan wrote: > > Do you have a plan for moving ahead with this? > > I think that all looks good, and I'll go ahead and commit it in the > next day or two. Sorry for the delay. I changed some remaining o

Re: Eager aggregation, take 3

2025-01-08 Thread jian he
hi. in create_grouping_expr_infos tce = lookup_type_cache(exprType((Node *) tle->expr), TYPECACHE_BTREE_OPFAMILY); if (!OidIsValid(tce->btree_opf) || !OidIsValid(tce->btree_opintype)) return; /* *

Re: psql: Option to use expanded mode for various meta-commands

2025-01-08 Thread Greg Sabino Mullane
On Wed, Jan 8, 2025 at 8:44 AM Dean Rasheed wrote: > Attached is a more complete patch +1, looks good So in the end, I decided to just add a sentence to each command's > description, keeping it as > short as possible. > Yes, that makes sense. Cheers, Greg

  1   2   >