Re: null iv parameter passed to combo_init()

2022-01-08 Thread Tom Lane
Noah Misch writes: > On further thought, I would write it this way: > - else > + else if (ivlen != 0) > memcpy(ivbuf, iv, ivlen); FWIW, I liked the "ivlen > 0" formulation better. They should be equivalent, because ivlen is unsigned, but it just

Re: null iv parameter passed to combo_init()

2022-01-08 Thread Zhihong Yu
On Sat, Jan 8, 2022 at 7:11 PM Noah Misch wrote: > On Sat, Jan 08, 2022 at 06:52:14PM -0800, Zhihong Yu wrote: > > On Sat, Jan 8, 2022 at 5:52 PM Noah Misch wrote: > > > On Fri, Jan 07, 2022 at 04:32:01PM -0800, Zhihong Yu wrote: > > > > I agree it's time to fix cases like this, given > > >

Re: null iv parameter passed to combo_init()

2022-01-08 Thread Noah Misch
On Sat, Jan 08, 2022 at 06:52:14PM -0800, Zhihong Yu wrote: > On Sat, Jan 8, 2022 at 5:52 PM Noah Misch wrote: > > On Fri, Jan 07, 2022 at 04:32:01PM -0800, Zhihong Yu wrote: > > I agree it's time to fix cases like this, given > >

Re: Logging replication state changes

2022-01-08 Thread Euler Taveira
On Sat, Jan 8, 2022, at 6:29 PM, SATYANARAYANA NARLAPURAM wrote: > We need the historical information to analyze and root cause in addition to > the live debugging. It would be good to have better control over replication > messages. I think the answer to this demand is not to change the

Re: null iv parameter passed to combo_init()

2022-01-08 Thread Zhihong Yu
On Sat, Jan 8, 2022 at 5:52 PM Noah Misch wrote: > On Fri, Jan 07, 2022 at 04:32:01PM -0800, Zhihong Yu wrote: > > In contrib/pgcrypto/pgcrypto.c : > > > > err = px_combo_init(c, (uint8 *) VARDATA_ANY(key), klen, NULL, 0); > > > > Note: NULL is passed as iv. > > > > When combo_init() is

Re: null iv parameter passed to combo_init()

2022-01-08 Thread Noah Misch
On Fri, Jan 07, 2022 at 04:32:01PM -0800, Zhihong Yu wrote: > In contrib/pgcrypto/pgcrypto.c : > > err = px_combo_init(c, (uint8 *) VARDATA_ANY(key), klen, NULL, 0); > > Note: NULL is passed as iv. > > When combo_init() is called, > > if (ivlen > ivs) > memcpy(ivbuf,

Re: Why is src/test/modules/committs/t/002_standby.pl flaky?

2022-01-08 Thread Tom Lane
I wrote: > So for some reason, on these machines detection of walsender-initiated > connection close is unreliable ... or maybe, the walsender didn't close > the connection, but is somehow still hanging around? Don't have much idea > where to dig beyond that, but maybe someone else will. I

Re: Multiple Query IDs for a rewritten parse tree

2022-01-08 Thread Tom Lane
Andrey Lepikhov writes: > On 5/1/2022 10:13, Tom Lane wrote: >>> I feel like we need to get away from the idea that there is just >>> one query hash, and somehow let different extensions attach >>> differently-calculated hashes to a query. I don't have any immediate >>> ideas about how to do

Re: Why is src/test/modules/committs/t/002_standby.pl flaky?

2022-01-08 Thread Tom Lane
Andrew Dunstan writes: > On 12/30/21 15:01, Thomas Munro wrote: >> There's a wait for replay that is open coded (instead of using the >> wait_for_catchup() routine), and sometimes the second of two such >> waits at line 51 (in master) times out after 3 minutes with "standby >> never caught up".

Re: Disallow quorum uncommitted (with synchronous standbys) txns in logical replication subscribers

2022-01-08 Thread SATYANARAYANA NARLAPURAM
On Fri, Jan 7, 2022 at 4:52 PM Jeff Davis wrote: > On Fri, 2022-01-07 at 14:54 -0800, Andres Freund wrote: > > > If you only promote the furthest-ahead sync replica (which is what > > > you > > > should be doing if you have quorum commit), why wouldn't that work? > > > > Remove "sync" from the

Re: warn if GUC set to an invalid shared library

2022-01-08 Thread Justin Pryzby
On Sat, Jan 08, 2022 at 01:29:24PM -0800, Maciek Sakrejda wrote: > Thanks for working on this! I tried it out and it worked for me. I > reviewed the patch and didn't see any problems, but I'm not much of a > C programmer. Thanks for looking at it. I was just hacking on it myself. Unfortunately,

Re: warn if GUC set to an invalid shared library

2022-01-08 Thread Maciek Sakrejda
On Thu, Dec 30, 2021 at 12:21 AM Bharath Rupireddy wrote: > Overall the idea looks good to me. A warning on ALTER SYSTEM SET seems > reasonable than nothing. ERROR isn't the way to go as it limits the > users of setting the extensions in shared_preload_libraries first, > installing them later. Is

Re: Logging replication state changes

2022-01-08 Thread SATYANARAYANA NARLAPURAM
On Sat, Jan 8, 2022 at 3:26 AM Amit Kapila wrote: > On Thu, Dec 30, 2021 at 4:18 AM SATYANARAYANA NARLAPURAM > wrote: > > > > On Wed, Dec 29, 2021 at 2:04 PM Tom Lane wrote: > >> > >> SATYANARAYANA NARLAPURAM writes: > >> > I noticed that below critical replication state changes are DEBUG1 >

Re: warn if GUC set to an invalid shared library

2022-01-08 Thread Maciek Sakrejda
Thanks for working on this! I tried it out and it worked for me. I reviewed the patch and didn't see any problems, but I'm not much of a C programmer. On Tue, Dec 28, 2021 at 9:45 AM Justin Pryzby wrote: > 0002 adds context when failing to start. > > 2021-12-27 17:01:12.996 CST

Re: \dP and \dX use ::regclass without "pg_catalog."

2022-01-08 Thread Tom Lane
=?utf-8?Q?=C3=81lvaro?= Herrera writes: > My point is that it's good to have it, but it would be much better to > have something bulletproof, which we could use in an automated check > somewhere (next to stuff like perlcritic, perhaps). I don't know what, > though. Meh ... this is mostly

Multiple Query IDs for a rewritten parse tree

2022-01-08 Thread Andrey Lepikhov
On 5/1/2022 10:13, Tom Lane wrote: > I feel like we need to get away from the idea that there is just > one query hash, and somehow let different extensions attach > differently-calculated hashes to a query. I don't have any immediate > ideas about how to do that in a reasonably inexpensive way.

Re: CLUSTER on partitioned index

2022-01-08 Thread Justin Pryzby
On Fri, Dec 03, 2021 at 10:16:24AM +0900, Michael Paquier wrote: > On Thu, Sep 23, 2021 at 06:56:26PM -0500, Justin Pryzby wrote: > > On Thu, Sep 23, 2021 at 08:18:41PM +0200, Matthias van de Meent wrote: > >> Note: The following review is based on the assumption that this v11 > >> revision was

Re: \dP and \dX use ::regclass without "pg_catalog."

2022-01-08 Thread Álvaro Herrera
On 2022-Jan-08, Michael Paquier wrote: > The detection regex posted upthread is kind of cool. Yes, but it's not bulletproof -- it only detects uses of some unqualified object name that is also used with qualification. Here it detected "text" unqualified, but only because we already had

Re: [feature request] ts_headline should have an option to highlight only full matches of <-> expressions

2022-01-08 Thread Jake North
8 Jan 2022, 20:09 by j...@tuta.io: > Hi, > > I am using Postgres' full text search since some time now and overall it's > working really well for me. However one issue I have is that ts_headline > highlights partial matches of FOLLOWED BY (<->) expressions, e.g. > > SELECT ts_headline('some

Re: [PATCH] reduce page overlap of GiST indexes built using sorted method

2022-01-08 Thread Aliaksandr Kalenik
After further testing, here is v2 where the issue that rightlink can be set when an index page is already flushed is fixed. On Sat, Dec 25, 2021 at 4:35 PM Andrey Borodin wrote: > > Hi Aliaksandr! > > Thanks for working on this! > > > Benchmark summary: > > > > create index roads_rdr_idx on

[feature request] ts_headline should have an option to highlight only full matches of <-> expressions

2022-01-08 Thread Jake North
Hi, I am using Postgres' full text search since some time now and overall it's working really well for me. However one issue I have is that ts_headline highlights partial matches of FOLLOWED BY (<->) expressions, e.g. SELECT ts_headline('some words and some more words',

Re: Index-only scan for btree_gist turns bpchar to char

2022-01-08 Thread Tom Lane
Alexander Lakhin writes: > (Unfortunately for me) I found no anomalies related to gbt_text_same() > with an index created with the previous implementation. I've added > diagnostic logging that shows when gbt_text_same() returns 0 for keys > that are the equal but have different padding. So I've

Re: Index-only scan for btree_gist turns bpchar to char

2022-01-08 Thread Alexander Lakhin
07.01.2022 12:00, Alexander Lakhin wrote: > Hello, > 07.01.2022 09:26, Japin Li wrote: >> On Fri, 07 Jan 2022 at 03:21, Tom Lane wrote: >> >> In any case, if we do need same() to implement the identical >> behavior to bpchareq(), then the other solution isn't sufficient >> either. >> >> So in

Re: pg_upgrade should truncate/remove its logs before running

2022-01-08 Thread Justin Pryzby
The cfbot was failing under windows: | [22:07:02.159] could not create directory "pg_upgrade_output.d": File exists It's because parseCommandLine() was called before get_restricted_token(), which re-executes the process, and runs parseCommandLine again. parseCommandLine already does stuff like

Re: psql - add SHOW_ALL_RESULTS option

2022-01-08 Thread Fabien COELHO
Hello Peter, quite weird and confusing. Maybe this type of test should be done in the TAP framework instead. Attached v13 where the crash test is moved to tap. -- Fabien.diff --git a/contrib/pg_stat_statements/expected/pg_stat_statements.out

Re: Non-superuser subscription owners

2022-01-08 Thread Tom Lane
... btw, I'd like to complain that this new test script consumes a completely excessive amount of time. On my fairly-new primary workstation: [12:48:00] t/027_nosuperuser.pl ... ok22146 ms ( 0.02 usr 0.00 sys + 1.12 cusr 0.95 csys = 2.09 CPU) The previously-slowest script

Re: Non-superuser subscription owners

2022-01-08 Thread Tom Lane
Jeff Davis writes: > I'm not sure I follow the reasoning. Are you saying that, to logically > replay a simple DELETE, the subscription owner should have SELECT > privileges on the destination table? We consider that DELETE WHERE requires SELECT privilege on the column(s) read by the . I

Re: Non-superuser subscription owners

2022-01-08 Thread Jeff Davis
On Sat, 2022-01-08 at 15:35 +0530, Amit Kapila wrote: > On Sat, Jan 8, 2022 at 1:01 PM Jeff Davis wrote: > > > > On Sat, 2022-01-08 at 12:27 +0530, Amit Kapila wrote: > > > For Update/Delete, we do read the table first via > > > FindReplTupleInLocalRel(), so is there a need to check ACL_SELECT >

Re: Logging replication state changes

2022-01-08 Thread Amit Kapila
On Thu, Dec 30, 2021 at 4:18 AM SATYANARAYANA NARLAPURAM wrote: > > On Wed, Dec 29, 2021 at 2:04 PM Tom Lane wrote: >> >> SATYANARAYANA NARLAPURAM writes: >> > I noticed that below critical replication state changes are DEBUG1 level >> > logged. Any concern about changing the below two messages

Re: Non-superuser subscription owners

2022-01-08 Thread Amit Kapila
On Sat, Jan 8, 2022 at 1:01 PM Jeff Davis wrote: > > On Sat, 2022-01-08 at 12:27 +0530, Amit Kapila wrote: > > For Update/Delete, we do read the table first via > > FindReplTupleInLocalRel(), so is there a need to check ACL_SELECT > > before that? > > If it's logically an update/delete, then I

Re: Add 64-bit XIDs into PostgreSQL 15

2022-01-08 Thread Maxim Orlov
> Is there any documentation or README explaining this whole 64-bit XID > mechanism? > There is none, unfortunately. I would come back to this later. > Could you tell me what happens if new tuple with XID larger than xid_base > + 0x is inserted into the page? Such new tuple is not

Re: Add 64-bit XIDs into PostgreSQL 15

2022-01-08 Thread Maxim Orlov
> >Perhaps we can merge some of the code cleanup that it contained, such > as using XID_FMT everywhere and creating a type for the kind of page > returned by TransactionIdToPage() to make the code cleaner. > Agree, I think this is a good idea. > Is your patch functionally the same as