Re: Update Unicode data to Unicode 16.0.0

2025-01-20 Thread Jeff Davis
On Mon, 2025-01-20 at 17:06 -0800, Jeremy Schneider wrote: > On the user side, my main concerns are the same as they've always > been: 100% confidence that Postgres updates will not corrupt any data > or cause incorrect query results I'll add that, while 100% may be a good goal, it hasn't been the

Re: pg_createsubscriber TAP test wrapping makes command options hard to read.

2025-01-20 Thread Michael Paquier
On Tue, Jan 21, 2025 at 10:31:01AM +1100, Peter Smith wrote: > I applied the v5* patches and ran make check-world. All passed OK. > > Your fat comma changes have greatly improved readability, particularly > in 040_createsubscriber (the file that caused me to start this > thread). Thanks! It is no

Re: Proper way to clean-up connection for reuse (`DISCARD ALL` and default role)

2025-01-20 Thread Logan MAUZAIZE
Hi Tom, Regarding "some" missing context as stated, only thing that has been done is assigning a default role to the login one with `ALTER ROLE SET ROLE `. If it can help: ```sql SELECT version(); -- PostgreSQL 14.12 on aarch64-unknown-linux-gnu, compiled by gcc (GCC) 7.3.1 20180712 (Red Hat 7.

Re: per backend WAL statistics

2025-01-20 Thread Bertrand Drouvot
Hi, On Fri, Jan 17, 2025 at 08:43:57AM +0900, Michael Paquier wrote: > On Thu, Jan 16, 2025 at 12:44:20PM -0500, Andres Freund wrote: > > On 2025-01-16 17:11:09 +, Bertrand Drouvot wrote: > >> So, do you think that the initial proposal that has been made here (See > >> R1. in > >> [2]) i.e ma

pgbench without dbname worked differently with psql and pg_dump

2025-01-20 Thread Hayato Kuroda (Fujitsu)
Dear hackers, Recently the 'd' option of pgbench is unified with other applications like psql and pg_dump, but I found further difference. pgbebch uses an OS user as the dbanme even when the '-U' is specified. Please see below experiments. ``` # Assuming the OS user is "hayato", whereas the dat

Re: Statistics Import and Export

2025-01-20 Thread Corey Huinker
On Mon, Jan 20, 2025 at 10:59 PM Corey Huinker wrote: > Are you saying that there is a path for a partitioned index to have >> stats today? If so, we can just follow that locking protocol. If not, >> I'm concerned about trying to define the locking protocol for doing so >> as a side-effect of thi

Re: pg_createsubscriber TAP test wrapping makes command options hard to read.

2025-01-20 Thread Michael Paquier
On Mon, Jan 20, 2025 at 09:02:42PM -0500, Tom Lane wrote: > Nah, I'm pretty much -1 on bumping our perltidy version frequently. > That imposes costs on every developer who wants to track it. > It's unlikely that anyone will be on a platform that updates it > exactly when we decide to change, so mos

Re: Conflict detection for update_deleted in logical replication

2025-01-20 Thread Nisha Moond
On Wed, Jan 8, 2025 at 4:03 PM Masahiko Sawada wrote: > > 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

Re: Non-text mode for pg_dumpall

2025-01-20 Thread jian he
hi. $BIN10/pg_restore --globals-only --verbose --file=test.sql x.dump it will create a "test.sql" file, but it should create file test.sql (no double quotes). --<-- if (archDumpFormat != archNull && (!filename || strcmp(filename, "") == 0)) { pg_log_error("options -F/--for

Re: Statistics Import and Export

2025-01-20 Thread Corey Huinker
> > Are you saying that there is a path for a partitioned index to have > stats today? If so, we can just follow that locking protocol. If not, > I'm concerned about trying to define the locking protocol for doing so > as a side-effect of this work. > A quick test on v17 indicates that, no, there

Re: POC: make mxidoff 64 bits

2025-01-20 Thread wenhui qiu
HI Maxim > Looks like there is a bit of a pause in the discussion. Here is a small update. Consider v12. > No major changes, rebase to the actual master and a squash of multiple commits to make a > patch set easy to reviewer. > AFAICs, we are reached a consensus on a core patch for switching to 64

Re: Pre-allocating WAL files

2025-01-20 Thread Andy Fan
Hi Nathan, Come from [0] and thanks for working on this. Here are some design review/question after my first going through the patch. 1. walwriter vs checkpointer? I prefer to walwriter for now because.. a. checkpointer is hard to do it in a timely manner either because checkpoint itself may

Add a function to get the version of installed extension

2025-01-20 Thread Yugo Nagata
Hi, When an extension module is updated, first the new binary is installed, then ALTER EXTENSION UPDATE is executed to create or modify SQL objects. Between these two steps, users could see an error, or in worst case segfalut, during a query execution due to the lack or incompatibility of SQL objec

Re: Statistics Import and Export

2025-01-20 Thread Jeff Davis
On Mon, 2025-01-20 at 22:21 -0500, Corey Huinker wrote: > > -1. > That will break pg_upgrade tests if there's any statistics out there > for any partitioned index. Are you saying that there is a path for a partitioned index to have stats today? If so, we can just follow that locking protocol. If

Re: Statistics Import and Export

2025-01-20 Thread Corey Huinker
> > > Let's just block updating stats for partitioned indexes > until there's a defined way to do so. > -1. That will break pg_upgrade tests if there's any statistics out there for any partitioned index. > Also, we should check privileges on the right object, consistent with > how ANALYZE does

Re: per backend I/O statistics

2025-01-20 Thread Michael Paquier
On Mon, Jan 20, 2025 at 01:26:55PM +, Bertrand Drouvot wrote: > Right, that's another way to find it confusing ;-). But if we keep focus > on where the pending stats are stored, it is not. The name of the callbacks can be tuned infinitely. I have split the renaming into its own patch, then th

Re: Introduce XID age and inactive timeout based replication slot invalidation

2025-01-20 Thread Peter Smith
Some review comments for patch v61-0002 == src/backend/replication/slot.c 1. * Whether a slot needs to be invalidated depends on the cause. A slot is - * removed if it: + * invalidated if it: * - RS_INVAL_WAL_REMOVED: requires a LSN older than the given segment * - RS_INVAL_HORIZON: req

Re: Statistics Import and Export

2025-01-20 Thread Jeff Davis
On Mon, 2025-01-20 at 21:25 -0500, Corey Huinker wrote: > > I tried that, adding a test for it. Treating partitioned indexes like > regular indexes causes the exact same error as was initially reported > for indexes, so I took it back out. I don't think we should declare (as a part of this featur

Re: Introduce XID age and inactive timeout based replication slot invalidation

2025-01-20 Thread Peter Smith
Some review comments for patch v61-0001. == src/backend/replication/slot.c InvalidatePossiblyObsoleteSlot: 1. /* * Check if the slot needs to be invalidated. If it needs to be - * invalidated, and is not currently acquired, acquire it and mark it - * as having been invalidated. We do th

Re: Update Unicode data to Unicode 16.0.0

2025-01-20 Thread Jeff Davis
On Mon, 2025-01-20 at 17:06 -0800, Jeremy Schneider wrote: > FWIW, after adding ICU support I personally don't think there's a > pressing need to continue updating the tables anymore. I agree that it's not a pressing concern. > If Postgres does go the path of multiple tables, does the community >

Re: Statistics Import and Export

2025-01-20 Thread Corey Huinker
> > > * For indexes, it looks like do_analyze_rel is opening the parent table > with ShareUpdateExclusive and the indexes with just AccessShare. Let's > follow that pattern. > Done. > > * The import code allows setting stats for partitioned indexes while > ANALYZE does not, so it's hard to say f

Re: pg_createsubscriber TAP test wrapping makes command options hard to read.

2025-01-20 Thread Tom Lane
=?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= writes: > All in all, this makes me +0.5 to bumping the required Perl::Tidy > version, and +0.5 on (at least considering) bumping it to the latest > version before the pre-release-branch pgperltidy run. Nah, I'm pretty much -1 on bumping our perltidy vers

Re: Add RESPECT/IGNORE NULLS and FROM FIRST/LAST options

2025-01-20 Thread Tom Lane
Tatsuo Ishii writes: > It needs lots of work including modifying CREATE FUNCTION > command. Instead you could add an API to WinObject access functions to > export ignore_nulls value. Then let each window function check it. If > the window function should not take IGNORE/RESPECT NULLS option, throw

Re: [PATCH] Add roman support for to_number function

2025-01-20 Thread Tom Lane
Maciek Sakrejda writes: > V7 passes check-world here. But, just for kicks, I generated all > possible 7-character sequences of Roman digits [1] to confirm whether > everything either parsed cleanly or errored cleanly. Reviewing the > output, I noticed that to_number accepts some dubiously-formatte

Re: Purpose of wal_init_zero

2025-01-20 Thread Andy Fan
Hi, > On Fri, Jan 17, 2025 at 04:29:14PM -0500, Andres Freund wrote: >> I think what we instead ought to do is to more aggressively initialize WAL >> files ahead of time, so it doesn't happen while holding crucial locks. We >> know the recent rate of WAL generation, and we could easily track u

Re: New feature request for adding session information to PostgreSQL transaction log

2025-01-20 Thread Jeremy Schneider
On Wed, 15 Jan 2025 08:54:06 + Sumanth Vishwaraj wrote: > Oracle Audit Vault and Database Firewall (AVDF) audits/monitors > database activities. This product helps enterprises to manage the > security posture of Oracle , PostgreSQL and other databases. > > Oracle AVDF helps customers in Indi

Re: pg_createsubscriber TAP test wrapping makes command options hard to read.

2025-01-20 Thread Dagfinn Ilmari Mannsåker
"Euler Taveira" writes: > On Mon, Jan 20, 2025, at 7:49 PM, Tom Lane wrote: >> "Euler Taveira" writes: >> > It is kind of annoying to keep version 20230309 around to run perltidy. Do >> > we >> > have any other alternatives? >> >> As it says in src/tools/pgindent/README: >> >> 2) Install perl

Re: Add RESPECT/IGNORE NULLS and FROM FIRST/LAST options

2025-01-20 Thread Tatsuo Ishii
>> No, there needs to be a way for the individual window function to >> throw error if that's specified for a function that can't handle it. >> I'm just saying I don't want that to be hard-wired in some centralized >> spot. > > Would it be acceptable to add a bool column to pg_proc, say > "pronull

Re: Update Unicode data to Unicode 16.0.0

2025-01-20 Thread Jeremy Schneider
On Mon, 20 Jan 2025 13:39:35 -0800 Jeff Davis wrote: > On Fri, 2024-11-15 at 17:09 +0100, Peter Eisentraut wrote: > > The practice of regularly updating the Unicode files is older than > > the > > builtin collation provider.  It is similar to updating the time > > zone files, the encoding conver

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-01-20 Thread Jacob Champion
On Mon, Jan 20, 2025 at 4:40 PM Jacob Champion wrote: > But I can add a comment to the assignment to try to explain. I don't > know what the likelihood of landing code that trips that assertion is, > but an explicit assignment would at least stop problems from > cascading. On second thought, I ca

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-01-20 Thread Jacob Champion
On Mon, Jan 20, 2025 at 2:10 PM Daniel Gustafsson wrote: > + /* > + * The mechanism should have set up the necessary callbacks; all we > + * need to do is signal the caller. > + */ > + *async = true; > + return STATUS_OK; > Is it worth adding assertions here to ensure that everything has

Re: [PATCH] Add roman support for to_number function

2025-01-20 Thread Maciek Sakrejda
V7 passes check-world here. But, just for kicks, I generated all possible 7-character sequences of Roman digits [1] to confirm whether everything either parsed cleanly or errored cleanly. Reviewing the output, I noticed that to_number accepts some dubiously-formatted values: postgres=# select to_n

Re: pg_createsubscriber TAP test wrapping makes command options hard to read.

2025-01-20 Thread Peter Smith
On Tue, Jan 21, 2025 at 8:10 AM Dagfinn Ilmari Mannsåker wrote: > > Hi Peter, > > Peter Smith writes: > > > On Fri, Dec 13, 2024 at 5:03 AM Dagfinn Ilmari Mannsåker > > wrote: > >> > >> On Thu, 12 Dec 2024, at 17:52, Andrew Dunstan wrote: > >> > On 2024-12-12 Th 12:08 PM, Dagfinn Ilmari Mannsåke

Re: Statistics Import and Export

2025-01-20 Thread Jeff Davis
On Mon, 2025-01-20 at 16:45 -0500, Corey Huinker wrote: > > What I struggle to understand is how that purpose isn't served better > by statistics being in SECTION_NONE like COMMENTs are, so that they > are imported immediately after the object that they reference. Tom, you expressed the strongest

Re: pg_createsubscriber TAP test wrapping makes command options hard to read.

2025-01-20 Thread Euler Taveira
On Mon, Jan 20, 2025, at 7:49 PM, Tom Lane wrote: > "Euler Taveira" writes: > > It is kind of annoying to keep version 20230309 around to run perltidy. Do > > we > > have any other alternatives? > > As it says in src/tools/pgindent/README: > > 2) Install perltidy. Please be sure it is version

Re: Statistics Import and Export

2025-01-20 Thread Jeff Davis
On Mon, 2025-01-20 at 16:26 -0500, Corey Huinker wrote: > Attached is the patch, along with the regression test output prior to > the change to stat_utils.c. Comments: * For indexes, it looks like do_analyze_rel is opening the parent table with ShareUpdateExclusive and the indexes with just Acces

Re: pg_createsubscriber TAP test wrapping makes command options hard to read.

2025-01-20 Thread Tom Lane
"Euler Taveira" writes: > It is kind of annoying to keep version 20230309 around to run perltidy. Do we > have any other alternatives? As it says in src/tools/pgindent/README: 2) Install perltidy. Please be sure it is version 20230309 (older and newer versions make different formatting choic

Re: pg_createsubscriber TAP test wrapping makes command options hard to read.

2025-01-20 Thread Euler Taveira
On Mon, Jan 20, 2025, at 5:42 PM, Dagfinn Ilmari Mannsåker wrote: > Peter Smith writes: > > > > > In your v4 patch, there is a fragment (below) that replaces a double > > '--verbose' switch with just a single '--verbose'. > > > > As I have only recently learned, the '--verbose'' switch has a > >

Re: XMLDocument (SQL/XML X030)

2025-01-20 Thread Chapman Flack
On 01/20/25 14:56, Jim Jones wrote: > If I understand correctly, the compliant approach would be to always > treat the input expression as CONTENT: > > |PG_RETURN_XML_P(xmlparse((text *) data, XMLOPTION_DOCUMENT, true));| > > Is that right?" Did you mean XMLOPTION_CONTENT? I think that would be

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-01-20 Thread Daniel Gustafsson
> On 14 Jan 2025, at 00:21, Jacob Champion > wrote: > - 0001 moves PG_MAX_AUTH_TOKEN_LENGTH, as discussed upthread > - 0002 handles the non-OAuth-specific changes to require_auth (0005 > now highlights the OAuth-specific pieces) > - 0003 adds SASL_ASYNC and its handling code I was reading these

Re: Statistics Import and Export

2025-01-20 Thread Corey Huinker
> > I believe you are referring to Tom's statement that "it'll be a > serious, serious error for [stats] not to be SECTION_DATA". The > statement is somewhat softened by the sentence that follows, and > slightly more by [2]. But it's pretty clear that SECTION_POST_DATA is, > at best, an implementat

Re: [PATCH] Improve code coverage of network address functions

2025-01-20 Thread Jacob Champion
On Mon, Jan 20, 2025 at 12:27 PM Tom Lane wrote: > Part of my thought here is that these functions are not worth their > very own TAP test, with all the overhead that implies of firing up > a new database instance. So I was looking for something we could > fold them into. By themselves, yeah, pr

Re: Update Unicode data to Unicode 16.0.0

2025-01-20 Thread Jeff Davis
On Fri, 2024-11-15 at 17:09 +0100, Peter Eisentraut wrote: > The practice of regularly updating the Unicode files is older than > the > builtin collation provider.  It is similar to updating the time zone > files, the encoding conversion files, the snowball files, etc.  We > need > to move all o

Re: [BUG?] check_exclusion_or_unique_constraint false negative

2025-01-20 Thread Michail Nikolaev
Hello, everyone! Simplified (and stabilized, I hope) the test. Best regards, Mikhail. v4-0001-Fix-possible-lost-tuples-in-non-MVCC-index-scans-.patch Description: Binary data v4-0002-Add-isolation-test-to-reproduce-dirty-snapshot-sc.patch Description: Binary data

Re: XMLDocument (SQL/XML X030)

2025-01-20 Thread Andrew Dunstan
On 2025-01-20 Mo 2:09 PM, Chapman Flack wrote: Long story short, an XMLDOCUMENT constructor that enforced having a single root element would be nonconformant. What an (expletive deleted) mess. I'm glad someone is on top of it. cheers andrew -- Andrew Dunstan EDB: https://www.enterprise

Re: Statistics Import and Export

2025-01-20 Thread Corey Huinker
On Sat, Jan 18, 2025 at 7:45 PM Michael Paquier wrote: > On Sun, Jan 19, 2025 at 01:00:04AM +0800, jian he wrote: > > On Fri, Jan 17, 2025 at 10:20 PM jian he > wrote: > >> dump and execute the above query generated a warning > >> WARNING: missing lock for relation "tenk1_hundred" (OID 18431, >

Re: [PATCH] Add roman support for to_number function

2025-01-20 Thread Tom Lane
I wrote: > However, when you poke at that a bit closer, it's not a license > for unlimited whitespace: > regression=# select to_number('123 456', '99'); > to_number > --- > 12345 > (1 row) > I've not tracked down the exact cause of that, but I think it > has to do with the fac

Re: pg_createsubscriber TAP test wrapping makes command options hard to read.

2025-01-20 Thread Dagfinn Ilmari Mannsåker
Hi Peter, Peter Smith writes: > Hi, > > In your v4 patch, there is a fragment (below) that replaces a double > '--verbose' switch with just a single '--verbose'. > > As I have only recently learned, the '--verbose'' switch has a > cumulative effect [1], so the original double '--verbose' was pr

Re: Re: proposal: schema variables

2025-01-20 Thread Laurenz Albe
On Mon, 2025-01-20 at 15:15 -0500, Bruce Momjian wrote: > Yes, I think we passed the Desirability criteria with the feedback on > this thread, but it is now a question of whether the code complexity > justifies the feature.  I saw a few people saying they want _some_ parts > of the patch, which ope

Re: [PATCH] Improve code coverage of network address functions

2025-01-20 Thread Tom Lane
Jacob Champion writes: > On Mon, Jan 20, 2025 at 11:35 AM Tom Lane wrote: >> Maybe we could add this to the existing src/test/ssl/ tests, >> which already deal with that hazard? > That seems okay in the short term. (But it certainly highlights our > lack of a "PG_TEST_EXTRA=loopback-is-fine" mod

Re: [PATCH] Improve code coverage of network address functions

2025-01-20 Thread Jacob Champion
On Mon, Jan 20, 2025 at 11:35 AM Tom Lane wrote: > To do anything interesting, the test would have to make the server > open a TCP port, which would be rightly seen as a security hazard. > So it'd have to be confined to a not-run-by-default test case. Yeah. > Maybe we could add this to the exist

Re: Re: proposal: schema variables

2025-01-20 Thread Bruce Momjian
On Fri, Jan 17, 2025 at 03:47:28PM +0100, Álvaro Herrera wrote: > On 2025-Jan-17, Bruce Momjian wrote: > > > Is this really something we are considering applying, since it has been > > around for years? I am unclear on that and we had better know if we are > > going to continue reviewing this. >

Re: tzdata 2025a and timestamptz.out

2025-01-20 Thread Tom Lane
Christoph Berg writes: > SELECT make_timestamptz(1846, 12, 10, 0, 0, 0, 'Asia/Manila') AT TIME ZONE > 'UTC'; > timezone > -- > - Wed Dec 09 15:56:00 1846 > + Wed Dec 09 15:56:08 1846 Grumble. Let's switch to using Asia/Singapore in this test case. It has a ro

Re: XMLDocument (SQL/XML X030)

2025-01-20 Thread Jim Jones
Hi Chap, Thanks for the thorough explanation!  On 20.01.25 20:09, Chapman Flack wrote: >> PostgreSQL does not support the RETURNING SEQUENCE or RETURNING CONTENT >> clauses explicitly. Instead, it implicitly uses RETURNING CONTENT[2] in >> functions that require it. Since RETURNING CONTENT implie

Re: attndims, typndims still not enforced, but make the value within a sane threshold

2025-01-20 Thread Bruce Momjian
On Sun, Jan 19, 2025 at 06:47:14PM -0500, Tom Lane wrote: > Bruce Momjian writes: > > Using the queries in that URL, I see: > > > CREATE TABLE test (data integer, data_array integer[5][5]); > > CREATE TABLE test2 (LIKE test); > > CREATE TABLE test3 AS SELECT * FROM test; > > SELEC

Re: [PATCH] Improve code coverage of network address functions

2025-01-20 Thread Tom Lane
Jacob Champion writes: > On Thu, Oct 31, 2024 at 9:30 AM Aleksander Alekseev > wrote: >> Recently I played with lcov [1]. In the process it was discovered that >> the following functions are not executed by our tests: >> >> - abbrev(inet) >> - set_masklen(cidr,int4) >> - netmask(inet) >> - hostm

tzdata 2025a and timestamptz.out

2025-01-20 Thread Christoph Berg
It happened again: News for the tz database Release 2025a - 2025-01-15 10:47:24 -0800 Briefly: ... Improve pre-1991 data for the Philippines. SELECT make_timestamptz(1846, 12, 10, 0, 0, 0, 'Asia/Manila') AT TIME ZONE 'UTC'; timezone -- - Wed Dec 09

Re: Add XMLNamespaces to XMLElement

2025-01-20 Thread Jim Jones
Hi Umar On 20.01.25 17:19, Umar Hayat wrote: > Hi Jim & Pavel, > Sorry for getting back a bit late on this. Few more case you might > need consider: > > As I mentioned in my first static review about XMLTable existing > behaviour might change, I give it a run time review and here are few > finding

Re: Statistics Import and Export

2025-01-20 Thread Jeff Davis
On Mon, 2025-01-20 at 10:58 -0500, Corey Huinker wrote: > That is where all statistics were previously. Others felt very > strongly that they should be mixed in to SECTION_DATA and > SECTION_POST_DATA. I believe you are referring to Tom's statement that "it'll be a serious, serious error for [stat

Re: XMLDocument (SQL/XML X030)

2025-01-20 Thread Chapman Flack
On 01/20/25 06:02, Jim Jones wrote: > The DB2 "Document node constructors" might provide some insights into > its behavior regarding well-formed XML documents [1]: > > "No validation is performed on the constructed document node. The XQuery > document node constructor does not enforce the XML 1.0

Re: Add RESPECT/IGNORE NULLS and FROM FIRST/LAST options

2025-01-20 Thread Oliver Ford
On Mon, Jan 20, 2025 at 12:31 AM Tom Lane wrote: > > Tatsuo Ishii writes: > >> I would think that > >> IGNORE NULLS is potentially useful for user-defined window functions, > >> and we should not be building anything that restricts the feature to > >> specific functions. > > > So you want to allo

Re: [PATCH] Improve code coverage of network address functions

2025-01-20 Thread Jacob Champion
On Thu, Oct 31, 2024 at 9:30 AM Aleksander Alekseev wrote: > Recently I played with lcov [1]. In the process it was discovered that > the following functions are not executed by our tests: > > - abbrev(inet) > - set_masklen(cidr,int4) > - netmask(inet) > - hostmask(inet) The new tests for the fir

Re: Eager aggregation, take 3

2025-01-20 Thread Robert Haas
On Mon, Jan 20, 2025 at 12:57 PM Tom Lane wrote: > However, a partial-aggregation path does not generate the same data > as an unaggregated path, no matter how fuzzy you are willing to be > about the concept. So I'm having a very hard time accepting that > it ought to be part of the same RelOptIn

Re: Bug in detaching a partition with a foreign key.

2025-01-20 Thread Sami Imseih
> > The patch that Amul and I wrote both achieve the same result. > > The approach that Amul took builds a list of constraint OIDs, > > which could grow with the number of partitions and foreign keys > > on those partitions. Maybe not a big deal? > Nope, not a big deal. It would be a big deal if

Re: Eager aggregation, take 3

2025-01-20 Thread Tom Lane
Robert Haas writes: > So I don't quite know which way to jump here. It now seems to me that > we have three similar features with three different designs. > Parameterization added non-comparable paths to the same path list; > parallel query added them to a different path list in the same > RelOptI

Re: Log connection establishment timings

2025-01-20 Thread Jacob Champion
On Mon, Jan 20, 2025 at 7:01 AM Bertrand Drouvot wrote: > Though time changes are "rare", given the fact that those metrics could > provide > "inaccurate" measurements during that particular moment (time change) then it > might be worth considering instr_time instead for this particular metric.

Re: Modern SHA2- based password hashes for pgcrypto

2025-01-20 Thread Bernd Helmle
Hi, Please find attached a reworked patch according Alvaro's comments. Am Montag, dem 13.01.2025 um 17:06 +0100 schrieb Alvaro Herrera: > Hello > > I was passing by and I noticed that this needs badly pgindent, and > some > comments are enumerations that would lose formatting once through it. >

Re: create subscription with (origin = none, copy_data = on)

2025-01-20 Thread vignesh C
On Mon, 20 Jan 2025 at 17:31, Amit Kapila wrote: > > On Sat, Jan 18, 2025 at 10:31 AM vignesh C wrote: > > > > Attached patch has the fix for this issue which includes the partition > > tables also for the publication now and throws a warning > > appropriately. > > > > The corresponding query (se

Re: Bypassing cursors in postgres_fdw to enable parallel plans

2025-01-20 Thread Robert Haas
On Fri, Jan 17, 2025 at 7:03 AM Rafia Sabih wrote: > Indeed you are right. > Firstly, accept my apologies for not mentioning you in credits for this work. > Thanks a lot for your efforts, discussions with you were helpful in shaping > this patch and bringing it to this level. > > Next, yes the l

Re: Bug in detaching a partition with a foreign key.

2025-01-20 Thread Álvaro Herrera
On 2025-Jan-20, Sami Imseih wrote: > The patch that Amul and I wrote both achieve the same result. > The approach that Amul took builds a list of constraint OIDs, > which could grow with the number of partitions and foreign keys > on those partitions. Maybe not a big deal? Nope, not a big deal.

Re: Proper way to clean-up connection for reuse (`DISCARD ALL` and default role)

2025-01-20 Thread Tom Lane
Logan MAUZAIZE writes: > 1. clarify if `DISCARD ALL` behavior is the expected one or is it a bug? DISCARD ALL is documented to do SET SESSION AUTHORIZATION DEFAULT, and for me it does that, that is "session_authorization" reverts to the login role, "role" reverts to "none", and as a consequence c

Re: POC: track vacuum/analyze cumulative time per relation

2025-01-20 Thread Sami Imseih
> I can get behind the idea of the patch. Thanks for the review! > + PgStat_Counter total_vacuum_time; > + PgStat_Counter total_autovacuum_time; > + PgStat_Counter total_analyze_time; > + PgStat_Counter total_autoanalyze_time; > } PgStat_StatTabEntry; > These are time val

Re: Purpose of wal_init_zero

2025-01-20 Thread Nathan Bossart
On Fri, Jan 17, 2025 at 04:29:14PM -0500, Andres Freund wrote: > I think what we instead ought to do is to more aggressively initialize WAL > files ahead of time, so it doesn't happen while holding crucial locks. We > know the recent rate of WAL generation, and we could easily track up to which >

Re: Eager aggregation, take 3

2025-01-20 Thread Robert Haas
On Sun, Jan 19, 2025 at 7:53 AM Richard Guo wrote: > If, at last, the conclusion of this discussion is that we should not > apply this change until we fix those problems in aggregate estimates, > I'd be very sad. This conclusion is absolutely correct, for sure, in > an ideal world, but in the rea

Re: [PATCH] Add roman support for to_number function

2025-01-20 Thread Tom Lane
Hunaid Sohail writes: > On Sat, Jan 18, 2025 at 5:27 AM Tom Lane wrote: > Initially, when I looked at the test case: > SELECT to_number('M CC', 'RN'); > I was confused about whether it should be 'MCC'. After further inspection, > I realized that the output is 1000 for 'M'. The format of the inpu

Re: pg_stat_statements: improve loading and saving routines for the dump file

2025-01-20 Thread Ivan Kush
Hello, Mikhail. 1) I'd add to comment a reason, why mutex should be last. // Mutex should be last field, as this field isn't copied to dump file + /* protects the counters only. Should be the very last field, as this field isn't copied to dump file + slock_t mutex; } pgssE

Re: Add XMLNamespaces to XMLElement

2025-01-20 Thread Umar Hayat
Hi Jim & Pavel, Sorry for getting back a bit late on this. Few more case you might need consider: As I mentioned in my first static review about XMLTable existing behaviour might change, I give it a run time review and here are few findings: 1. Because of this patch XMLTable namespace will accept

Proper way to clean-up connection for reuse (`DISCARD ALL` and default role)

2025-01-20 Thread Logan MAUZAIZE
Hello! We encountered an issue with connection pooling from .Net driver ( https://github.com/npgsql/npgsql). A few weeks ago, in order to give same access privileges for multi-service access (service/API, https://sqitch.org/, satellite services, ...), we enabled default role (`ALTER ROLE SET ROL

Re: Non-text mode for pg_dumpall

2025-01-20 Thread jian he
hi. some minor issues come to my mind when I look at it again. looking at set_null_conf, i think "if (archDumpFormat != archNull)" can be: if (archDumpFormat != archNull) { OPF = fopen(toc_path, "w"); if (!OPF) pg_fatal("could not open global.dat file: \"%s\" for writing: %m", toc_path); } s

Re: Statistics Import and Export

2025-01-20 Thread Corey Huinker
On Mon, Jan 20, 2025 at 3:22 AM jian he wrote: > On Thu, Jan 16, 2025 at 4:56 AM Corey Huinker > wrote: > >> > >> > >> > >> I do like the idea of a "Statistics for ..." prefix, and I think it's > >> doable. > > > > > > And that's now implemented. > > > > > >> The caller needs some knowledge abou

Re: Logging parallel worker draught

2025-01-20 Thread Benoit Lobréau
Here is a new set of patches. The following changed: * rebase * simplify the log message to go back to "launched X parallel workers (planned: Y)" * rename the "failure" configuration item to "shortage". On 1/3/25 17:24, Sami Imseih wrote:> Maintenance work is usually planned, so if queries

Re: Bug in detaching a partition with a foreign key.

2025-01-20 Thread Sami Imseih
The patch that Amul and I wrote both achieve the same result. The approach that Amul took builds a list of constraint OIDs, which could grow with the number of partitions and foreign keys on those partitions. Maybe not a big deal? In my suggestion [1], I just do one extra pg_constraint lookup to d

Re: Bug in detaching a partition with a foreign key.

2025-01-20 Thread Álvaro Herrera
On 2025-Jan-20, Sami Imseih wrote: > Below is the repro I used. Similar as you original repro, > but without subpartition on foo_p0. This also results in the segfault > with your attached patch. I think the issue in Amul's patch is just that the list was not initialized to NIL. Other than the la

Re: Bug in detaching a partition with a foreign key.

2025-01-20 Thread Sami Imseih
> should cut the link between the parent constraint and the constraint on > the partition being detached. correct by setting the conparentid to 0 in pg_constraint and to delete the pg_depend record for partition dependency. But in the repro case, we don't have a dependency as the table the foreign

Re: [RFC] Lock-free XLog Reservation from WAL

2025-01-20 Thread Zhou, Zhiguo
On 1/19/2025 10:56 PM, Yura Sokolov wrote: 17.01.2025 17:00, Zhou, Zhiguo пишет: On 1/16/2025 10:00 PM, Yura Sokolov wrote: Good day, Zhiguo. Excuse me, I feel sneaky a bit, but I've started another thread just about increase of NUM_XLOGINSERT_LOCK, because I can measure its effect eve

Re: Log connection establishment timings

2025-01-20 Thread Bertrand Drouvot
Hi, On Mon, Jan 06, 2025 at 10:08:36PM +0100, Guillaume Lelarge wrote: > Hello, > > Le lun. 16 déc. 2024 à 22:00, Melanie Plageman > a écrit : > > > Hi, > > > > Users wishing to debug slow connection establishment have little > > visibility into which steps take the most time. We don't expose a

Re: Sample rate added to pg_stat_statements

2025-01-20 Thread Ilia Evdokimov
On 15.01.2025 20:16, Sami Imseih wrote: Probably, but first I suggest benchmarking with sampling applied to all queries. If the results are good, we can later filter certain queries based on different characteristics. Absolutely. The benchmark numbers to justify this feature are the next step

Re: Change COPY ... ON_ERROR ignore to ON_ERROR ignore_row

2025-01-20 Thread Kirill Reshke
On Tue, 14 Jan 2025 at 10:51, jian he wrote: > > the attached patch also did some doc enhancement, error message enhancement. LGTM -- Best regards, Kirill Reshke

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

2025-01-20 Thread Aleksander Alekseev
Hi Dean, > This should use ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE, rather than > ERRCODE_INVALID_PARAMETER_VALUE, for consistency with other similar > errors. > > The bytea -> int[248] cast functions should not be marked as leakproof > -- see the docs on the CREATE FUNCTION page: functions that raise

Re: some Page/PageData const stuff

2025-01-20 Thread Peter Eisentraut
This has been committed. On 09.12.24 16:44, Peter Eisentraut wrote: In [0] I wrote: """ I was fiddling a bit with making some Page-related APIs const-proof, which might involve changing something like "Page p" to "const PageData *p", but I was surprised that a type PageData exists but it's an

pg_stat_statements: improve loading and saving routines for the dump file

2025-01-20 Thread m . litsarev
Hi! Currently in pg_stat_statements save/load routines the whole pgssEntry entity data are written/read with its last field slock_t mutex; which is actually not used then. This small patch fixes this issue. Hope, it will be useful. Respectfully, Mikhail Litsarev, Postgres Professional

Re: Psql meta-command conninfo+

2025-01-20 Thread Maiquel Grassi
>That leads me to also wonder why don't we change \conninfo to have this >tabular behavior instead of creating a separate command for it. Why do >we need to keep the existing form of \conninfo? To me it seems strictly >less useful, as it is harder to read. Here, you're suggesting that it would b

Re: per backend I/O statistics

2025-01-20 Thread Bertrand Drouvot
Hi, On Mon, Jan 20, 2025 at 09:11:16PM +0900, Michael Paquier wrote: > On Mon, Jan 20, 2025 at 11:10:40AM +, Bertrand Drouvot wrote: > > I think that it would be better to make the distinction based on > > "local/static" > > vs "dynamic memory" pending stats instead: I did so in v3 attached,

Re: [PATCH] immediately kill psql process if server is not running.

2025-01-20 Thread Srinath Reddy
On Sun, Jan 19, 2025 at 3:55 AM Tom Lane wrote: > > One idea that seems like it could be safe is to change the prompt, > so that your experience could be like > > postgres=# SELECT foo, bar, baz, > -# (uh-oh) > > This only helps for people who are entering multi-line SQL, +1,will look into it.

Re: create subscription with (origin = none, copy_data = on)

2025-01-20 Thread vignesh C
On Sat, 18 Jan 2025 at 14:29, Sergey Tatarintsev wrote: > > I think we must take into account whole inheritance tree of partitioned table. > > For example: > > node_A: > CREATE TABLE t(id int); > CREATE PUBLICATION pub_b FOR TABLE t; > > node_A: > CREATE TABLE t(id int) PARTITION BY RANGE(id); > C

Re: per backend I/O statistics

2025-01-20 Thread Michael Paquier
On Mon, Jan 20, 2025 at 11:10:40AM +, Bertrand Drouvot wrote: > I think that it would be better to make the distinction based on > "local/static" > vs "dynamic memory" pending stats instead: I did so in v3 attached, using: > > .flush_dynamic_cb(): flushes pending entries tracked in dynamic me

Re: create subscription with (origin = none, copy_data = on)

2025-01-20 Thread Amit Kapila
On Sat, Jan 18, 2025 at 10:31 AM vignesh C wrote: > > Attached patch has the fix for this issue which includes the partition > tables also for the publication now and throws a warning > appropriately. > The corresponding query (see "To find which tables might potentially include non-local origins

Re: Replace current implementations in crypt() and gen_salt() to OpenSSL

2025-01-20 Thread Álvaro Herrera
On 2025-Jan-15, Daniel Gustafsson wrote: > > On 14 Jan 2025, at 13:12, Hayato Kuroda (Fujitsu) > > wrote: > > Also: I'm not sure whether we should bump the version of pgcrypto. > > It should be done when the API is changed, but the patch does not > > do. Thought? > > I don't think this constit

Re: Psql meta-command conninfo+

2025-01-20 Thread Alvaro Herrera
On 2025-Jan-17, Sami Imseih wrote: > > Wait a second, why do we have these here? Aren't they already in > > \dconfig? > > \dconfig is generated by querying pg_settings and this > requires a halthy connection. The parameters being proposed with > \conninfo+ are set in libpq by the server [1] and

Re: Purpose of wal_init_zero

2025-01-20 Thread Hannu Krosing
Thinking back I can see now why disabling WAL writes with wal_level=minimal in COPY resulted in 3X better write performance instead of expected 2x - With wal_level=minimal only the heap page writes were needed, whereas with WAL writes the same page was written 3x - (heap + WAL zero-fill + WAL). -

  1   2   >