Re: Fix slot synchronization with two_phase decoding enabled

2025-04-23 Thread Amit Kapila
On Wed, Apr 23, 2025 at 11:04 PM Masahiko Sawada wrote: > > On Tue, Apr 22, 2025 at 3:00 AM Amit Kapila wrote: > > > > On Mon, Apr 21, 2025 at 8:44 AM Zhijie Hou (Fujitsu) > > wrote: > > > > > > On Sat, Apr 19, 2025 at 2:19 AM Masahiko Sawada wrote: > > > > > > > > On Tue, Apr 8, 2025 at 10:14 P

Re: Make COPY format extendable: Extract COPY TO format implementations

2025-04-23 Thread Masahiko Sawada
On Fri, Apr 4, 2025 at 1:38 AM Sutou Kouhei wrote: > > Hi, > > In > "Re: Make COPY format extendable: Extract COPY TO format implementations" > on Mon, 31 Mar 2025 12:35:23 -0700, > Masahiko Sawada wrote: > > > Most of the queries under test_copy_format/sql verifies the input > > patterns o

Re: Logical Replication of sequences

2025-04-23 Thread Peter Smith
Hi Vignesh, Some comments for v20250422-0004. == src/backend/commands/sequence.c pg_sequence_state: 1. + * The page_lsn will be utilized in logical replication sequence + * synchronization to record the page_lsn of sequence in the pg_subscription_rel + * system catalog. It will reflect the

Re: [PATCH] Re: Proposal to Enable/Disable Index using ALTER INDEX

2025-04-23 Thread jian he
hi. The following is a review of version 17. ATExecSetIndexVisibility if (indexForm->indisvisible != visible) { indexForm->indisvisible = visible; CatalogTupleUpdate(pg_index, &indexTuple->t_self, indexTuple); CacheInvalidateRelcache(heapRel); InvokeObjectPo

Re: AIO v2.5

2025-04-23 Thread Alexander Lakhin
Hello Andres, 24.04.2025 03:40, Andres Freund wrote: Hi, On 2025-04-20 18:00:00 +0300, Alexander Lakhin wrote: 2025-04-08 01:41:54.670 UTC [4013251][client backend][0/2:0] DEBUG: waiting for self with 0 pending I'd like to extend this debug message with the number of in-flight IOs. I assum

Non-reproducible AIO failure

2025-04-23 Thread Tom Lane
My buildfarm animal sifaka just failed like this [1]: TRAP: failed Assert("aio_ret->result.status != PGAIO_RS_UNKNOWN"), File: "bufmgr.c", Line: 1605, PID: 79322 0 postgres0x000100e3df2c ExceptionalCondition + 108 1 postgres0x00

Re: Add Pipelining support in psql

2025-04-23 Thread Michael Paquier
On Wed, Apr 23, 2025 at 04:13:14PM +0900, Michael Paquier wrote: > The tweak for psql_fails_like() was kind of independent of the rest of > the fix, so I have applied that as a commit of its own. I am not > convinced about the addition of a 4th test where we use the queries > with semicolons witho

Re: Making sslrootcert=system work on Windows psql

2025-04-23 Thread George MacKerron
> On 3 Apr 2025, at 15:26, Daniel Gustafsson wrote: > >> I quite like sslrootcert=os: it’s snappy, and it implies that the Operating >> System root certs are going to be used (which is what I would have liked >> sslrootcert=system to mean). Some possible alternatives might be >> sslrootcert=pu

Re: support ALTER COLUMN SET EXPRESSION over virtual generated column with check constraint

2025-04-23 Thread jian he
On Tue, Mar 11, 2025 at 12:17 PM jian he wrote: > hi. > in summary: ATExecSetExpression, RememberAllDependentForRebuilding > will do all the work to change the generation expression, > whether it's virtual or stored. > while working on another patch, I found out this can be further simplified. Th

Re: Using pg_bitutils.h in tidbitmap.c.

2025-04-23 Thread John Naylor
On Mon, Apr 14, 2025 at 7:42 PM Thomas Munro wrote: > > tidbitmap.c's operations loop over all the bits, but could leap over > zeros with bitmap instructions like bitmapset.c. Hard to imagine that > matters, but I think it also comes out easier to read? Interesting idea -- I toyed with something

Re: ZStandard (with dictionaries) compression support for TOAST compression

2025-04-23 Thread Robert Haas
On Wed, Apr 23, 2025 at 11:59 AM Robert Haas wrote: > heap_toast_insert_or_update care about HeapTupleHasExternal(), which > seems like it might be a key point. Care about HeapTupleHasVarWidth, rather. -- Robert Haas EDB: http://www.enterprisedb.com

Re: AIO v2.5

2025-04-23 Thread Andres Freund
Hi, On 2025-04-20 18:00:00 +0300, Alexander Lakhin wrote: > 31.03.2025 02:46, Andres Freund wrote: > > I've pushed most of these after some very light further editing. Yay. > > Thanks > > a lot for all the reviews! > > > > So far the buildfarm hasn't been complaining, but it's early days. > >

Re: Avoid core dump in pgstat_read_statsfile()

2025-04-23 Thread Michael Paquier
On Wed, Apr 23, 2025 at 08:01:40AM +, Bertrand Drouvot wrote: > I think that a check on pgstat_get_kind_info() is missing for this scenario, > the > patch adds it. Such a check already exists for PGSTAT_FILE_ENTRY_FIXED and > for stats entry identified by name on disk, but not for > PGSTAT_FI

Re: Logical Replication of sequences

2025-04-23 Thread Peter Smith
Hi Vignesh, Some review comments for patch v20250422-0003. == src/backend/replication/logical/syncutils.c 1. +/* + * Exit routine for synchronization worker. + */ +pg_noreturn void +SyncFinishWorker(void) Why does this have the pg_noreturn annotation? None of the other void functions do. ~

Re: [PATCH] contrib/xml2: xslt_process() should report XSLT-related error details

2025-04-23 Thread Tom Lane
"Robin Haberkorn" writes: > btw. you wrote that comment in cacd42d62cb2ddf32135b151f627780a5509780f > back in 2011. > The commit message also contains some background information. Hm. I wonder if we couldn't get rid of the HAVE_XMLSTRUCTUREDERRORCONTEXT conditionalization. If the libxml2 versio

Re: Non-reproducible AIO failure

2025-04-23 Thread Tom Lane
Andres Freund writes: > On 2025-04-23 17:17:01 -0400, Tom Lane wrote: >> My buildfarm animal sifaka just failed like this [1]: > There's nothing really special about sifaka, is there? I see -std=gnu99 and a > few debug -D cppflags, but they don't look they could really be relevant here. No, it's

Re: What's our minimum supported Python version?

2025-04-23 Thread Jacob Champion
On Wed, Apr 23, 2025 at 2:11 AM Jelte Fennema-Nio wrote: > I'm confused. Are you intending to backport new test infra to PG18? Not particularly (though, if the barriers were low enough, wouldn't that be nice?). I'm talking about hazards in oauth_server.py here. > Given the purpose and pretty sma

Re: What's our minimum supported Python version?

2025-04-23 Thread Jacob Champion
On Wed, Apr 23, 2025 at 4:24 AM Devrim Gündüz wrote: > psycopg is included in RHEL 8, but PGDG packages are up2date (2.7.5 vs > 2.9.5) so they override OS packages. That is why things will break. Thanks, this is super helpful! --Jacob

Re: Non-reproducible AIO failure

2025-04-23 Thread Andres Freund
Hi, On 2025-04-23 17:17:01 -0400, Tom Lane wrote: > My buildfarm animal sifaka just failed like this [1]: There's nothing really special about sifaka, is there? I see -std=gnu99 and a few debug -D cppflags, but they don't look they could really be relevant here. > TRAP: failed Assert("aio_ret->

Re: Large expressions in indexes can't be stored (non-TOASTable)

2025-04-23 Thread Nathan Bossart
On Wed, Apr 23, 2025 at 05:33:41PM -0400, Tom Lane wrote: > Nathan Bossart writes: >> Here is a new version of the patch with this change. > > I don't see any comments in this patch that capture the real > reason for removing pg_replication_origin's TOAST table, > namely (IIUC) that we'd like to

Re: Large expressions in indexes can't be stored (non-TOASTable)

2025-04-23 Thread Tom Lane
Nathan Bossart writes: > Here is a new version of the patch with this change. I don't see any comments in this patch that capture the real reason for removing pg_replication_origin's TOAST table, namely (IIUC) that we'd like to be able to access that catalog without a snapshot. I think it's impo

Re: Large expressions in indexes can't be stored (non-TOASTable)

2025-04-23 Thread Nathan Bossart
On Tue, Apr 22, 2025 at 12:21:01PM -0500, Nathan Bossart wrote: > On Tue, Apr 22, 2025 at 05:17:17PM +0530, Nisha Moond wrote: >> 5) As Euler pointed out, logical replication already has a built-in >> restriction for internally assigned origin names, limiting them to >> NAMEDATALEN. Given that, onl

Re: [PATCH] contrib/xml2: xslt_process() should report XSLT-related error details

2025-04-23 Thread Robin Haberkorn
On Wed Apr 23, 2025 at 00:42:06 GMT +03, Robin Haberkorn wrote: > /* > * Legacy error handling mode. err_occurred is never set, we just add the > * message to err_buf. This mode exists because the xml2 contrib module > * uses our error-handling infrastructure, but we don't want to change its >

Re: Conflicting updates of command progress

2025-04-23 Thread Antonin Houska
Fujii Masao wrote: > On 2025/04/15 2:13, Sami Imseih wrote: > >> While working on [1] I realized that some field of pg_stat_progress_cluste > >> has > >> weird value. > > I ran into the same issue while working on [2], and eventually had to > withdraw that patch because of it. Have you conside

Re: pgsql: Add function to get memory context stats for processes

2025-04-23 Thread Tom Lane
Robert Haas writes: > My primary concern about the patch is that > ProcessGetMemoryContextInterrupt() can be called from any > CHECK_FOR_INTERRUPTS() and calls lots of DSA functions, including > dsa_create() and, via PublishMemoryContext(), dsa_allocate0(). I'm > shocked to hear that you and Andre

Re: extension_control_path and "directory"

2025-04-23 Thread Matheus Alcantara
On Wed, Apr 23, 2025 at 10:57 AM David E. Wheeler wrote: > > On Apr 23, 2025, at 09:50, Christoph Berg wrote: > > > Remembering which path the .control file was found in and from there > > open the extension "directory" doesn't sound too hard. Why does it > > have to be more complicated? > > This

Re: [PATCH] Support older Pythons in oauth_server.py

2025-04-23 Thread Daniel Gustafsson
> On 23 Apr 2025, at 22:26, Jacob Champion > wrote: > > On Tue, Apr 22, 2025 at 12:45 PM Jacob Champion > wrote: >> Great, thanks for the quick review! > > And pushed. Thanks everyone! Congratulations on your first commit, looking forward to many more to come! -- Daniel Gustafsson

Re: [PATCH] Support older Pythons in oauth_server.py

2025-04-23 Thread Jacob Champion
On Tue, Apr 22, 2025 at 12:45 PM Jacob Champion wrote: > Great, thanks for the quick review! And pushed. Thanks everyone! --Jacob

Re: Conflicting updates of command progress

2025-04-23 Thread Sami Imseih
>> pgstat_progress_start_command should only be called once by the entry >> point for the >> command. In theory, we could end up in a situation where start_command >> is called multiple times during the same top-level command; > Not only in theory - it actually happens when CLUSTER is rebuilding i

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-23 Thread Christoph Berg
Re: Jacob Champion > Also: since the libpq-oauth-18 and libpq-oauth-19 packages can be > installed side-by-side safely, isn't the upgrade hazard significantly > diminished? (If a user uninstalls the previous libpq-oauth version > while they're still running that version of libpq in memory, _and_ >

Re: Cygwin support

2025-04-23 Thread Andrew Dunstan
On 2025-04-21 Mo 12:29 PM, Andrew Dunstan wrote: Last year the old Windows machine where I was running the buildfarm member lorikeet died, and since then we've had no buildfarm coverage for Cygwin. I now have a new (but slow) W11pro machine and I have been testing out Cygwin builds on it. I

Re: [PATCH] dynahash: add memory allocation failure check

2025-04-23 Thread Tom Lane
m.korot...@postgrespro.ru writes: > I found a case of potential NULL pointer dereference. > In src/backend/utils/hash/dynahash.c in function HTAB *hash_create() the > result of the DynaHashAlloc() is used unsafely. > The function DynaHashAlloc() calls MemoryContextAllocExtended() with > MCXT_ALLO

Re: [PATCH] dynahash: add memory allocation failure check

2025-04-23 Thread m . korotkov
Andrey Borodin wrote 2025-04-23 12:46: It seems there are a lot of cases of MCXT_ALLOC_NO_OOM, perhaps should we check them all? Yep, I think we should. I found this issue with the Svace static analyzer, and it might have missed other issues. Perhaps a more comprehensive investigation is neede

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-23 Thread Jacob Champion
On Wed, Apr 23, 2025 at 9:38 AM Christoph Berg wrote: > > We could all agree to bump the second number in the filename whenever > > there's an internal ABI change. That works from a technical > > perspective, but it's hard to test and enforce and... just not forget. > > It's hopefully not harder t

Re: Fix slot synchronization with two_phase decoding enabled

2025-04-23 Thread Masahiko Sawada
On Tue, Apr 22, 2025 at 3:00 AM Amit Kapila wrote: > > On Mon, Apr 21, 2025 at 8:44 AM Zhijie Hou (Fujitsu) > wrote: > > > > On Sat, Apr 19, 2025 at 2:19 AM Masahiko Sawada wrote: > > > > > > On Tue, Apr 8, 2025 at 10:14 PM Zhijie Hou (Fujitsu) > > > wrote: > > > > > > > > > > > > -- > >

Re: Built-in Raft replication

2025-04-23 Thread Devrim Gündüz
Hi, On Wed, 2025-04-23 at 11:48 -0500, Jim Nasby wrote: > unless we added multiple WAL streams. That would allow for splitting > WAL traffic across multiple devices as well as providing better > support for configurations that don’t replicate the entire cluster. > The current situation where delay

Re: long-standing data loss bug in initial sync of logical replication

2025-04-23 Thread Masahiko Sawada
On Tue, Apr 22, 2025 at 11:31 PM Amit Kapila wrote: > > On Tue, Apr 22, 2025 at 10:57 PM Masahiko Sawada > wrote: > > > > On Tue, Mar 18, 2025 at 2:55 AM Amit Kapila wrote: > > > > > > On Mon, Mar 17, 2025 at 4:56 PM Hayato Kuroda (Fujitsu) > > > wrote: > > > > > > > > > Regarding the PG13, it

Re: SQL:2023 JSON simplified accessor support

2025-04-23 Thread Nikita Malakhov
Hi Alex! Glad you made so much effort to develop this patch set! I think this is an important part of Json functionality. I've looked into you patch and noticed change in behavior in new test results: postgres@postgres=# create table t(x int, y jsonb); insert into t select 1, '{"a": 1, "b": 42}'

Re: Built-in Raft replication

2025-04-23 Thread Jim Nasby
On Apr 16, 2025, at 2:29 PM, Greg Sabino Mullane wrote: > > On Wed, Apr 16, 2025 at 2:18 AM Ashutosh Bapat > wrote: >> Users find it a waste of resources to deploy 3 big PostgreSQL instances just >> for HA where 2 suffice even if they deploy 3 lightweight DC

Re: POC: enable logical decoding when wal_level = 'replica' without a server restart

2025-04-23 Thread Masahiko Sawada
On Wed, Apr 23, 2025 at 5:46 AM Amit Kapila wrote: > > On Mon, Apr 21, 2025 at 11:01 PM Masahiko Sawada > wrote: > > > > I would like to discuss behavioral and user interface considerations. > > > > Upon further analysis of this patch regarding the conversion of > > wal_level to a SIGHUP paramet

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-23 Thread Christoph Berg
Re: Jacob Champion > But the consequences are much worse for a silent ABI mismatch. Imagine > if libpq-oauth examines the wrong pointer inside PGconn for a > security-critical check. True. > > Alternatively, there could be a dedicated SONAME for the plugin that > > only changes when necessary, bu

Re: Doc: fix the rewrite condition when executing ALTER TABLE ADD COLUMN

2025-04-23 Thread Nathan Bossart
This one was briefly discussed in an RMT meeting. On Mon, Mar 24, 2025 at 11:37:20AM +0100, Álvaro Herrera wrote: > On 2025-Mar-24, jian he wrote: > >> In the current development branch, >> virtual generated columns still do not support the domain. >> you can not change the generation expression

Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints

2025-04-23 Thread Nathan Bossart
This one was briefly discussed in an RMT meeting. On Wed, Apr 09, 2025 at 01:16:20PM +0800, jian he wrote: > attached patch is for address pg_dump inconsistency > when parent is "not null not valid" while child is "not null". I see an open item [0] that points to this patch, but there's no owner

Re: extension_control_path and "directory"

2025-04-23 Thread David E. Wheeler
On Apr 23, 2025, at 09:50, Christoph Berg wrote: > Remembering which path the .control file was found in and from there > open the extension "directory" doesn't sound too hard. Why does it > have to be more complicated? This was my question, as well. Do you have a WIP patch to share, Matheus? >

sslmode=secure by default (Re: Making sslrootcert=system work on Windows psql)

2025-04-23 Thread Christoph Berg
Re: George MacKerron > SMALLER IDEA > > I’d suggest two new special sslrootcert values: > > (1) sslrootcert=openssl > > This does exactly what sslrootcert=system does now, but is less confusingly > named for Windows users. sslrootcert=system becomes a deprecated synonym for > this option. > >

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-23 Thread Jacob Champion
On Wed, Apr 23, 2025 at 8:39 AM Christoph Berg wrote: > This will cause problems when programs are running while packages are > updated on disk. That program then tries to dlopen 18-0.so when there > is already 18-1.so installed. Relevant when the first oauth connection > is made way after startup

Re: [BUG] temporary file usage report with extended protocol and unnamed portals

2025-04-23 Thread Sami Imseih
> Yes, I think I had misunderstood what Tom said. Thank you for pointing > that out. > > However, is it really unsafe? I have not been able to find a case where this is unsafe, but the documentation in mmgr/README does indicate that the query string may live shorter than the portal in some cases.

Re: pgsql: Add function to get memory context stats for processes

2025-04-23 Thread Robert Haas
On Tue, Apr 22, 2025 at 4:12 AM Daniel Gustafsson wrote: > Do you mean that an interrupt handler will make DSA allocations? I don't > think > that would be something we'd want to allow regardless of this patch. Or did I > misunderstand the above? My primary concern about the patch is that Proc

Re: ZStandard (with dictionaries) compression support for TOAST compression

2025-04-23 Thread Robert Haas
On Mon, Apr 21, 2025 at 8:52 PM Nikhil Kumar Veldanda wrote: > After reviewing the email thread you attached on previous response, I > identified a natural choke point for both inserts and updates: the > call to "heap_toast_insert_or_update" inside > heap_prepare_insert/heap_update. In the current

Re: vacuumdb --missing-stats-only and pg_upgrade from PG13

2025-04-23 Thread Nathan Bossart
Here is what I have staged for commit. I'll aim to commit these patches sometime next week to give time for additional feedback. -- nathan >From 6d1e608edb17d9bbaaf7d57ace35fee68ff869c0 Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Wed, 23 Apr 2025 10:11:46 -0500 Subject: [PATCH v2 1/2] F

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-23 Thread Christoph Berg
Re: Jacob Champion > - Per ABI comment upthread, we are back to major-minor versioning for > the shared library (e.g. libpq-oauth-18-0.so). 0001 adds the macros > and makefile variables to make this easy, and 0002 is the bulk of the > change now. This will cause problems when programs are running

Re: Enable data checksums by default

2025-04-23 Thread Christoph Berg
Re: Tomas Vondra > We went through the open items on the RMT team meeting today, and my > impression was the questions are mostly about performance of having > checksums by default, but now I realize the thread talks about "upgrade > experience" which seems fairly wide. Fwiw, Debian's pg_upgradecl

Re: What's our minimum supported Python version?

2025-04-23 Thread Jelte Fennema-Nio
On Wed, 23 Apr 2025 at 13:24, Devrim Gündüz wrote: > psycopg is included in RHEL 8, but PGDG packages are up2date (2.7.5 vs > 2.9.5) so they override OS packages. That is why things will break. > > A solution would be creating our own psycopg2 (likely for Python 3.12) > package, update all PGDG pa

Re: vacuumdb --missing-stats-only and pg_upgrade from PG13

2025-04-23 Thread Christoph Berg
Re: Nathan Bossart > My first reaction is that we should just remove the reltuples != 0 check. > That means vacuumdb might analyze some empty tables, but that doesn't seem > too terrible. Or some tables that aren't empty but were never analyzed when they should have been. Sounds like a good thing.

Re: vacuumdb --missing-stats-only and pg_upgrade from PG13

2025-04-23 Thread Nathan Bossart
On Wed, Apr 23, 2025 at 04:01:33PM +0200, Christoph Berg wrote: > If I create a table in a PG13-or-earlier cluster, never ANALYZE it, > and then pg_upgrade to 18 and run vacuumdb --analyze-only > --missing-stats-only, the table will not get analyzed. The only table > visited there is pg_largeobject

Re: extension_control_path and "directory"

2025-04-23 Thread Christoph Berg
Re: Matheus Alcantara > I've tried to implement some kind of "SHAREDIR search path" as we've > discussed on another thread [1] but it shows out that we need some > considerable refactoring to make it work. Remembering which path the .control file was found in and from there open the extension "dir

Re: pgsql: Update guidance for running vacuumdb after pg_upgrade.

2025-04-23 Thread Christoph Berg
Re: Nathan Bossart > pg_log(PG_REPORT, > +"Some statistics are not transferred by pg_upgrade.\n" > "Once you start the new server, consider running:\n" > +"%s/vacuumdb %s--all --analyze-in-stages > --missing-stats-only\n" > +

vacuumdb --missing-stats-only and pg_upgrade from PG13

2025-04-23 Thread Christoph Berg
Re: To Nathan Bossart > > Update guidance for running vacuumdb after pg_upgrade. > > > > Now that pg_upgrade can carry over most optimizer statistics, we > > should recommend using vacuumdb's new --missing-stats-only option > > to only analyze relations that are missing statistics. > > I've been

Re: [PATCH] dynahash: add memory allocation failure check

2025-04-23 Thread Aleksander Alekseev
Hi Maksim, > I found a case of potential NULL pointer dereference. > In src/backend/utils/hash/dynahash.c in function HTAB *hash_create() the > result of the DynaHashAlloc() is used unsafely. > The function DynaHashAlloc() calls MemoryContextAllocExtended() with > MCXT_ALLOC_NO_OOM and can return

Startup subpaths in MergeAppend path

2025-04-23 Thread Andrei Lepikhov
Hi, Upon reviewing [1], I noticed an inconsistency: within the add_paths_to_append_rel function, Postgres only constructs startup_subpaths when the rel->consider_startup flag is set to true. However, the generate_ordered_append_paths function generates these paths regardless of this flag. A

Re: POC: enable logical decoding when wal_level = 'replica' without a server restart

2025-04-23 Thread Amit Kapila
On Mon, Apr 21, 2025 at 11:01 PM Masahiko Sawada wrote: > > I would like to discuss behavioral and user interface considerations. > > Upon further analysis of this patch regarding the conversion of > wal_level to a SIGHUP parameter, I find that supporting all > combinations of wal_level value chan

Does RENAME TABLE rename associated identity sequence?

2025-04-23 Thread Jason Song
Hi hackers, I was wondering if there's any built-in functionality in PostgreSQL where renaming a table with an identity column would also rename the auto-generated sequence associated with that identity column. In my case, I renamed a table that used `GENERATED BY DEFAULT AS IDENTITY`, and later

Re: extension_control_path and "directory"

2025-04-23 Thread Matheus Alcantara
On Wed, Apr 23, 2025 at 6:39 AM Christoph Berg wrote: > > Re: Peter Eisentraut > > The new GUC extension_control_path specifies a path to look for > > extension control files. The default value is $system, which looks in > > the compiled-in location, as before. > > Is the expectation that this al

virtual generated column as partition key

2025-04-23 Thread jian he
hi. The attached patch is to implement $subject. demo: CREATE TABLE t(f1 bigint, f2 bigint GENERATED ALWAYS AS (f1 * 2) VIRTUAL) PARTITION BY RANGE (f2); it will works just fine as CREATE TABLE t(f1 bigint, f2 bigint GENERATED ALWAYS AS (f1 * 2) VIRTUAL) PARTITION BY RANGE ((f1 *2 ); under the h

Re: bug: virtual generated column can be partition key

2025-04-23 Thread jian he
On Tue, Apr 22, 2025 at 4:55 PM Ashutosh Bapat wrote: > > Sorry I missed this email while sending the patches - our emails crossed in > the air. > > On Tue, Apr 22, 2025 at 2:15 PM jian he wrote: >> >> On Tue, Apr 22, 2025 at 3:02 PM jian he wrote: >> > Other than that, it looks good to me for

Re: What's our minimum supported Python version?

2025-04-23 Thread Devrim Gündüz
Hi, On Wed, 2025-04-23 at 11:46 +0200, Jelte Fennema-Nio wrote: > I'm confused. The upstream RHEL8 repo depends on packages in pgdg??? > > Or are you saying that psycopg (and patroni) are not part of the > pgdg-repo, and instead part of the upstream-repo. And so that other > packages in pgdg that

Re: Fix slot synchronization with two_phase decoding enabled

2025-04-23 Thread Nisha Moond
On Tue, Apr 22, 2025 at 3:23 PM shveta malik wrote: > > On Fri, Apr 11, 2025 at 1:03 PM Nisha Moond wrote: > > > > > > Patch "v5_aprch_3-0001" implements the above Approach 3. > > > > Thanks Hou-san for implementing approach-2 and providing the patch. > > > > I find Approach 2 better than Approac

Re: Conflicting updates of command progress

2025-04-23 Thread Antonin Houska
Sami Imseih wrote: > > While working on [1] I realized that some field of pg_stat_progress_cluste > > has > > weird value. > > Is there a repro that you can share that shows the weird values? It sounds > like > the repro is on top of [1]. Is that right? Yes. > > AFAICS the current design doe

Re: What's our minimum supported Python version?

2025-04-23 Thread Jelte Fennema-Nio
On Wed, 23 Apr 2025 at 10:59, Devrim Gündüz wrote: > The most notable one would be Psycopg (2 and 3). Plus Patroni > dependencies. There may be a couple of more. I meant more in what ways do these things break? Since you're actually the one that's packaging them, I'd expect that you could make th

Re: [PATCH] dynahash: add memory allocation failure check

2025-04-23 Thread Andrey Borodin
> On 23 Apr 2025, at 13:32, m.korot...@postgrespro.ru wrote: > > I found a case of potential NULL pointer dereference. > In src/backend/utils/hash/dynahash.c in function HTAB *hash_create() the > result of the DynaHashAlloc() is used unsafely. > The function DynaHashAlloc() calls MemoryContext

Re: What's our minimum supported Python version?

2025-04-23 Thread Jelte Fennema-Nio
On Wed, 23 Apr 2025 at 11:13, Devrim Gündüz wrote: > You are right, our side is fixable. However many packages in the > upstream also depend on Psycopg. I don't want to create a Linux > distribution based on RHEL 8 built against Python 3.9 (or 3.1x) :-) I'm confused. The upstream RHEL8 repo depen

Re: jsonapi: scary new warnings with LTO enabled

2025-04-23 Thread Daniel Gustafsson
> On 23 Apr 2025, at 02:01, Jacob Champion > wrote: > On Tue, Apr 22, 2025 at 3:10 AM Daniel Gustafsson wrote: >> The attached >> v3 allocates via the JSON api, no specific error handling should be required >> as >> it's already handled today. > > pgindent shows one whitespace change on my ma

extension_control_path and "directory"

2025-04-23 Thread Christoph Berg
Re: Peter Eisentraut > The new GUC extension_control_path specifies a path to look for > extension control files. The default value is $system, which looks in > the compiled-in location, as before. Is the expectation that this also works for the extension "directory"? semver is still failing bec

[PATCH] dynahash: add memory allocation failure check

2025-04-23 Thread m . korotkov
Hi all, I found a case of potential NULL pointer dereference. In src/backend/utils/hash/dynahash.c in function HTAB *hash_create() the result of the DynaHashAlloc() is used unsafely. The function DynaHashAlloc() calls MemoryContextAllocExtended() with MCXT_ALLOC_NO_OOM and can return a NULL poin

Re: [BUG] temporary file usage report with extended protocol and unnamed portals

2025-04-23 Thread Frédéric Yhuel
On 4/23/25 09:41, Frédéric Yhuel wrote: On 4/22/25 19:37, Sami Imseih wrote: the patch relies on looking up queryDesc->sourceText inside DropPortal, which Tom raised concerns about earlier in the thread [0] Yes, I think I had misunderstood what Tom said. Thank you for pointing that out.

Re: What's our minimum supported Python version?

2025-04-23 Thread Devrim Gündüz
Hi, On Wed, 2025-04-23 at 11:03 +0200, Jelte Fennema-Nio wrote: > > I meant more in what ways do these things break? Since you're actually > the one that's packaging them, I'd expect that you could make them > depend on the python39 package and be mostly done. You are right, our side is fixable.

Re: What's our minimum supported Python version?

2025-04-23 Thread Jelte Fennema-Nio
On Wed, 23 Apr 2025 at 00:33, Jacob Champion wrote: > As long as the need to backport to PG18 doesn't freeze that > conversation in place, I suppose. I'm confused. Are you intending to backport new test infra to PG18? Looking at the amount of python code that we currently have, I agree with Tom:

Re: What's our minimum supported Python version?

2025-04-23 Thread Devrim Gündüz
Hi, On Wed, 2025-04-23 at 10:47 +0200, Jelte Fennema-Nio wrote: > Can you share some examples of the things that break? The most notable one would be Psycopg (2 and 3). Plus Patroni dependencies. There may be a couple of more. Regards, -- Devrim Gündüz Open Source Solution Architect, PostgreSQL

Re: What's our minimum supported Python version?

2025-04-23 Thread Jelte Fennema-Nio
On Wed, 23 Apr 2025 at 10:15, Devrim Gündüz wrote: > I would love to have such an evidence -- but I don't have :) In the last > couple of weeks I've also been thinking of bumping every single Python > piece in the PGDG RPM repository to 3.9 (at least) on RHEL 8, but that > will break many things i

RE: Fix premature xmin advancement during fast forward decoding

2025-04-23 Thread Zhijie Hou (Fujitsu)
On Wed, Apr 23, 2025 at 2:31 PM shveta malik wrote: > > On Tue, Apr 22, 2025 at 12:36 PM Zhijie Hou (Fujitsu) > wrote: > > > > Hi, > > > > To fix this, I think we can allow the base snapshot to be built during fast > > forward decoding, as implemented in the patch 0001 (We already built base > >

Re: What's our minimum supported Python version?

2025-04-23 Thread Devrim Gündüz
Hi, On Tue, 2025-04-22 at 15:33 -0700, Jacob Champion wrote: >  I'm still hopeful that Devrim has some evidence in favor of bumping > to 3.8 or 3.9. :) I would love to have such an evidence -- but I don't have :) In the last couple of weeks I've also been thinking of bumping every single Python p

Avoid core dump in pgstat_read_statsfile()

2025-04-23 Thread Bertrand Drouvot
Hi hackers, please find attached a patch to $SUBJECT. Indeed one could generate a core dump similar to: Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00a7a7a7 in pgstat_init_entry (kind=129, shhashent=0x7a55845cfd98) at pgstat_shmem.c:314 314 chunk = dsa_

Re: [BUG] temporary file usage report with extended protocol and unnamed portals

2025-04-23 Thread Frédéric Yhuel
On 4/22/25 19:37, Sami Imseih wrote: the patch relies on looking up queryDesc->sourceText inside DropPortal, which Tom raised concerns about earlier in the thread [0] Yes, I think I had misunderstood what Tom said. Thank you for pointing that out. However, is it really unsafe? In exec_bi

Re: Add Pipelining support in psql

2025-04-23 Thread Michael Paquier
On Tue, Apr 22, 2025 at 02:37:19PM +0200, Anthonin Bonnefoy wrote: > Also, we still have a triggered assertion failure with the following: > CREATE TABLE psql_pipeline(a text); > \startpipeline > COPY psql_pipeline FROM STDIN; > SELECT 'val1'; > \syncpipeline > \endpipeline > ... > Assertion failed