RE: Logical replication timeout problem

2022-04-28 Thread wangw.f...@fujitsu.com
On Thur, Apr 28, 2022 at 6:26 PM Amit Kapila wrote: > On Thu, Apr 21, 2022 at 3:21 PM wangw.f...@fujitsu.com > wrote: > > > > I think it is better to keep the new variable 'end_xact' at the end of > the struct where it belongs for HEAD. In back branches, we can keep it > at the place as you have

Re: pgsql: Add contrib/pg_walinspect.

2022-04-28 Thread Bharath Rupireddy
On Thu, Apr 28, 2022 at 8:41 AM Jeff Davis wrote: > > On Thu, 2022-04-28 at 12:11 +1200, Thomas Munro wrote: > > > > Another option might be to abandon this whole no-wait concept and > > revert 2258e76f's changes to xlogutils.c. pg_walinspect already does > > preliminary checks that LSNs are in r

Re: bogus: logical replication rows/cols combinations

2022-04-28 Thread Amit Kapila
On Thu, Apr 28, 2022 at 5:56 PM Peter Eisentraut wrote: > > On 27.04.22 12:33, Amit Kapila wrote: > > Currently, when the subscription has multiple publications, we combine > > the objects, and actions of those publications. It happens for > > 'publish_via_partition_root', publication actions, tab

Re: bogus: logical replication rows/cols combinations

2022-04-28 Thread Amit Kapila
On Thu, Apr 28, 2022 at 11:00 PM Tomas Vondra wrote: > > On 4/28/22 14:26, Peter Eisentraut wrote: > > On 27.04.22 12:33, Amit Kapila wrote: > > > > I wonder how we handle the combination of > > > > pub1: publish=insert WHERE (foo) > > pub2: publish=update WHERE (bar) > > > > I think it would be i

Re: Multi-Master Logical Replication

2022-04-28 Thread Yura Sokolov
В Чт, 28/04/2022 в 17:37 +0530, vignesh C пишет: > On Thu, Apr 28, 2022 at 4:24 PM Yura Sokolov wrote: > > В Чт, 28/04/2022 в 09:49 +1000, Peter Smith пишет: > > > > > 1.1 ADVANTAGES OF MMLR > > > > > > - Increases write scalability (e.g., all nodes can write arbitrary data). > > > > I've never

Re: Handle infinite recursion in logical replication setup

2022-04-28 Thread Peter Smith
Here are my review comments for the v11* patches. == v11-0001 - no more comments. LGTM == V11-0002 1. doc/src/sgml/logical-replication.sgml + + Bidirectional replication is useful in creating multi master database + which helps in performing read/write operations from any o

RE: Perform streaming logical transactions by background workers and parallel apply

2022-04-28 Thread houzj.f...@fujitsu.com
On Monday, April 25, 2022 4:35 PM houzj.f...@fujitsu.com wrote: > On Friday, April 22, 2022 12:12 PM Peter Smith > wrote: > > > > Hello Hou-san. Here are my review comments for v4-0001. Sorry, there > > are so many of them (it is a big patch); some are trivial, and others > > you might easily di

Re: Re: fix cost subqueryscan wrong parallel cost

2022-04-28 Thread David G. Johnston
On Thu, Apr 28, 2022 at 9:53 AM Robert Haas wrote: > On Fri, Apr 22, 2022 at 11:55 AM David G. Johnston > wrote: > > On Wed, Apr 20, 2022 at 11:38 PM bu...@sohu.com wrote: > >> > >> > > for now fuction cost_subqueryscan always using *total* rows even > parallel > >> > > path. like this: > >> >

Re: Missing can't-assign-to-constant checks in plpgsql

2022-04-28 Thread Pavel Stehule
čt 28. 4. 2022 v 23:52 odesílatel Tom Lane napsal: > I happened to notice that there are a couple of places in plpgsql > that will let you assign a new value to a variable that's marked > CONSTANT: > > * We don't complain if an output parameter in a CALL statement > is constant. > > * We don't co

Missing can't-assign-to-constant checks in plpgsql

2022-04-28 Thread Tom Lane
I happened to notice that there are a couple of places in plpgsql that will let you assign a new value to a variable that's marked CONSTANT: * We don't complain if an output parameter in a CALL statement is constant. * We don't complain if a refcursor variable is constant, even though OPEN may as

Re: json_object returning jsonb reuslt different from returning json, returning text

2022-04-28 Thread Andrew Dunstan
On 2022-04-25 Mo 10:14, Andrew Dunstan wrote: > On 2022-04-25 Mo 01:19, alias wrote: >> seems it's a bug around value 0. >> >> SELECT JSON_OBJECTAGG(k: v ABSENT ON NULL WITH UNIQUE KEYS RETURNING >> jsonb) >> FROM (VALUES (1, 1), (10, NULL),(4, null), (5, null),(6, null),(2, 2)) >> foo(k, v); >>

Re: bogus: logical replication rows/cols combinations

2022-04-28 Thread Tomas Vondra
On 4/28/22 14:26, Peter Eisentraut wrote: > On 27.04.22 12:33, Amit Kapila wrote: >> Currently, when the subscription has multiple publications, we combine >> the objects, and actions of those publications. It happens for >> 'publish_via_partition_root', publication actions, tables, column >> lists

Re: Handle infinite recursion in logical replication setup

2022-04-28 Thread vignesh C
On Thu, Apr 28, 2022 at 7:57 AM Peter Smith wrote: > > Here are my review comments for v10-0002 (TAP tests part only) > > FIle: src/test/subscription/t/032_localonly.pl > > == > > 1. > > +# Detach node C and clean the table contents. > +sub detach_node_clean_table_data > +{ > > 1a. Maybe say "

Re: Re: fix cost subqueryscan wrong parallel cost

2022-04-28 Thread Robert Haas
On Fri, Apr 22, 2022 at 11:55 AM David G. Johnston wrote: > On Wed, Apr 20, 2022 at 11:38 PM bu...@sohu.com wrote: >> >> > > for now fuction cost_subqueryscan always using *total* rows even parallel >> > > path. like this: >> > > >> > > Gather (rows=3) >> > > Workers Planned: 2 >> > > ->

[PATCH] Completed unaccent dictionary with many missing characters

2022-04-28 Thread Przemysław Sztoch
Current unnaccent dictionary does not include many popular numeric symbols, in example: "m²" -> "m2" -- Przemysław Sztoch | Mobile +48 509 99 00 66 diff --git a/contrib/unaccent/generate_unaccent_rules.py b/contrib/unaccent/generate_unaccent_rules.py index c405e231b3..a1a1a65112 100644 --- a/con

Re: Unstable tests for recovery conflict handling

2022-04-28 Thread Mark Dilger
> On Apr 27, 2022, at 6:26 PM, Andres Freund wrote: > > I'm a bit confused - what's the relation of that failure to this thread / the > tests / this commit? None, upon further reflection. It turned out to be unrelated. Sorry for the noise. — Mark Dilger EnterpriseDB: http://www.enterprise

Re: bogus: logical replication rows/cols combinations

2022-04-28 Thread Tomas Vondra
On 4/28/22 05:17, Amit Kapila wrote: > On Thu, Apr 28, 2022 at 3:26 AM Tomas Vondra > wrote: >> >> so I've been looking at tweaking the code so that the behavior matches >> Alvaro's expectations. It passes check-world but I'm not claiming it's >> nowhere near commitable - the purpose is mostly t

Re: json_query - redundant result

2022-04-28 Thread Andrew Dunstan
On 2022-04-28 Th 10:06, Pavel Stehule wrote: > > > čt 28. 4. 2022 v 16:00 odesílatel Tom Lane napsal: > > Andrew Dunstan writes: > > On 2022-04-28 Th 04:16, Pavel Stehule wrote: > >> Is this result correct? I am expecting just [10, 30] > > > It's just a wrapper around jsonb_path

Re: Dump/Restore of non-default PKs

2022-04-28 Thread Peter Eisentraut
On 22.04.22 16:14, Tom Lane wrote: That analogy would be compelling if exclusion constraints were a SQL-standard feature; but they aren't so their clause syntax is fully under our control. The scenario that worries me is that somewhere down the pike, the SQL committee might extend the syntax of

Re: json_query - redundant result

2022-04-28 Thread Pavel Stehule
čt 28. 4. 2022 v 16:00 odesílatel Tom Lane napsal: > Andrew Dunstan writes: > > On 2022-04-28 Th 04:16, Pavel Stehule wrote: > >> Is this result correct? I am expecting just [10, 30] > > > It's just a wrapper around jsonb_path_query, which hasn't changed. > > > # SELECT jsonb_path_query(jsonb '[

Re: json_query - redundant result

2022-04-28 Thread Tom Lane
Andrew Dunstan writes: > On 2022-04-28 Th 04:16, Pavel Stehule wrote: >> Is this result correct? I am expecting just [10, 30] > It's just a wrapper around jsonb_path_query, which hasn't changed. > # SELECT jsonb_path_query(jsonb '[{"a":10, "b": 20}, {"a": 30, > "b":100}]', '$.**.a'); >  jsonb_pa

Re: src / test / regress / sql / triggers.sql first 10 lines.

2022-04-28 Thread Tom Lane
alias writes: > Now I am not sure what the first 10 lines mean. Those are computing the file pathnames of regress.so and a couple of other .so files that contain the C functions referred to in the CREATE commands just below here. We can't just hard-wire those file names into the script; they ha

Re: json_query - redundant result

2022-04-28 Thread Andrew Dunstan
On 2022-04-28 Th 04:16, Pavel Stehule wrote: > Hi > > I am learning new JSON API, and I am not sure, how the result of > JSON_QUERY in one case is correct. So I am asking here > > (2022-04-28 10:13:26) postgres=# SELECT JSON_QUERY(jsonb '[{"a":10, > "b": 20}, {"a": 30, "b":100}]', '$.**.a' with w

Re: bogus: logical replication rows/cols combinations

2022-04-28 Thread Peter Eisentraut
On 27.04.22 12:33, Amit Kapila wrote: Currently, when the subscription has multiple publications, we combine the objects, and actions of those publications. It happens for 'publish_via_partition_root', publication actions, tables, column lists, or row filters. I think the whole design works on th

Re: bogus: logical replication rows/cols combinations

2022-04-28 Thread Peter Eisentraut
On 27.04.22 11:53, Alvaro Herrera wrote: Now, another possibility is to say "naah, this is too hard", or even "naah, there's no time to write all that for this release". That might be okay, but in that case let's add an implementation restriction to ensure that we don't paint ourselves in a corn

Re: Multi-Master Logical Replication

2022-04-28 Thread vignesh C
On Thu, Apr 28, 2022 at 4:24 PM Yura Sokolov wrote: > > В Чт, 28/04/2022 в 09:49 +1000, Peter Smith пишет: > > > 1.1 ADVANTAGES OF MMLR > > > > - Increases write scalability (e.g., all nodes can write arbitrary data). > > I've never heard how transactional-aware multimaster increases > write scala

src / test / regress / sql / triggers.sql first 10 lines.

2022-04-28 Thread alias
1 -- 2

Re: Skipping schema changes in publication

2022-04-28 Thread Amit Kapila
On Fri, Apr 22, 2022 at 9:39 PM Bharath Rupireddy wrote: > > On Tue, Mar 22, 2022 at 12:39 PM vignesh C wrote: > > > > This feature adds an option to skip changes of all tables in specified > > schema while creating publication. > > This feature is helpful for use cases where the user wants to >

RE: Skipping schema changes in publication

2022-04-28 Thread osumi.takami...@fujitsu.com
On Wednesday, April 27, 2022 9:50 PM vignesh C wrote: > Thanks for the comments, the attached v3 patch has the changes for the same. Hi Thank you for updating the patch. Several minor comments on v3. (1) commit message The new syntax allows specifying schemas. For example: CREATE PUBLICATION pu

Re: Multi-Master Logical Replication

2022-04-28 Thread Yura Sokolov
В Чт, 28/04/2022 в 09:49 +1000, Peter Smith пишет: > 1.1 ADVANTAGES OF MMLR > > - Increases write scalability (e.g., all nodes can write arbitrary data). I've never heard how transactional-aware multimaster increases write scalability. More over, usually even non-transactional multimaster doesn'

Re: Logical replication timeout problem

2022-04-28 Thread Amit Kapila
On Thu, Apr 21, 2022 at 3:21 PM wangw.f...@fujitsu.com wrote: > I think it is better to keep the new variable 'end_xact' at the end of the struct where it belongs for HEAD. In back branches, we can keep it at the place as you have. Apart from that, I have made some cosmetic changes and changed a

RE: Logical replication timeout problem

2022-04-28 Thread houzj.f...@fujitsu.com
On Wednesday, April 20, 2022 3:21 PM Masahiko Sawada wrote: > > BTW the changes in > REL_14_v1-0001-Fix-the-logical-replication-timeout-during-large-.patch, > adding end_xact to LogicalDecodingContext, seems good to me and it > might be better than the approach of v17 patch from plugin developer

AW: BUG #17448: In Windows 10, version 1703 and later, huge_pages doesn't work.

2022-04-28 Thread Wilm Hoyer
On Wed, Apr 27, 2022 at 03:04:23PM +, Wilm Hoyer wrote: >> >> I used the following hack to get the "real" Major and Minor Version of >> Windows - it's in C# (.Net) and needs to be adjusted (you can compile >> as x64 and use a long-long as return value ) to return the Service >> Number too

RE: Multi-Master Logical Replication

2022-04-28 Thread kuroda.hay...@fujitsu.com
Dear Laurenz, Thank you for your interest in our works! > I am missing a discussion how replication conflicts are handled to > prevent replication from breaking or the databases from drifting apart. Actually we don't have plans for developing the feature that avoids conflict. We think that it sh

json_query - redundant result

2022-04-28 Thread Pavel Stehule
Hi I am learning new JSON API, and I am not sure, how the result of JSON_QUERY in one case is correct. So I am asking here (2022-04-28 10:13:26) postgres=# SELECT JSON_QUERY(jsonb '[{"a":10, "b": 20}, {"a": 30, "b":100}]', '$.**.a' with wrapper); ┌──┐ │json_query│ ╞═══