Re: Fix overflow hazard in timestamp_pl_interval

2024-04-27 Thread Joseph Koshakow
Hi all, Immediately after sending this I realized that timestamptz suffers from the same problem. Attached is an updated patch that fixes timestamptz too. Thanks, Joe Koshakow On Sat, Apr 27, 2024 at 10:59 PM Joseph Koshakow wrote: > Hi all, > > Attached is a patch that fixes some

Fix overflow hazard in timestamp_pl_interval

2024-04-27 Thread Joseph Koshakow
Hi all, Attached is a patch that fixes some overflow/underflow hazards in `timestamp_pl_interval`. The microseconds overflow could produce incorrect result. The month overflow would generally still result in an error from the timestamp month field being too low, but it's still better to catch it

Re: a wrong index choose when statistics is out of date

2024-04-27 Thread Andy Fan
Andy Fan writes: > Hello everyone, > >> After some more thoughts about the diference of the two ideas, then I >> find we are resolving two different issues, just that in the wrong index >> choose cases, both of them should work generally. > > Here is the formal version for the attribute

Re: using extended statistics to improve join estimates

2024-04-27 Thread Andy Fan
Hello Justin! Justin Pryzby writes: > |../src/backend/statistics/extended_stats.c:3151:36: warning: ‘relid’ may be > used uninitialized [-Wmaybe-uninitialized] > | 3151 | if (var->varno != relid) > | |^ >

Re: query_id, pg_stat_activity, extended query protocol

2024-04-27 Thread Andrei Lepikhov
On 27/4/2024 20:54, Imseih (AWS), Sami wrote: But simplistic case with a prepared statement shows how the value of queryId can be changed if you don't acquire all the objects needed for the execution: CREATE TABLE test(); PREPARE name AS SELECT * FROM test; EXPLAIN (ANALYSE, VERBOSE, COSTS

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-27 Thread Alexander Korotkov
Hi Justin, Thank you for your review. Please check v9 of the patchset [1]. On Wed, Apr 24, 2024 at 11:26 PM Justin Pryzby wrote: > This patch also/already fixes the schema issue I reported. Thanks. > > If you wanted to include a test case for that: > > begin; > CREATE SCHEMA s; > CREATE

Re: New committers: Melanie Plageman, Richard Guo

2024-04-27 Thread Andy Fan
"Jonathan S. Katz" writes: > [[PGP Signed Part:Undecided]] > The Core Team would like to extend our congratulations to Melanie > Plageman and Richard Guo, who have accepted invitations to become our > newest PostgreSQL committers. > > Please join us in wishing them much success and few

Re: DROP OWNED BY fails to clean out pg_init_privs grants

2024-04-27 Thread Tom Lane
I wrote: > A bigger problem though is that I think you are addressing the > original complaint from the older thread, which while it's a fine > thing to fix seems orthogonal to the failure we're seeing in the > buildfarm. The buildfarm's problem is not that we're recording > incorrect

Re: query_id, pg_stat_activity, extended query protocol

2024-04-27 Thread Imseih (AWS), Sami
>> But simplistic case with a prepared statement shows how the value of >> queryId can be changed if you don't acquire all the objects needed for >> the execution: >> CREATE TABLE test(); >> PREPARE name AS SELECT * FROM test; >> EXPLAIN (ANALYSE, VERBOSE, COSTS OFF) EXECUTE name; >> DROP

Re: Cutting support for OpenSSL 1.0.1 and 1.0.2 in 17~?

2024-04-27 Thread Daniel Gustafsson
> On 27 Apr 2024, at 20:32, Daniel Gustafsson wrote: > That's a good point, there is potential for more code removal here. The > attached 0001 takes a stab at it while it's fresh in mind, I'll revisit before > the July CF to see if there is more that can be done. ..and again with the

Re: Cutting support for OpenSSL 1.0.1 and 1.0.2 in 17~?

2024-04-27 Thread Daniel Gustafsson
> On 25 Apr 2024, at 05:49, Michael Paquier wrote: > > On Wed, Apr 24, 2024 at 01:31:12PM +0200, Daniel Gustafsson wrote: >> Done. Attached are the two remaining patches, rebased over HEAD, for >> removing >> support for OpenSSL 1.0.2 in v18. Parking them in the commitfest for now. > > You

Re: Read table rows in chunks

2024-04-27 Thread David G. Johnston
On Sat, Apr 27, 2024 at 12:47 AM Sushrut Shivaswamy < sushrut.shivasw...@gmail.com> wrote: > > I"m trying to read the rows of a table in chunks to process them in a > background worker. > This list really isn't the place for this kind of discussion. You are doing application-level stuff, not

Re: Read table rows in chunks

2024-04-27 Thread Kashif Zeeshan
Hi You can also use the following approaches. 1. Cursors 2. FETCH with OFFSET clause Regards Kashif Zeeshan Bitnine Global On Sat, Apr 27, 2024 at 12:47 PM Sushrut Shivaswamy < sushrut.shivasw...@gmail.com> wrote: > Hey, > > I"m trying to read the rows of a table in chunks to process them in

Re: Background Processes in Postgres Extension

2024-04-27 Thread Sushrut Shivaswamy
Thanks for the suggestion on using postgres background worker. I tried creating one following the implementation in worker_spi and am able to spawn a background worker successfully. However, the background worker seems to cause postmaster to crash when I wait for it to finish using

Re: Help update PostgreSQL 13.12 to 13.14

2024-04-27 Thread Kashif Zeeshan
Glad to be of help. pg_uprade is used with major version upgrade e.g. from PG13 to 14 etc Regards Kashif Zeeshan Bitnine Global On Fri, Apr 26, 2024 at 10:47 PM •Isaac Rv wrote: > Hola, lo acabo de hacer, quedó bien luego detuve el servidor, aplique otra > vez el sudo yum update postgresql13

Re: add tab-complete for memory, serialize option and other minor issues.

2024-04-27 Thread Tom Lane
jian he writes: > to make tab-complete work, comma, must be followed with a white space, > not sure why. https://www.postgresql.org/message-id/3870833.1712696581%40sss.pgh.pa.us Post-feature-freeze is no time to be messing with behavior as basic as WORD_BREAKS, though.

Re: partitioning and identity column

2024-04-27 Thread Alexander Lakhin
Hello Ashutosh, 26.04.2024 21:00, Alexander Lakhin wrote: 26.04.2024 15:57, Ashutosh Bapat wrote: Thanks Alexander for the report. On Fri, Apr 26, 2024 at 5:30 PM Alexander Lakhin wrote: CREATE TABLE tbl3 (LIKE tbl2 INCLUDING IDENTITY); ERROR:  no owned sequence found Do you

Re: query_id, pg_stat_activity, extended query protocol

2024-04-27 Thread Imseih (AWS), Sami
> We choose a arguably more user-friendly option: > https://www.postgresql.org/docs/current/sql-prepare.html Thanks for pointing this out! Regards, Sami

Re: query_id, pg_stat_activity, extended query protocol

2024-04-27 Thread David G. Johnston
On Sat, Apr 27, 2024 at 6:55 AM Imseih (AWS), Sami wrote: > > Hmm, you raise a good point. Isn't this a fundamental problem > with prepared statements? If there is DDL on the > relations of the prepared statement query, shouldn't the prepared > statement be considered invalid at that point and

Re: query_id, pg_stat_activity, extended query protocol

2024-04-27 Thread Imseih (AWS), Sami
> But simplistic case with a prepared statement shows how the value of > queryId can be changed if you don't acquire all the objects needed for > the execution: > CREATE TABLE test(); > PREPARE name AS SELECT * FROM test; > EXPLAIN (ANALYSE, VERBOSE, COSTS OFF) EXECUTE name; > DROP TABLE test; >

Re: New committers: Melanie Plageman, Richard Guo

2024-04-27 Thread Masahiko Sawada
On Fri, Apr 26, 2024 at 8:54 PM Jonathan S. Katz wrote: > > The Core Team would like to extend our congratulations to Melanie > Plageman and Richard Guo, who have accepted invitations to become our > newest PostgreSQL committers. > > Please join us in wishing them much success and few reverts! >

Re: pgsql: psql: add an optional execution-count limit to \watch.

2024-04-27 Thread Andrew Dunstan
On 2023-04-07 Fr 10:00, Tom Lane wrote: Alexander Korotkov writes: On Thu, Apr 6, 2023 at 8:18 PM Tom Lane wrote: psql: add an optional execution-count limit to \watch. This commit makes tests fail for me. psql parses 'i' option of '\watch' using locale-aware strtod(), but 001_basic.pl

Re: Use XLOG_CONTROL_FILE macro everywhere?

2024-04-27 Thread Peter Eisentraut
On 26.04.24 22:51, Tom Lane wrote: Robert Haas writes: On Wed, Apr 24, 2024 at 8:04 PM Michael Paquier wrote: Not sure that I would bother with a second one. But, well, why not if people want to rename it, as long as you keep compatibility. I vote for just standardizing on

Re: Refactoring backend fork+exec code

2024-04-27 Thread Anton A. Melnikov
Hello! Maybe add PGDLLIMPORT to extern bool LoadedSSL; and extern struct ClientSocket *MyClientSocket; definitions in the src/include/postmaster/postmaster.h ? With the best regards, -- Anton A. Melnikov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Read table rows in chunks

2024-04-27 Thread Sushrut Shivaswamy
Hey, I"m trying to read the rows of a table in chunks to process them in a background worker. I want to ensure that each row is processed only once. I was thinking of using the `SELECT * ... OFFSET {offset_size} LIMIT {limit_size}` functionality for this but I"m running into issues. Some

Re: cpluspluscheck/headerscheck require build in REL_16_STABLE

2024-04-27 Thread Marina Polyakova
On 2024-04-27 09:14, John Naylor wrote: On Wed, Apr 17, 2024 at 7:21 AM John Naylor wrote: On Mon, Apr 15, 2024 at 9:20 PM Marina Polyakova wrote: > Everything seems to work with this patch, thank you! Glad to hear it -- I'll push next week when I get back from vacation, unless there are

Re: New committers: Melanie Plageman, Richard Guo

2024-04-27 Thread Kashif Zeeshan
Congratulations! On Sat, Apr 27, 2024 at 11:34 AM Andrey M. Borodin wrote: > > > > On 26 Apr 2024, at 16:54, Jonathan S. Katz wrote: > > > > The Core Team would like to extend our congratulations to Melanie > Plageman and Richard Guo, who have accepted invitations to become our > newest

Re: New committers: Melanie Plageman, Richard Guo

2024-04-27 Thread Andrey M. Borodin
> On 26 Apr 2024, at 16:54, Jonathan S. Katz wrote: > > The Core Team would like to extend our congratulations to Melanie Plageman > and Richard Guo, who have accepted invitations to become our newest > PostgreSQL committers. > > Please join us in wishing them much success and few reverts!

Re: cpluspluscheck/headerscheck require build in REL_16_STABLE

2024-04-27 Thread John Naylor
On Wed, Apr 17, 2024 at 7:21 AM John Naylor wrote: > > On Mon, Apr 15, 2024 at 9:20 PM Marina Polyakova > wrote: > > Everything seems to work with this patch, thank you! > > Glad to hear it -- I'll push next week when I get back from vacation, > unless there are objections. Pushed, thanks for