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

2024-12-04 Thread Peter Smith
On Wed, Dec 4, 2024 at 9:27 PM vignesh C wrote: > ... > > Currently, replication slots are invalidated based on the > replication_slot_inactive_timeout only during a checkpoint. This means > that if the checkpoint_timeout is set to a higher value than the > replication_slot_inactive_timeout, slot

Re: Disallow UPDATE/DELETE on table with unpublished generated column as REPLICA IDENTITY

2024-12-04 Thread Peter Smith
On Thu, Dec 5, 2024 at 2:41 PM Amit Kapila wrote: > > On Thu, Dec 5, 2024 at 7:34 AM Peter Smith wrote: > > > > IIUC, these errors are intended for when there is *any* unpublished > > generated column found in the RI, and the RI might also have other > > columns in it generated or otherwise. So,

Re: Make tuple deformation faster

2024-12-04 Thread Andres Freund
Hi, On 2024-12-05 11:52:01 +1300, David Rowley wrote: > On Thu, 5 Dec 2024 at 03:51, Andres Freund wrote: > > Possibly stupid idea: Could we instead store the attributes *before* the > > main > > TupleDescData, with increasing "distance" for increased attnos? That way we > > wouldn't need to ca

Re: Disallow UPDATE/DELETE on table with unpublished generated column as REPLICA IDENTITY

2024-12-04 Thread Amit Kapila
On Thu, Dec 5, 2024 at 7:34 AM Peter Smith wrote: > > IIUC, these errors are intended for when there is *any* unpublished > generated column found in the RI, and the RI might also have other > columns in it generated or otherwise. So, I think those error messages > saying "consists of" should be r

Re: Cannot find a working 64-bit integer type on Illumos

2024-12-04 Thread Thomas Munro
On Thu, Dec 5, 2024 at 10:03 AM Thomas Munro wrote: > The affected systems are mostly running ancient OSes, and lapwing is > 32 bit x86, so it's not only armv7. Current 32 bit x86 systems are > working fine. I was trying to figure out how I missed this, and I think it might be that the meson bui

Re: Cannot find a working 64-bit integer type on Illumos

2024-12-04 Thread Thomas Munro
On Thu, Dec 5, 2024 at 12:16 PM Tom Lane wrote: > In c.h, I'd put in a very explicit comment in front of pg_config.h. > Also, I don't like making it look like postgres_ext.h is of the > same ilk as the config headers, since it isn't. So maybe like > > /* > * These headers must be included before

Re: Cannot find a working 64-bit integer type on Illumos

2024-12-04 Thread Tom Lane
Thomas Munro writes: > If someone wants to define things like that before potentially > including system headers, they're not going about it the right way if > they're including our headers first (or anything at all not under > their direct control). But OK, I can work with the > not-broken-so-do

Re: Cannot find a working 64-bit integer type on Illumos

2024-12-04 Thread Thomas Munro
On Thu, Dec 5, 2024 at 4:29 PM Tom Lane wrote: > Thomas Munro writes: > > Ahh, correction, it does define it (or else perl would have > > complained), but it seems that meson magically puts it into the > > compiler command line without being asked. So it is defined without > > pg_config.h being

RE: Memory leak in WAL sender with pgoutput (v10~)

2024-12-04 Thread Zhijie Hou (Fujitsu)
On Wednesday, December 4, 2024 7:39 PM Michael Paquier wrote: > > On Wed, Dec 04, 2024 at 06:42:55AM +, Zhijie Hou (Fujitsu) wrote: > > I can try to write a patch if no one else is working on this. > > If you have some room to write a patch, that would be really nice. > Thanks. No problem.

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)

2024-12-04 Thread Thomas Munro
Today while trying to figure out why CI didn't pick up a mistake but the build farm did, I learned a couple of interesting new-to-me facts that are relevant to this thread: 1. When meson builds on "Linux-like" systems (by which it means GCC or Clang detected, and MinGW is GCC), it jams -D_FILE_OF

Re: Missing LWLock protection in pgstat_reset_replslot()

2024-12-04 Thread Michael Paquier
On Wed, Dec 04, 2024 at 03:20:03PM +, Bertrand Drouvot wrote: > I need to think more about it but it seems to me that those values make sense, > so maybe we should drop the entry for this particular case (shmem_exit()). The values reported in the central hash table make sense to me. What does

Re: Pass ParseState as down to utility functions.

2024-12-04 Thread Michael Paquier
On Wed, Dec 04, 2024 at 03:31:47PM +0500, Kirill Reshke wrote: > On Sat, 30 Nov 2024 at 17:37, jian he wrote: >> So I guess bundling it into a single patch should be fine? > > Ok. I created CF entry for this patch. > > [0] https://commitfest.postgresql.org/51/5420/ Note that v3 of the patch is

Re: simplify regular expression locale global variables

2024-12-04 Thread Peter Eisentraut
On 03.12.24 20:19, Jeff Davis wrote: On Tue, 2024-12-03 at 17:06 +0100, Peter Eisentraut wrote: But it doesn't remove pg_regex_collation, only pg_regex_strategy.  So I have split my v2 into two patches, the first removes pg_regex_collation and the second removes pg_regex_strategy.  The first pat

Re: NOT ENFORCED constraint feature

2024-12-04 Thread jian he
hi. accidentally hit segfault. create table c11 (a int not enforced); create table c11 (a int enforced); we can solve it via the following or changing SUPPORTS_ATTRS accordingly. diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index 5ab44149e5..fe1116c092 10064

Re: date_trunc invalid units with infinite value

2024-12-04 Thread Michael Paquier
On Sun, Dec 01, 2024 at 03:09:17PM -0500, Joseph Koshakow wrote: > When looking at the date_trunc function, I noticed that it wasn't > rejecting invalid units if the value was infinite. It's slightly > annoying to fix this, but we already do something very similar for > date_part. I have attached a

Re: shared-memory based stats collector - v70

2024-12-04 Thread Michael Paquier
On Wed, Dec 04, 2024 at 03:24:55PM +, Bertrand Drouvot wrote: > Thanks! I've the feeling that something has to be fixed, see my comments in > [1]. It might be that the failed assertion does not handle a "valid" scenario. > > [1]: > https://www.postgresql.org/message-id/Z1BzI/eMTCOKA%2Bj6%40ip

Re: Possible integer overflow in bringetbitmap()

2024-12-04 Thread Michael Paquier
On Wed, Dec 04, 2024 at 02:05:10PM -0800, James Hunter wrote: > So, I think your patch should be, instead, to cast either "totalpages" > or "10" to "int64", in the return statement. totalpages is signed, and BlockNumber is unsigned. Hence in theory you could always fall into a trap once totalpage

Re: Cannot find a working 64-bit integer type on Illumos

2024-12-04 Thread Tom Lane
Thomas Munro writes: > On Thu, Dec 5, 2024 at 1:59 PM Thomas Munro wrote: >> I was trying to figure out how I missed this, and I think it might be >> that the meson build scripts didn't port AC_SYS_LARGEFILES. So if you >> build on a 32 bit Linux system with meson (like one of CI's tasks, and >>

Re: Collation & ctype method table, and extension hooks

2024-12-04 Thread Jeff Davis
On Mon, 2024-12-02 at 16:39 +0100, Andreas Karlsson wrote: > My patches: > > = v9-0002-Move-check-for-ucol_strcollUTF8-to-pg_locale_icu..patch Committed. > = v9-0003-Move-code-for-collation-version-into-provider-spe.patch > > Moves some code from pg_collate.c into provider specific files. I ag

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

2024-12-04 Thread Peter Smith
Hi Nisha, Here are my review comments for the v53* patch set // Patch v53-0001. == src/backend/replication/slot.c 1. + if (error_if_invalid && + s->data.invalidated != RS_INVAL_NONE) Looks like some unnecessary wrapping here. I think this condition can be on one line. //

Re: Doc: clarify the log message level of the VERBOSE option

2024-12-04 Thread Masahiro Ikeda
On 2024-12-04 21:08, Yugo Nagata wrote: This would prevent other users from make a misunderstanding as you did. I found the description on amvalidate also explains a message is output at INFO level. ( https://www.postgresql.org/docs/devel/index-functions.html ) Problems should be reported wit

Re: Missing LWLock protection in pgstat_reset_replslot()

2024-12-04 Thread Bertrand Drouvot
Hi, On Thu, Dec 05, 2024 at 01:26:38PM +0900, Michael Paquier wrote: > On Wed, Dec 04, 2024 at 03:20:03PM +, Bertrand Drouvot wrote: > > I need to think more about it but it seems to me that those values make > > sense, > > so maybe we should drop the entry for this particular case (shmem_exi

Re: Doc: clarify the log message level of the VERBOSE option

2024-12-04 Thread Masahiro Ikeda
On 2024-12-05 16:23, Yugo NAGATA wrote: - Prints a progress report as each table is clustered. + Prints a progress report as each table is clustered, + at INFO level. I feel like the comma could not be necessary here like the fix for the ANALYZE document, but it might be better

Re: generic plans and "initial" pruning

2024-12-04 Thread Amit Langote
On Thu, Dec 5, 2024 at 2:20 AM Tomas Vondra wrote: > On 12/4/24 14:34, Amit Langote wrote: > > On Mon, Dec 2, 2024 at 3:36 AM Tomas Vondra wrote: > >> 0001 > >> > >> > >> 1) But if we don't expect this error to actually happen, do we really > >> need to make it ereport()? Maybe it should be

Re: shared-memory based stats collector - v70

2024-12-04 Thread Bertrand Drouvot
Hi, On Thu, Dec 05, 2024 at 02:43:43PM +0900, Michael Paquier wrote: > On Wed, Dec 04, 2024 at 03:24:55PM +, Bertrand Drouvot wrote: > > Thanks! I've the feeling that something has to be fixed, see my comments in > > [1]. It might be that the failed assertion does not handle a "valid" > > sce

Re: Proposal for Updating CRC32C with AVX-512 Algorithm.

2024-12-04 Thread John Naylor
On Thu, Jun 13, 2024 at 3:11 AM Andres Freund wrote: > > On 2024-05-01 15:56:08 +, Amonson, Paul D wrote: > > Workload call size distribution details (write heavy): > >* Average was approximately around 1,010 bytes per call > >* ~80% of the calls were under 256 bytes > >* ~20% of

doc: Remove LC_COLLATE and LC_CTYPE from SHOW command

2024-12-04 Thread Pierre Giraud
Hi, Since version 16, the read-only server settings lc_collate and lc_ctype have been removed [1]. Unfortunately, the documentation has been updated only partially. Attached is a patch to also update the page for the "SHOW" SQL command and remove the corresponding "LC_COLLATE" and "LC_CTYPE"

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

2024-12-04 Thread Nisha Moond
On Tue, Dec 3, 2024 at 1:09 PM Hayato Kuroda (Fujitsu) wrote: > > Dear Nisha, > > Thanks for updating the patch! > > > Fixed. It is reasonable to align with other timeout parameters by > > using milliseconds as the unit. > > It looks you just replaced to GUC_UNIT_MS, but the documentation and > po

RE: AIX support

2024-12-04 Thread Srirama Kucherlapati
Hi Team, few more updates on the buildfarm, all the tests have passed and below is the gist of the logs. We are working on the cleaning up the changes and will post them for review. Tue Dec 3 04:08:29 2024: buildfarm run for CHANGEME:HEAD starting CHANGEME:HEAD [04:09:49

Re: Cannot find a working 64-bit integer type on Illumos

2024-12-04 Thread Tom Lane
Thomas Munro writes: > A couple of armv7 animals seemed to die in the Perl tests. Huh. Well > I know that Perl was sensitive to this stuff but it passed on 32 bit > CI (x86). I will try to reproduce that on local ARM hardware... turaco seems unhappy because of 2024-12-04 05:37:14.831 GMT [958

Re: Contradictory behavior of array_agg(distinct) aggregate.

2024-12-04 Thread Dagfinn Ilmari Mannsåker
Konstantin Knizhnik writes: > On 04/12/2024 9:03 am, Tom Lane wrote: >> Konstantin Knizhnik writes: >>> postgres=# create table t(x integer unique); >>> CREATE TABLE >>> postgres=# insert into t values (null),(null); >>> INSERT 0 2 >>> postgres=# select count(distinct x) from t; >>>  count >>>

Re: Sort functions with specialized comparators

2024-12-04 Thread Andrey M. Borodin
> On 2 Dec 2024, at 08:39, John Naylor wrote: > > On Mon, Dec 2, 2024 at 1:12 AM Andrey M. Borodin wrote: >> >>> On 25 Nov 2024, at 17:50, John Naylor wrote: >>> >>> I'd like to see the two sort specializations combined >>> into one, using a local comparator that knows when to reverse the >

Re: Pass ParseState as down to utility functions.

2024-12-04 Thread Kirill Reshke
On Sat, 30 Nov 2024 at 17:37, jian he wrote: > So I guess bundling it into a single patch should be fine? Ok. I created CF entry for this patch. [0] https://commitfest.postgresql.org/51/5420/ -- Best regards, Kirill Reshke

Re: Incorrect result of bitmap heap scan.

2024-12-04 Thread Matthias van de Meent
On Mon, 2 Dec 2024 at 18:02, Tom Lane wrote: > > Andres Freund writes: > > I think the problematic scenario involves tuples that *nobody* can see. > > During > > the bitmap index scan we don't know that though. Thus the tid gets inserted > > into the bitmap. Then, before we visit the heap, a con

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

2024-12-04 Thread vignesh C
On Wed, 4 Dec 2024 at 15:01, Nisha Moond wrote: > > On Tue, Dec 3, 2024 at 1:09 PM Hayato Kuroda (Fujitsu) > wrote: > > > > Dear Nisha, > > > > Thanks for updating the patch! > > > > > Fixed. It is reasonable to align with other timeout parameters by > > > using milliseconds as the unit. > > > >

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

2024-12-04 Thread vignesh C
On Wed, 4 Dec 2024 at 15:01, Nisha Moond wrote: > > On Tue, Dec 3, 2024 at 1:09 PM Hayato Kuroda (Fujitsu) > wrote: > > > > Dear Nisha, > > > > Thanks for updating the patch! > > > > > Fixed. It is reasonable to align with other timeout parameters by > > > using milliseconds as the unit. > > > >

Re: NOT ENFORCED constraint feature

2024-12-04 Thread jian he
> > errmsg("cannot validated NOT ENFORCED constraint"))); > should be > errmsg("cannot validate NOT ENFORCED constraint"))); > ? > looking at it again. if (!con->conenforced) ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("cannot validated

Re: Conflict detection for update_deleted in logical replication

2024-12-04 Thread Amit Kapila
On Tue, Dec 3, 2024 at 9:17 AM Zhijie Hou (Fujitsu) wrote: > > Also, I removed a change in wait_for_local_flush() which was mis-added in > V13_2 > patch. > 1. + if (can_advance_nonremovable_xid(&data, last_recv_timestamp)) + maybe_advance_nonremovable_xid(&data); In can_advance_nonremovable_xid

Re: NOT ENFORCED constraint feature

2024-12-04 Thread Amul Sul
On Wed, Dec 4, 2024 at 1:40 PM jian he wrote: > > i just only apply v5-0001 for now. > > create table t(a int); > alter table t ADD CONSTRAINT cc CHECK (a > 0); > alter table t alter CONSTRAINT cc NOT ENFORCED; > alter table t alter CONSTRAINT cc ENFORCED; > > the last two queries will fail, which

Re: Implement waiting for wal lsn replay: reloaded

2024-12-04 Thread Kirill Reshke
On Wed, 27 Nov 2024 at 09:09, Alexander Korotkov wrote: > > Hi! > > Introduction > > The simple way to wait for a given lsn to replay on standby appears to > be useful because it provides a way to achieve read-your-writes > consistency while working with both replication leader and standby. > And

Re: SQL:2011 application time

2024-12-04 Thread Peter Eisentraut
On 26.11.24 13:18, Peter Eisentraut wrote: I think this is the right idea, but after digging around a bit more, I think more could/should be done. After these changes, the difference between get_equal_strategy_number_for_am() and get_equal_strategy_number() is kind of pointless.  We should re

Re: psql: Add leakproof field to \dAo+ meta-command results

2024-12-04 Thread Yugo NAGATA
On Fri, 15 Nov 2024 17:26:08 + Dean Rasheed wrote: > On Fri, 15 Nov 2024 at 09:55, Yugo Nagata wrote: > > > > I'll fixed the patch to add leakproof info to \do+ results, but is it worth > > leaving this info in \dAo+ results, too? > > > > I suppose that might still be useful in some context

RE: Does RelCache/SysCache shrink except when relations are deleted?

2024-12-04 Thread maumau307
From: Bowen Shi zxwsbg12...@gmail.com > It has been over a decade since the discussion of this email. I would like to > know if there has been any proposal regarding the eviction of > relcache/syscache. Ideriha proposed Global Catalog Cache or something (I d

Re: Memory leak in WAL sender with pgoutput (v10~)

2024-12-04 Thread Michael Paquier
On Wed, Dec 04, 2024 at 06:42:55AM +, Zhijie Hou (Fujitsu) wrote: > I can try to write a patch if no one else is working on this. If you have some room to write a patch, that would be really nice. Thanks. -- Michael signature.asc Description: PGP signature

Re: Incorrect result of bitmap heap scan.

2024-12-04 Thread Matthias van de Meent
On Mon, 2 Dec 2024 at 17:31, Andres Freund wrote: > > Hi, > > On 2024-12-02 16:08:02 +0100, Matthias van de Meent wrote: > > Concurrency timeline: > > > > Session 1. amgetbitmap() gets snapshot of index contents, containing > > references to dead tuples on heap P1. > > IIUC, an unstanted important

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

2024-12-04 Thread Nazir Bilal Yavuz
Hi, Thanks for looking into this! On Thu, 28 Nov 2024 at 16:39, Bertrand Drouvot wrote: > > Hi, > > On Wed, Nov 27, 2024 at 11:08:01AM -0500, Melanie Plageman wrote: > > On Wed, Sep 11, 2024 at 7:19 AM Nazir Bilal Yavuz > > wrote: > > > > > > Currently, in the pg_stat_io view, IOs are counted

Re: Doc: clarify the log message level of the VERBOSE option

2024-12-04 Thread Yugo Nagata
On Tue, 03 Dec 2024 18:23:11 +0900 Masahiro Ikeda wrote: > Hi, > > I'd like to clarify the log message level of the VERBOSE option > because I misunderstood that VACUUM VERBOSE messages cannot be > printed in the server log. > > Although the hint is mentioned in "Table 19.2. Message Severity Le

Re: Make tuple deformation faster

2024-12-04 Thread David Rowley
On Tue, 3 Dec 2024 at 16:54, David Rowley wrote: > After making some last-minute cosmetic adjustments, I've just pushed > the 0001 patch. So that commit broke all of the debug_parallel_query = regress buildfarm animals. This was due to how I'd changed the TupleDescData.attrs array to a pointer wh

Re: Add Pipelining support in psql

2024-12-04 Thread Anthonin Bonnefoy
An updated version of the patch, still a bit rough around the edges. I've added \flushrequest, \flush and \getrequests meta-commands. \flushrequest and \getresults look interesting as they add an additional protocol message to test, but it also introduces the possibility to be in the middle of an

Re: Re:Re:Re: backup server core when redo btree_xlog_insert that type is XLOG_BTREE_INSERT_POST

2024-12-04 Thread Peter Geoghegan
On Sun, Dec 1, 2024 at 8:11 AM yuansong wrote: > the _bt_binsrch_insert function always returns low, but during the post list > search, are there cases where low and mid are unequal? > > If so, this could potentially cause an offset in the subsequent > _bt_insertonpg function. > > maybe we fix i

Re:Re:Re:Re: backup server core when redo btree_xlog_insert that type is XLOG_BTREE_INSERT_POST

2024-12-04 Thread yuansong
the _bt_binsrch_insert function always returns low, but during the post list search, are there cases where low and mid are unequal? If so, this could potentially cause an offset in the subsequent _bt_insertonpg function. maybe we fix it like this ? OffsetNumber _bt_binsrch_insert(Relation

Re: generic plans and "initial" pruning

2024-12-04 Thread Amit Langote
Hi Tomas, On Mon, Dec 2, 2024 at 3:36 AM Tomas Vondra wrote: > Hi, > > I took a look at this patch, mostly to familiarize myself with the > pruning etc. I have a bunch of comments, but all of that is minor, > perhaps even nitpicking - with prior feedback from David, Tom and > Robert, I can't real

Re: Serverside SNI support in libpq

2024-12-04 Thread Daniel Gustafsson
> On 4 Dec 2024, at 01:43, Jacob Champion > wrote: > > On Tue, Dec 3, 2024 at 5:58 AM Daniel Gustafsson wrote: >>> Have you seen any weird behavior like this on your end? I'm starting >>> to doubt my test setup... >> >> I've not been able to reproduce any behaviour like what you describe. > >

Re: Guidance Needed for Testing PostgreSQL Patch (CF-5044)

2024-12-04 Thread Andrew Dunstan
On 2024-12-04 We 3:07 AM, postgresql_contributors wrote: Hi pg_hackers, I hope you are doing well. I am working on reviewing PostgreSQL community tickets and started with the patch cf/5044. This patch is in the branch cf/5044, and I pulled the code to test it. Here’s what I have done so far:

Re: checksum verification code breaks backups in v16-

2024-12-04 Thread Robert Haas
On Tue, Dec 3, 2024 at 5:26 PM Nathan Bossart wrote: > On Tue, Dec 03, 2024 at 11:39:43AM -0500, Robert Haas wrote: > > If we want a narrower and thus less-risky fix, we could consider just > > adjusting this code here: > > > > segmentno = atoi(segmentpath + 1); > >

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

2024-12-04 Thread Daniel Gustafsson
> On 4 Dec 2024, at 15:28, Robert Haas wrote: > > On Wed, Dec 4, 2024 at 8:54 AM Daniel Gustafsson wrote: >> Looking over this again I realized it's a bit silly to fall back on >> FIPS_mode() >> when EVP_default_properties_is_fips_enabled isn't available since that would >> only be OpenSSL vers

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

2024-12-04 Thread Robert Haas
On Wed, Dec 4, 2024 at 8:54 AM Daniel Gustafsson wrote: > Looking over this again I realized it's a bit silly to fall back on > FIPS_mode() > when EVP_default_properties_is_fips_enabled isn't available since that would > only be OpenSSL versions before 3.0 (and since we don't support 1.0.2 then n

Re: Eager aggregation, take 3

2024-12-04 Thread Robert Haas
On Sun, Nov 10, 2024 at 7:52 PM Richard Guo wrote: > Hmm, currently we only consider grouped aggregation for eager > aggregation. For grouped aggregation, the window function's > arguments, as well as the PARTITION BY expressions, must appear in the > GROUP BY clause. That is to say, the depname

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

2024-12-04 Thread Robert Haas
On Wed, Dec 4, 2024 at 9:33 AM Daniel Gustafsson wrote: > > The comment suggests to me that if the user happened to be using > > OpenSSL 1.1.1 and CheckLegacyCryptoMode() was called, the expected > > outcome would be an error, but it will just return. > > I think I know what you mean, but just to

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

2024-12-04 Thread Joe Conway
On 12/4/24 09:33, Daniel Gustafsson wrote: since OpenSSL 1.1.1 cannot operate in FIPS mode. I don't think that is correct. The RHEL 8 openssl which was FIPS 140-2 validated is 1.1.1k. See: https://csrc.nist.gov/CSRC/media/projects/cryptographic-module-validation-program/documents/security-po

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

2024-12-04 Thread Daniel Gustafsson
> On 4 Dec 2024, at 15:40, Joe Conway wrote: > > On 12/4/24 09:33, Daniel Gustafsson wrote: >> since OpenSSL 1.1.1 cannot operate in FIPS mode. > > I don't think that is correct. The RHEL 8 openssl which was FIPS 140-2 > validated is 1.1.1k. See: > > https://csrc.nist.gov/CSRC/media/projects/c

Re: add support for the old naming libs convention on windows (ssleay32.lib and libeay32.lib)

2024-12-04 Thread Daniel Gustafsson
> On 2 Dec 2024, at 22:12, Darek Ślusarczyk wrote: > According to the postgresql-17 requirements > https://www.postgresql.org/docs/17/install-requirements.html > the minimum required version of openssl is 1.0.2. > In that version, the naming convention on windows is still ssleay32.[lib|dll] > a

Re: Index AM API cleanup

2024-12-04 Thread Peter Eisentraut
On 27.11.24 13:57, Peter Eisentraut wrote: I think, however, that we should rename RowCompareType.  Otherwise, it's just going to be confusing forevermore.  I suggest to rename it simply to CompareType. I'm going to try to code up the gist support on top of this patch set to make sure that it

Re: Make tuple deformation faster

2024-12-04 Thread Andres Freund
Hi, On 2024-12-05 01:42:36 +1300, David Rowley wrote: > On Tue, 3 Dec 2024 at 16:54, David Rowley wrote: > > After making some last-minute cosmetic adjustments, I've just pushed > > the 0001 patch. > > So that commit broke all of the debug_parallel_query = regress > buildfarm animals. Seems we

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

2024-12-04 Thread Joe Conway
On 12/4/24 09:45, Daniel Gustafsson wrote: On 4 Dec 2024, at 15:40, Joe Conway wrote: On 12/4/24 09:33, Daniel Gustafsson wrote: since OpenSSL 1.1.1 cannot operate in FIPS mode. I don't think that is correct. The RHEL 8 openssl which was FIPS 140-2 validated is 1.1.1k. See: https://csrc.ni

Add pg_stat_progress_rewrite view.

2024-12-04 Thread Kirill Reshke
Hi hackers! Recently, one administrator asked me how to monitor the progress of his ALTER TABLE... ALTER COLUMN TYPE bigint. That leads me to believe that consumers might benefit from having an API to track the table change process. PFA draft patch adding number of tuples (tuples_processed) that

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

2024-12-04 Thread Daniel Gustafsson
> On 4 Dec 2024, at 15:52, Joe Conway wrote: > > On 12/4/24 09:45, Daniel Gustafsson wrote: >>> On 4 Dec 2024, at 15:40, Joe Conway wrote: >>> On 12/4/24 09:33, Daniel Gustafsson wrote: since OpenSSL 1.1.1 cannot operate in FIPS mode. >>> I don't think that is correct. The RHEL 8 openssl wh

Re: Missing LWLock protection in pgstat_reset_replslot()

2024-12-04 Thread Bertrand Drouvot
Hi, On Wed, Dec 04, 2024 at 03:45:13AM +0300, Anton A. Melnikov wrote: > Hi! > > b36fbd9f8d message says that inconsistency may still be possible because > statistics are not completely consistent for a single scan of > pg_stat_replication_slots under concurrent replication slot drop or > creatio

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

2024-12-04 Thread Joe Conway
On 12/4/24 10:01, Daniel Gustafsson wrote: On 4 Dec 2024, at 15:52, Joe Conway wrote: On 12/4/24 09:45, Daniel Gustafsson wrote: On 4 Dec 2024, at 15:40, Joe Conway wrote: On 12/4/24 09:33, Daniel Gustafsson wrote: since OpenSSL 1.1.1 cannot operate in FIPS mode. I don't think that is corre

Re: shared-memory based stats collector - v70

2024-12-04 Thread Bertrand Drouvot
Hi, On Wed, Dec 04, 2024 at 04:00:53AM +0300, Anton A. Melnikov wrote: > > On 03.12.2024 18:07, Andres Freund wrote: > > Hi, > > > > On 2024-12-03 13:37:48 +0300, Anton A. Melnikov wrote: > > > Found a place in the code of this patch that is unclear to me: > > > https://github.com/postgres/postg

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

2024-12-04 Thread Joe Conway
On 12/4/24 10:57, Joe Conway wrote: On 12/4/24 10:01, Daniel Gustafsson wrote: On 4 Dec 2024, at 15:52, Joe Conway wrote: On 12/4/24 09:45, Daniel Gustafsson wrote: On 4 Dec 2024, at 15:40, Joe Conway wrote: On 12/4/24 09:33, Daniel Gustafsson wrote: since OpenSSL 1.1.1 cannot operate in FI

Re: [PATCH] SVE popcount support

2024-12-04 Thread Nathan Bossart
On Wed, Dec 04, 2024 at 08:51:39AM -0600, Malladi, Rama wrote: > Thank you, Kirill, for the review and the feedback. Please find inline my > reply and an updated patch. Thanks for the updated patch. I have a couple of high-level comments. Would you mind adding this to the commitfest system (https

Re: checksum verification code breaks backups in v16-

2024-12-04 Thread Nathan Bossart
On Wed, Dec 04, 2024 at 09:29:50AM -0500, Robert Haas wrote: > On Tue, Dec 3, 2024 at 5:26 PM Nathan Bossart > wrote: >> I'm only seeing this code in pg_checksums. Is that what you are proposing >> to change? > > No. This code is present in src/backend/backup/basebackup.c in REL_16_STABLE. D'o

Re: plperl version on the meson setup summary screen

2024-12-04 Thread Andrew Dunstan
On 2024-11-29 Fr 3:26 AM, Nazir Bilal Yavuz wrote: Hi, On Fri, 29 Nov 2024 at 08:40, Zharkov Roman wrote: Hello, On 2024-11-27 21:50, Andrew Dunstan wrote: it should give the same answer Sometimes "version" and "api_versionstring" are different. Here are two simple examples from my window

Re: Proposal: Role Sandboxing for Secure Impersonation

2024-12-04 Thread Eric Hanson
On Mon, Dec 2, 2024 at 10:31 AM Wolfgang Walther wrote: > Eric Hanson: > > a) Transaction ("local") Sandbox: > > - SET LOCAL ROLE alice NO RESET; > > - SET LOCAL ROLE alice WITHOUT RESET; > > - BEGIN AS ROLE alice; > > > > Transaction-level sandboxes have the benefit that a pooler can simply > >

Re: SQL:2011 application time

2024-12-04 Thread Paul Jungwirth
On 12/4/24 03:15, Peter Eisentraut wrote: I did some more work on this approach, with the attached patches resulting.  This is essentially what I'm describing above, which in turn is a variation of your patch v45-0001-Fix-logical- replication-for-temporal-tables.patch, with your tests added at t

XMLDocument (SQL/XML X030)

2024-12-04 Thread Jim Jones
Hi, I'd like to propose the implementation of XMLDocument (SQL/XML X030).It basically returns an XML document from a given XML expression, e.g. SELECT   xmldocument(     xmlelement(NAME foo,   xmlattributes(42 AS att),   xmlelement(NAME bar,     xmlconcat('va', 'lue'))     )   );

Re: Remove remnants of "snapshot too old"

2024-12-04 Thread Nathan Bossart
On Wed, Dec 04, 2024 at 09:55:43AM +0200, Heikki Linnakangas wrote: > On 04/12/2024 03:24, Tom Lane wrote: >> Andres Freund writes: >> > Most of this I agree with. But I'm not sure just removing the toast >> > snapshot >> > stuff is good - we've had a bunch of bugs where we don't hold a snapshot

Re: checksum verification code breaks backups in v16-

2024-12-04 Thread Robert Haas
On Wed, Dec 4, 2024 at 11:10 AM Nathan Bossart wrote: > D'oh, sorry. Even so, I think I'd still vote for back-patching the v17 > commit that inadvertently fixed this. Gotcha. Let's see if anyone else votes. -- Robert Haas EDB: http://www.enterprisedb.com

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

2024-12-04 Thread Daniel Gustafsson
> On 3 Dec 2024, at 22:56, Daniel Gustafsson wrote: > >> On 3 Dec 2024, at 15:04, Joe Conway wrote: >> >> On 12/3/24 08:59, Daniel Gustafsson wrote: On 24 Nov 2024, at 14:48, Daniel Gustafsson wrote: >>> Any other opinions or should we proceed with the proposed GUC? >> >> I'm good with i

Re: Add pg_stat_progress_rewrite view.

2024-12-04 Thread Alvaro Herrera
Hello, On 2024-Dec-04, Kirill Reshke wrote: > Recently, one administrator asked me how to monitor the progress of > his ALTER TABLE... ALTER COLUMN TYPE bigint. > > That leads me to believe that consumers might benefit from having an > API to track the table change process. I agree that trackin

Re: UUID v7

2024-12-04 Thread Andrey M. Borodin
> On 2 Dec 2024, at 11:00, Masahiko Sawada wrote: > > The monotonicity of generated UUIDv7 is guaranteed only within a > single backend. I've addressed all items, except formatting a table... I can't build docs to make a reasonable judgement if the table looks OK. Changes: - restored leakpro

CVE-2024-10979 - Does this affect Postgres built without --with-perl option?

2024-12-04 Thread Mark Hill
Does the CVE-2024-10979 affect Postgres that is NOT built with the --with-perl option? Thanks, Mark

deferred writing of two-phase state files adds fragility

2024-12-04 Thread Robert Haas
Let's suppose that you execute PREPARE TRANSACTION and, before the next CHECKPOINT, the WAL record for the PREPARE TRANSACTION gets corrupted on disk. This might seem like an unlikely scenario, and it is, but we saw a case at EDB not too long ago. To a first approximation, the world ends. You can'

Re: CVE-2024-10979 - Does this affect Postgres built without --with-perl option?

2024-12-04 Thread David G. Johnston
On Wed, Dec 4, 2024 at 10:07 AM Mark Hill wrote: > Does the CVE-2024-10979 affect Postgres that is NOT built with the > --with-perl option? > > It requires the attacker being able to write and get executed a PL function in the server written in pl/perl. That is impossible if the server hasn't b

Re: [18] Unintentional behavior change in commit e9931bfb75

2024-12-04 Thread Peter Eisentraut
On 02.12.24 23:25, Tom Lane wrote: Jeff Davis writes: The behavior is commented (commit 176d5bae1d) in formatting.c: * ... When using the default * collation, we apply the traditional Postgres behavior that * forces ASCII-style treatment of I/i, but in non-default * collatio

Re: checksum verification code breaks backups in v16-

2024-12-04 Thread Tom Lane
Robert Haas writes: > On Wed, Dec 4, 2024 at 11:10 AM Nathan Bossart > wrote: >> D'oh, sorry. Even so, I think I'd still vote for back-patching the v17 >> commit that inadvertently fixed this. > Gotcha. Let's see if anyone else votes. +1 for a back-patch of 025584a16. It's made it through a

Re: deferred writing of two-phase state files adds fragility

2024-12-04 Thread Tom Lane
Robert Haas writes: > Let's suppose that you execute PREPARE TRANSACTION and, before the > next CHECKPOINT, the WAL record for the PREPARE TRANSACTION gets > corrupted on disk. This might seem like an unlikely scenario, and it > is, but we saw a case at EDB not too long ago. > To a first approxim

Re: generic plans and "initial" pruning

2024-12-04 Thread Tomas Vondra
On 12/4/24 14:34, Amit Langote wrote: > Hi Tomas, > > On Mon, Dec 2, 2024 at 3:36 AM Tomas Vondra wrote: >> Hi, >> >> I took a look at this patch, mostly to familiarize myself with the >> pruning etc. I have a bunch of comments, but all of that is minor, >> perhaps even nitpicking - with prior

Re: [18] Unintentional behavior change in commit e9931bfb75

2024-12-04 Thread Tom Lane
Peter Eisentraut writes: > On 02.12.24 23:25, Tom Lane wrote: >> Well, also for compatibility with our SQL parser's understanding >> of identifier lowercasing. > Maybe that was relevant before the "name" type got its own collation? downcase_identifier doesn't give a fig about name's collation.

Re: generic plans and "initial" pruning

2024-12-04 Thread Tom Lane
Tomas Vondra writes: > I'm not forcing you to do elog, if you think ereport() is better. I'm > only asking because AFAIK the "policy" is that ereport is for cases that > think can happen (and thus get translated), while elog(ERROR) is for > cases that we believe shouldn't happen. The proposed cod

Re: deferred writing of two-phase state files adds fragility

2024-12-04 Thread Robert Haas
On Wed, Dec 4, 2024 at 12:19 PM Tom Lane wrote: > > You can't execute COMMIT > > TRANSACTION or ROLLBACK TRANSACTION, so there's now way to resolve the > > prepared transaction. > > Could we fix it so ROLLBACK TRANSACTION removes the GID from the > list of prepared xacts that need to be written ou

Re: deferred writing of two-phase state files adds fragility

2024-12-04 Thread Robert Haas
On Wed, Dec 4, 2024 at 12:58 PM Tom Lane wrote: > Robert Haas writes: > > On Wed, Dec 4, 2024 at 12:19 PM Tom Lane wrote: > >> Could we fix it so ROLLBACK TRANSACTION removes the GID from the > >> list of prepared xacts that need to be written out? Then we'd > >> no longer have a pending requir

Re: deferred writing of two-phase state files adds fragility

2024-12-04 Thread Tom Lane
Robert Haas writes: > On Wed, Dec 4, 2024 at 12:19 PM Tom Lane wrote: >> Could we fix it so ROLLBACK TRANSACTION removes the GID from the >> list of prepared xacts that need to be written out? Then we'd >> no longer have a pending requirement to read the broken WAL record. > That would be nice,

SCRAM pass-through authentication for postgres_fdw

2024-12-04 Thread Matheus Alcantara
Hi, The attached a patch enables SCRAM authentication for postgres_fdw connections without requiring plain-text password on user mapping properties. This is achieved by storing the SCRAM ClientKey and ServerKey obtained during client authentication with the backend. These keys are then used

Re: Proposal: Role Sandboxing for Secure Impersonation

2024-12-04 Thread Joe Conway
On 12/4/24 11:13, Eric Hanson wrote: Thanks all for the input so far.  I think we are the "usual suspects" of advocating for this feature. :) Yeah, I looked at the old thread and came to the same conclusion ;-) However on that thread[1] Jelte and Robert expressed a preference to accomplishing

Re: Potential ABI breakage in upcoming minor releases

2024-12-04 Thread Peter Eisentraut
On 29.11.24 21:39, Noah Misch wrote: I remembered where that's documented: https://wiki.postgresql.org/wiki/ Committing_checklist#Maintaining_ABI_compatibility_while_backpatching I'd say the source tree's , which David Wheeler mentioned, is authoritative. It currently matches postgr.es/c/e54a

Re: Cannot find a working 64-bit integer type on Illumos

2024-12-04 Thread Tom Lane
Also ... grison and turaco are emitting warnings that were not there a couple of days ago: grison| 2024-12-04 17:10:09 | reconstruct.c:701:33: warning: passing argument 2 of 'copy_file_range' from incompatible pointer type [-Wincompatible-pointer-types] turaco| 2024-12-04 16:15

Re: Potential ABI breakage in upcoming minor releases

2024-12-04 Thread Tom Lane
Peter Eisentraut writes: > On 29.11.24 21:39, Noah Misch wrote: >> I'd say the source tree's , >> which >> David Wheeler mentioned, is authoritative. It currently matches >> postgr.es/c/e54a42a. Let's update both or change that wiki heading to point >> to the authoritative doc section. > I don

Benchmark function for uuidv7()

2024-12-04 Thread Sergey Prokhorenko
On Friday 29 November 2024 at 08:55:09 pm GMT+3, Masahiko Sawada wrote: On Fri, Nov 29, 2024 at 5:59 AM Sergey Prokhorenko wrote: > > > > Sergey Prokhorenko sergeyprokhore...@yahoo.com.au > > > On Friday 29 November 2024 at 09:19:33 am GMT+3, Masahiko Sawada > wrote: > > > On Thu, N

  1   2   >