Re: Document NULL

2024-05-01 Thread Tom Lane
David Rowley writes: > Let's bash it into shape a bit more before going any further on actual > wording. FWIW, I want to push back on the idea of making it a tutorial section. I too considered that, but in the end I think it's a better idea to put it into the "main" docs, for two reasons: 1. I

Re: Document NULL

2024-05-01 Thread David Rowley
On Thu, 2 May 2024 at 03:12, David G. Johnston wrote: > Attached is a very rough draft attempting this, based on my own thoughts and > those expressed by Tom in [1], which largely align with mine. Thanks for picking this up. I agree that we should have something to improve this. It would be

Re: Document NULL

2024-05-01 Thread Kashif Zeeshan
On Wed, May 1, 2024 at 8:12 PM David G. Johnston wrote: > Hi, > > Over in [1] it was rediscovered that our documentation assumes the reader > is familiar with NULL. It seems worthwhile to provide both an introduction > to the topic and an overview of how this special value gets handled >

Re: [PATCH] json_lex_string: don't overread on bad UTF8

2024-05-01 Thread Michael Paquier
On Thu, May 02, 2024 at 11:23:13AM +0900, Michael Paquier wrote: > About the fact that we may finish by printing unfinished UTF-8 > sequences, I'd be curious to hear your thoughts. Now, the information > provided about the partial byte sequences can be also useful for > debugging on top of having

Re: [PATCH] json_lex_string: don't overread on bad UTF8

2024-05-01 Thread Michael Paquier
On Wed, May 01, 2024 at 04:22:24PM -0700, Jacob Champion wrote: > On Tue, Apr 30, 2024 at 11:09 PM Michael Paquier wrote: >> Not sure to like much the fact that this advances token_terminator >> first. Wouldn't it be better to calculate pg_encoding_mblen() first, >> then save token_terminator?

Re: New GUC autovacuum_max_threshold ?

2024-05-01 Thread David Rowley
On Sat, 27 Apr 2024 at 02:13, Robert Haas wrote: > Let's compare the current situation to the situation post-patch with a > cap of 500k. Consider a table 1024 times larger than the one I > mentioned above, so pgbench scale factor 25600, size on disk 320GB. > Currently, that table will be vacuumed

Re: [PATCH] json_lex_string: don't overread on bad UTF8

2024-05-01 Thread Jacob Champion
On Tue, Apr 30, 2024 at 11:09 PM Michael Paquier wrote: > Not sure to like much the fact that this advances token_terminator > first. Wouldn't it be better to calculate pg_encoding_mblen() first, > then save token_terminator? I feel a bit uneasy about saving a value > in token_terminator past

Re: Weird test mixup

2024-05-01 Thread Noah Misch
While writing an injection point test, I encountered a variant of the race condition that f4083c4 fixed. It had three sessions and this sequence of events: s1: local-attach to POINT s2: enter InjectionPointRun(POINT), yield CPU just before injection_callback() s3: detach POINT, deleting the

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-05-01 Thread Dmitry Koval
Hi! 30.04.2024 23:15, Justin Pryzby пишет: Is this issue already fixed ? I wasn't able to reproduce it. Maybe it only happened with earlier patch versions applied ? I think this was fixed in commit [1]. [1]

Re: TLS certificate alternate trust paths issue in libpq - certificate chain validation failing

2024-05-01 Thread Jacob Champion
On Wed, May 1, 2024 at 11:57 AM Thomas Spear wrote: > It does fail to validate for case 4 after all. I must have had a copy/paste > error during past tests. Okay, good. Glad it's behaving as expected! > So then it sounds like putting the MS root in root.crt (as we have done to > fix this) is

Re: Query Discrepancy in Postgres HLL Test

2024-05-01 Thread Robert Haas
On Wed, May 1, 2024 at 1:10 PM Ayush Vatsa wrote: > I'm currently delving into Postgres HLL (HyperLogLog) functionality and have > encountered an unexpected behavior while executing queries from the > "cumulative_add_sparse_edge.sql" regress test. This particular test data file > involves

Re: TLS certificate alternate trust paths issue in libpq - certificate chain validation failing

2024-05-01 Thread Thomas Spear
On Wed, May 1, 2024 at 12:31 PM Jacob Champion < jacob.champ...@enterprisedb.com> wrote: > On Wed, May 1, 2024 at 8:17 AM Thomas Spear wrote: > > Circling back to my original question, why is there a difference in > behavior? > > > > What I believe should be happening isn't what's happening: > >

Re: New GUC autovacuum_max_threshold ?

2024-05-01 Thread Robert Haas
On Wed, May 1, 2024 at 2:19 PM Imseih (AWS), Sami wrote: > > Unless I'm missing something major, that's completely bonkers. It > > might be true that it would be a good idea to vacuum such a table more > > often than we do at present, but there's no shot that we want to do it > > that much more

Re: New GUC autovacuum_max_threshold ?

2024-05-01 Thread Imseih (AWS), Sami
I've been following this discussion and would like to add my 2 cents. > Unless I'm missing something major, that's completely bonkers. It > might be true that it would be a good idea to vacuum such a table more > often than we do at present, but there's no shot that we want to do it > that much

Re: cataloguing NOT NULL constraints

2024-05-01 Thread Alvaro Herrera
On 2024-Apr-25, Alvaro Herrera wrote: > > Also, I've found a weird behaviour with a non-inherited NOT NULL > > constraint for a partitioned table: > > CREATE TABLE pt(a int NOT NULL NO INHERIT) PARTITION BY LIST (a); > Ugh. Maybe a way to handle this is to disallow NO INHERIT in > constraints

Re: TLS certificate alternate trust paths issue in libpq - certificate chain validation failing

2024-05-01 Thread Jacob Champion
On Wed, May 1, 2024 at 8:17 AM Thomas Spear wrote: > Circling back to my original question, why is there a difference in behavior? > > What I believe should be happening isn't what's happening: > 1. If ~/.postgresql/root.crt contains the MS root, and I don't specify > sslrootcert= -- successful

Query Discrepancy in Postgres HLL Test

2024-05-01 Thread Ayush Vatsa
Hi PostgreSQL Community, I'm currently delving into Postgres HLL (HyperLogLog) functionality and have encountered an unexpected behavior while executing queries from the " cumulative_add_sparse_edge.sql

Re: Logging which interface was connected to in log_line_prefix

2024-05-01 Thread Greg Sabino Mullane
Thank you for taking the time to review this. I've attached a new rebased version, which has no significant changes. > There is a comment in the patch that states: > > /* We do not need clean_ipv6_addr here: just report verbatim */ > > I am not quite sure what it means, but I am guessing it

Re: Support tid range scan in parallel?

2024-05-01 Thread Cary Huang
> This isn't a complete review. It's just that this seems enough to keep > you busy for a while. I can look a bit harder when the patch is > working correctly. I think you should have enough feedback to allow > that now. Thanks for the test, review and feedback. They are greatly appreciated!

Proposal for Updating CRC32C with AVX-512 Algorithm.

2024-05-01 Thread Amonson, Paul D
Hi, Comparing the current SSE4.2 implementation of the CRC32C algorithm in Postgres, to an optimized AVX-512 algorithm [0] we observed significant gains. The result was a ~6.6X average multiplier of increased performance measured on 3 different Intel products. Details below. The AVX-512

Re: Document NULL

2024-05-01 Thread Thom Brown
On Wed, May 1, 2024, 16:13 David G. Johnston wrote: > Hi, > > Over in [1] it was rediscovered that our documentation assumes the reader > is familiar with NULL. It seems worthwhile to provide both an introduction > to the topic and an overview of how this special value gets handled > throughout

Re: TLS certificate alternate trust paths issue in libpq - certificate chain validation failing

2024-05-01 Thread Thomas Spear
On Wed, May 1, 2024 at 9:23 AM Jacob Champion < jacob.champ...@enterprisedb.com> wrote: > On Wed, May 1, 2024 at 6:48 AM Thomas Spear wrote: > > I dumped out the certificates presented by the server using openssl, and > the chain that gets output includes "Microsoft Azure RSA TLS Issuing CA 08".

Document NULL

2024-05-01 Thread David G. Johnston
Hi, Over in [1] it was rediscovered that our documentation assumes the reader is familiar with NULL. It seems worthwhile to provide both an introduction to the topic and an overview of how this special value gets handled throughout the system. Attached is a very rough draft attempting this,

Re: TLS certificate alternate trust paths issue in libpq - certificate chain validation failing

2024-05-01 Thread Jacob Champion
On Wed, May 1, 2024 at 6:48 AM Thomas Spear wrote: > I dumped out the certificates presented by the server using openssl, and the > chain that gets output includes "Microsoft Azure RSA TLS Issuing CA 08". > On https://www.microsoft.com/pkiops/docs/repository.htm the page says that > that cert

Re: TLS certificate alternate trust paths issue in libpq - certificate chain validation failing

2024-05-01 Thread Thomas Spear
On Tue, Apr 30, 2024 at 5:19 PM Jacob Champion < jacob.champ...@enterprisedb.com> wrote: On Tue, Apr 30, 2024 at 2:41 PM Thomas Spear wrote: > The full details can be found at github.com/pgjdbc/pgjdbc/discussions/3236 - in summary, both jdbc-postgres and the psql cli seem to be affected by an

Re: Refactoring backend fork+exec code

2024-05-01 Thread Anton A. Melnikov
On 28.04.2024 22:36, Heikki Linnakangas wrote: Peter E noticed and Michael fixed them in commit 768ceeeaa1 already. Didn't check that is already fixed in the current master. Sorry! Thanks for pointing this out! With the best wishes, -- Anton A. Melnikov Postgres Professional:

Re: Removing unneeded self joins

2024-05-01 Thread Alexander Korotkov
On Wed, May 1, 2024 at 2:00 PM Alexander Lakhin wrote: > 30.04.2024 13:20, Alexander Korotkov wrote: > > On Tue, Apr 30, 2024 at 9:00 AM Alexander Lakhin > > wrote: > >> I've discovered another failure, introduced by d3d55ce57. > >> Please try the following: > >> CREATE TABLE t (a int unique, b

Re: SQL:2011 application time

2024-05-01 Thread jian he
On Wed, May 1, 2024 at 12:39 AM Paul Jungwirth wrote: > > On 4/30/24 09:24, Robert Haas wrote: > > Peter, could you have a look at > > http://postgr.es/m/47550967-260b-4180-9791-b224859fe...@illuminatedcomputing.com > > and express an opinion about whether each of those proposals are (a) > > good

Re: Removing unneeded self joins

2024-05-01 Thread Alexander Lakhin
30.04.2024 13:20, Alexander Korotkov wrote: On Tue, Apr 30, 2024 at 9:00 AM Alexander Lakhin wrote: I've discovered another failure, introduced by d3d55ce57. Please try the following: CREATE TABLE t (a int unique, b float); SELECT * FROM t NATURAL JOIN LATERAL (SELECT * FROM t t2

Re: Control flow in logical replication walsender

2024-05-01 Thread Ashutosh Bapat
On Tue, Apr 30, 2024 at 11:28 PM Christophe Pettus wrote: > > Hi, > > I wanted to check my understanding of how control flows in a walsender > doing logical replication. My understanding is that the (single) thread in > each walsender process, in the simplest case, loops on: > > 1. Pull a

Re: Support tid range scan in parallel?

2024-05-01 Thread David Rowley
On Wed, 1 May 2024 at 07:10, Cary Huang wrote: > Yes of course. These numbers were obtained earlier this year on master with > the patch applied most likely without the read stream code you mentioned. The > patch attached here is rebased to commit > dd0183469bb779247c96e86c2272dca7ff4ec9e7 on

Re: [PoC] Improve dead tuple storage for lazy vacuum

2024-05-01 Thread John Naylor
On Thu, Apr 25, 2024 at 8:36 AM Masahiko Sawada wrote: > > On Mon, Apr 15, 2024 at 6:12 PM John Naylor wrote: > > - RT_KEY_GET_SHIFT is not covered for key=0: > > > > https://anarazel.de/postgres/cov/16-vs-HEAD-2024-04-14/src/include/lib/radixtree.h.gcov.html#L803 > > > > That should be fairly

Re: [PATCH] json_lex_string: don't overread on bad UTF8

2024-05-01 Thread Michael Paquier
On Tue, Apr 30, 2024 at 10:39:04AM -0700, Jacob Champion wrote: > When json_lex_string() hits certain types of invalid input, it calls > pg_encoding_mblen_bounded(), which assumes that its input is > null-terminated and calls strnlen(). But the JSON lexer is constructed > with an explicit string