Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints

2021-11-24 Thread Greg Nancarrow
uot;, &relfilenode, forkname); how about using the following instead in this case: + nmatch = sscanf(filename, "%u_%4s", &relfilenode, forkname); ? (even if there were > 4 chars after the underscore, it would still match and InvalidOid would be returned because nmatch==2) Regards, Greg Nancarrow Fujitsu Australia

Re: Skipping logical replication transactions on subscriber side

2021-11-25 Thread Greg Nancarrow
uot; in the following comment, to match the struct member name: * subworker is the hash table of PgStat_StatSubWorkerEntry which stores Otherwise, the patch LGTM. Regards, Greg Nancarrow Fujitsu Australia

Re: row filtering for logical replication

2021-11-25 Thread Greg Nancarrow
filter columns are not part of the REPLICA IDENTITY"))); should be: + errdetail("Not all row filter columns are part of the REPLICA IDENTITY"))); Regards, Greg Nancarrow Fujitsu Australia

Re: Windows build warnings

2021-11-25 Thread Greg Nancarrow
gres developers on Windows for cases unrelated to the use of PG_USED_FOR_ASSERTS_ONLY. I agree with your proposal to apply your patch to remove PG_USED_FOR_ASSERTS_ONLY where it's no longer applicable. Regards, Greg Nancarrow Fujitsu Australia

Re: row filtering for logical replication

2021-11-28 Thread Greg Nancarrow
ls for UPDATE) and so has to assume the old tuple doesn't exist on the subscriber, hence the UPDATE ends up doing an INSERT. INow if the use of RI cols were enforced for the insert filter case, we'd properly know the answer as to whether the old row value had been published and it would have correctly performed an UPDATE instead of an INSERT in this case. Thoughts? Regards, Greg Nancarrow Fujitsu Australia

Re: Correct handling of blank/commented lines in PSQL interactive-mode history

2021-11-29 Thread Greg Nancarrow
effort. The patches LGTM. Thanks for working on this. (BTW, the patches are in Windows CRLF format, so on Linux at least I needed to convert them using dos2unix so they'd apply using Git) Regards, Greg Nancarrow Fujitsu Australia

Re: Correct handling of blank/commented lines in PSQL interactive-mode history

2021-11-29 Thread Greg Nancarrow
On Tue, Nov 30, 2021 at 11:08 AM Tom Lane wrote: > > Greg Nancarrow writes: > > (BTW, the patches are in Windows CRLF format, so on Linux at least I > > needed to convert them using dos2unix so they'd apply using Git) > > Hmm. Applying "od -c" to the copy

Re: Correct handling of blank/commented lines in PSQL interactive-mode history

2021-11-29 Thread Greg Nancarrow
On Tue, Nov 30, 2021 at 12:15 PM Greg Nancarrow wrote: > > Yeah, sorry, looks like it could be a Gmail issue for me. > When I alternatively downloaded your patches from the pgsql-hackers > archive, they're in Unix format, as you say. > After a bit of investigation, it seems th

Re: Optionally automatically disable logical replication subscriptions on error

2021-11-29 Thread Greg Nancarrow
of pg_subscription. Regards, Greg Nancarrow Fujitsu Australia

Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints

2021-11-30 Thread Greg Nancarrow
teDBRelInfo" needs to be added to src/tools/pgindent/typedefs.list src/bin/pg_rewind/parsexlog.c (3) Include additional header file It seems that the following additional header file is not needed to compile the source file: +#include "utils/relmapper.h" Regards, Greg Nancarrow Fujitsu Australia

Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints

2021-11-30 Thread Greg Nancarrow
en critical system index 2662 pg_dumpall: error: pg_dump failed on database "test2", exiting Hopefully the above example will help in tracking down the cause. Regards, Greg Nancarrow Fujitsu Australia

Re: Data is copied twice when specifying both child and parent table in publication

2021-12-01 Thread Greg Nancarrow
we should back-patch this but I am slightly worried ... I'd be in favor of back-patching this. Regards, Greg Nancarrow Fujitsu Australia

Re: Libpq support to connect to standby server as priority

2019-10-01 Thread Greg Nancarrow
mentation and code comments. I also rebased them to the latest PG12 source code (as of October 1, 2019). The patch code itself is the same, except for some version checks that I have updated to target the features for PG13 instead of PG12. I’ve attached the updated patches. Regards, Greg Nancarro

Re: Libpq support to connect to standby server as priority

2019-10-01 Thread Greg Nancarrow
ocumentation and code comments. I also rebased them to the latest PG12 source code (as of October 1, 2019). The patch code itself is the same, except for some version checks that I have updated to target the features for PG13 instead of PG12. I’ve attached the updated patches. Regards, Greg Nanca

Re: libpq sslpassword parameter and callback function

2019-11-28 Thread Greg Nancarrow
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, failed Hi Andrew, I've reviewed your "libpq sslpassword parameter a

Re: Skipping logical replication transactions on subscriber side

2022-01-17 Thread Greg Nancarrow
e I think the following test case is misleading and should be removed, because the "1.1" xid value is only regarded as invalid because "1" is an invalid xid (and there's already a test case for a "1" xid) - the fractional part gets thrown away, and doesn't affect the validity here. +ALTER SUBSCRIPTION regress_testsub SKIP (xid = 1.1); Regards, Greg Nancarrow Fujitsu Australia

Re: row filtering for logical replication

2022-01-17 Thread Greg Nancarrow
nt ? > Maybe the existing comment should be updated to just spell it out like that: /* * Find the "topmost" ancestor that is in this publication, by getting the * last Oid in the ancestors list which is published by the publication. */ Regards, Greg Nancarrow Fujitsu Australia

Re: row filtering for logical replication

2022-01-17 Thread Greg Nancarrow
On Tue, Jan 18, 2022 at 2:31 PM Amit Kapila wrote: > > On Tue, Jan 18, 2022 at 8:41 AM Greg Nancarrow wrote: > > > > On Tue, Jan 18, 2022 at 2:31 AM houzj.f...@fujitsu.com > > wrote: > > > > > > > (2) GetTopMostAncestorInPublication > >

Re: Skipping logical replication transactions on subscriber side

2022-01-18 Thread Greg Nancarrow
commits the clearing of subskixpid here, so I suggest the following addition: BEFORE: + * clear subskipxid of pg_subscription. AFTER: + * clear subskipxid of pg_subscription, then commit. Regards, Greg Nancarrow Fujitsu Australia

Re: row filtering for logical replication

2022-01-19 Thread Greg Nancarrow
lt-in data types and non-immutable built-in functions.") AFTER: + errdetail("Expressions only allow columns, constants, built-in operators, built-in data types and immutable built-in functions.") Regards, Greg Nancarrow Fujitsu Australia

Re: PublicationActions - use bit flags.

2022-01-20 Thread Greg Nancarrow
On Tue, Dec 21, 2021 at 12:55 PM Greg Nancarrow wrote: > > On Tue, Dec 21, 2021 at 11:56 AM Tom Lane wrote: > > > > Removing this is not good: > > > > if (relation->rd_pubactions) > > - { > > pfree(relation-

Re: row filtering for logical replication

2022-01-20 Thread Greg Nancarrow
nd was already discussed on another thread ([1]) on which I posted a patch to correct the issue along the same lines that you're suggesting. [1] https://postgr.es/m/CAJcOf-d0%3DvQx1Pzbf%2BLVarywejJFS5W%2BM6uR%2B2d0oeEJ2VQ%2BEw%40mail.gmail.com Regards, Greg Nancarrow Fujitsu Australia

Re: Skipping logical replication transactions on subscriber side

2022-01-20 Thread Greg Nancarrow
"clear" in the following comment? (the subtransaction's XID was never being cleared before, just checked against the skipxid, and now that check has been removed) + * ... . Since we don't + * support skipping individual subtransactions we don't clear + * subtransactio

Re: row filtering for logical replication

2022-01-21 Thread Greg Nancarrow
* consumption and CPU cycles. (5) pgoutput_row_filter BEFORE: + * evaluates the row filter for that tuple and return. AFTER: + * evaluate the row filter for that tuple and return. Regards, Greg Nancarrow Fujitsu Australia

Re: On login trigger: take three

2022-01-23 Thread Greg Nancarrow
On Mon, Dec 6, 2021 at 12:10 PM Greg Nancarrow wrote: > > I've attached a re-based version (no functional changes from the > previous) to fix cfbot failures. > I've attached a re-based version (no functional changes from the previous) to fix cfbot failures. Regards,

Re: row filtering for logical replication

2022-01-23 Thread Greg Nancarrow
l" is true, the function always returns false, not the value of "ret". For the current logging code to be correct, and match the function return value, we should be able to change: if (isnull) return false; to: if (isnull) return ret; But regression tests fail when that code change is made (indicating that there are cases when "isnull" is true but the function returns true instead of false). So the current logging code is NOT correct, and needs to be updated as I indicated. Regards, Greg Nancarrow Fujitsu Australia

Re: row filtering for logical replication

2022-01-23 Thread Greg Nancarrow
s-ci.com/task/6280873841524736?logs=test_world#L3970 > 2139062143 is 0x7F7F7F7F, so it looks like a value from uninitialized memory (debug build) has been copied into the column, or something similar involving uninitialized memory. The problem is occurring on FreeBSD. I tried using similar build flags as

Re: row filtering for logical replication

2022-01-23 Thread Greg Nancarrow
On Mon, Jan 24, 2022 at 5:09 PM Amit Kapila wrote: > > On Mon, Jan 24, 2022 at 10:29 AM Greg Nancarrow wrote: > > > > On Mon, Jan 24, 2022 at 2:47 PM Amit Kapila wrote: > > > > > > > (3) pgoutput_row_filter_exec_expr > > > > pgoutput_row_f

Re: PublicationActions - use bit flags.

2022-01-24 Thread Greg Nancarrow
as pass-by-reference, and I'd tend to stick with pass-by-reference in that case. [1] https://postgr.es/m/OS0PR01MB5716B899A66D2997EF28A1B3945F9%40OS0PR01MB5716.jpnprd01.prod.outlook.com Regards, Greg Nancarrow Fujitsu Australia

Re: row filtering for logical replication

2022-01-26 Thread Greg Nancarrow
nt to be: + * - (Var Op Const) Logical-Op (Var Op Const) ? It's not clear what "Bool" means here. (3) check_simple_rowfilter_expr_walker We should say "Built-in functions" instead of "System-functions": + * User-defined functions are not allowed. System-functions that are Regards, Greg Nancarrow Fujitsu Australia

Re: row filtering for logical replication

2022-01-26 Thread Greg Nancarrow
re required doc/src/sgml/ref/create_subscription.sgml (5) CREATE SUBSCRIPTION BEFORE: + returns false or null will not be published. If the subscription has several AFTER: + evaluates to false or null will not be published. If the subscription has several Regards, Greg Nancarrow Fujitsu Australia

Re: row filtering for logical replication

2022-01-26 Thread Greg Nancarrow
On Thu, Jan 27, 2022 at 4:59 PM Peter Smith wrote: > > On Thu, Jan 27, 2022 at 9:40 AM Greg Nancarrow wrote: > > > > On Wed, Jan 26, 2022 at 2:08 PM houzj.f...@fujitsu.com > > wrote: > > > > > > There was a miss in the posted patc

Re: Fix uninitialized variable access (src/backend/utils/mmgr/freepage.c)

2022-01-27 Thread Greg Nancarrow
make this more obvious. if (btp == NULL) { result->page = NULL; result->found = false; return; } Regards, Greg Nancarrow Fujitsu Australia

Re: row filtering for logical replication

2022-01-28 Thread Greg Nancarrow
, "\d" by itself doesn't show any row filter information, so I think it should say: Psql commands "\dRp+" and "\d " will display any row filters. Regards, Greg Nancarrow Fujitsu Australia

Re: row filtering for logical replication

2022-01-30 Thread Greg Nancarrow
t function. IMO removing "static" makes things worse because now that array gets initialized each call to the function, which is unnecessary. I think it should just be: "static const int map_changetype_pubaction[] = ..." Regards, Greg Nancarrow Fujitsu Australia

Re: row filtering for logical replication

2022-01-30 Thread Greg Nancarrow
ested: - v15 psql connecting to same and older versions, and using "\dRp+" and "\d " commands - v15 pg_dump, dumping the above definitions from the same or older server versions - Loading dumps from older or same (v15) server version into a v15 server. I did not detect any issues. Regards, Greg Nancarrow Fujitsu Australia

Re: row filtering for logical replication

2022-01-31 Thread Greg Nancarrow
I don't believe the calls to MemoryContextSwitchTo() are required here, because within the context switch it's just freeing memory, not allocating it. Regards, Greg Nancarrow Fujitsu Australia

Re: row filtering for logical replication

2022-01-31 Thread Greg Nancarrow
(aschemaPubids, puboid)) topmost_relid = ancestor; } Regards, Greg Nancarrow Fujitsu Australia

Re: row filtering for logical replication

2022-01-31 Thread Greg Nancarrow
c.test1 WHERE TRUE; (since currently, parentheses are required around the publication WHERE expression) See also the following commit, which specifically added these parentheses and catered for WHERE TRUE: https://www.postgresql.org/message-id/attachment/121245/0005-fixup-Publication-WHERE-condition-support-for-pg_dum.patch Regards, Greg Nancarrow Fujitsu Australia

Re: On login trigger: take three

2022-02-15 Thread Greg Nancarrow
On Mon, Jan 24, 2022 at 1:59 PM Greg Nancarrow wrote: > > I've attached a re-based version (no functional changes from the > previous) to fix cfbot failures. > I've attached a re-based version (no functional changes from the previous) to fix cfbot failures. Regards,

Tiny update to pg_stat_statements documentation

2021-04-20 Thread Greg Nancarrow
attached a patch for this. Regards, Greg Nancarrow Fujitsu Australia v1-0001-Update-pg_stat_stmts-doc.patch Description: Binary data

Re: Tiny update to pg_stat_statements documentation

2021-04-20 Thread Greg Nancarrow
nted here, as the other typical usage settings are not commented, and all settings are explained in the surrounding documentation. Regards, Greg Nancarrow Fujitsu Australia

Re: [bug?] Missed parallel safety checks, and wrong parallel safety

2021-04-23 Thread Greg Nancarrow
ke a fairly > bad idea. > I'm curious. The FmgrBuiltin struct includes the "strict" flag, so that would "lock down the value" of the strict flag, wouldn't it? Regards, Greg Nancarrow Fujitsu Australia

Re: Parallel INSERT SELECT take 2

2021-04-26 Thread Greg Nancarrow
y is declared/set. It's up to the user to get it right. If it's actually wrong, it will be detected at runtime. Regards, Greg Nancarrow Fujitsu Australia

Re: [bug?] Missed parallel safety checks, and wrong parallel safety

2021-04-26 Thread Greg Nancarrow
On Sat, Apr 24, 2021 at 12:53 PM Amit Kapila wrote: > > On Fri, Apr 23, 2021 at 6:45 PM Tom Lane wrote: > > > > Greg Nancarrow writes: > > > I'm curious. The FmgrBuiltin struct includes the "strict" flag, so > > > that would "lock down the

Error in libpq docs for target_session_attrs, prefer-standby mode

2021-04-27 Thread Greg Nancarrow
try again in all mode". There is no such "all" mode. It should instead say "any" mode. Patch is attached. Regards, Greg Nancarrow Fujitsu Australia libpq_target_session_attrs_doc_fix.patch Description: Binary data

Re: Parallel INSERT SELECT take 2

2021-04-28 Thread Greg Nancarrow
t is UNSAFE. It should say "relparalleldml" column. 2) With the patches applied, I seem to be getting a couple of errors when running "make installcheck-world" with force_parallel_mode=regress in effect. Can you please try it? Regards, Greg Nancarrow Fujitsu Australia

Re: [bug?] Missed parallel safety checks, and wrong parallel safety

2021-05-04 Thread Greg Nancarrow
ild time (from pg_proc.dat), but ALTER FUNCTION is just changing it in the system catalogs. Also, with sufficient privileges, a built-in function can be redefined, yet the original function (whose info is cached in FmgrBuiltins[]) is always invoked, not the newly-defined version. Regards, Greg Nancarrow Fujitsu Australia

Re: [bug?] Missed parallel safety checks, and wrong parallel safety

2021-05-06 Thread Greg Nancarrow
and simply get it from there (I don't think we should be allowing changes to built-in function properties - currently it is allowed, but it doesn't work properly). The other option is to just blindly trust the parallel-safety declaration on tables and whatever happens at runtime happens. Regards, Greg Nancarrow Fujitsu Australia

Executor code - found an instance of a WHILE that should just be an IF

2021-05-10 Thread Greg Nancarrow
ed to just use IF for clarity. I've attached a patch. Regards, Greg Nancarrow Fujitsu Australia v1-0001-Change-an-instance-of-WHILE-to-IF-in-executor-code.patch Description: Binary data

Re: Parallel scan with SubTransGetTopmostTransaction assert coredump

2021-05-11 Thread Greg Nancarrow
redump occurred for me (and yes, I definitely had asserts enabled). I tried with both the 13.2 source code (3fb4c75e857adee3da4386e947ba58a75f3e74b7), running through the script with pgbench twice to completion, and also did the same using the latest Postgres source code. Will be interesti

Re: Parallel INSERT SELECT take 2

2021-05-12 Thread Greg Nancarrow
How about reorganisation of the patches like the following? 0001: CREATE ALTER TABLE PARALLEL DML 0002: parallel-SELECT-for-INSERT (planner changes, max_parallel_hazard() update, XID changes) 0003: pg_get_parallel_safety() 0004: regression test updates Regards, Greg Nancarrow Fujitsu Australia

Re: Parallel scan with SubTransGetTopmostTransaction assert coredump

2021-05-13 Thread Greg Nancarrow
ppens on your system and triggers the Assert (and coredump)? I have not been able to reproduce that on my system. Have you reproduced this issue on any other system, using the same steps as you provided? I'm wondering if there might be something else in your environment that may be influencing this problem. Regards, Greg Nancarrow Fujitsu Australia

Re: Executor code - found an instance of a WHILE that should just be an IF

2021-05-13 Thread Greg Nancarrow
On Fri, May 14, 2021 at 10:27 AM David Rowley wrote: > > Thanks for the votes. Pushed. Thanks! Regards, Greg Nancarrow Fujitsu Australia

Re: Parallel scan with SubTransGetTopmostTransaction assert coredump

2021-05-14 Thread Greg Nancarrow
he snapshots (i.e. the snapshot subxip array has overflowed). I'm guessing that this may be related to the coredump issue, but I'm not exactly sure how it has happened, and why it seemingly isn't being handled correctly and causes that Assert to fire in your case. Can you try and find out how the snapshot suboverflow is being set in your case? (since you are getting this readily in your examined snapshots???) I think there's only several places where it can be set to "true" (e.g. procarray.c:1641). Also, does increasing PGPROC_MAX_CACHED_SUBXIDS avoid, or delay, the problem for you? It's currently defined as 64. I notice that there's been some changes related to snapshot data handling and subxid overflow since 13.2, so I'm wondering whether your coredump issue can be reproduced with the latest code? Regards, Greg Nancarrow Fujitsu Australia

Re: Parallel scan with SubTransGetTopmostTransaction assert coredump

2021-05-14 Thread Greg Nancarrow
ttings? I also tried: max_connections = 2000 parallel_setup_cost=0 parallel_tuple_cost=0 min_parallel_table_scan_size=0 max_parallel_workers_per_gather=2 max_parallel_workers = 280 max_worker_processes = 300 and the pgbench command-line: pgbench -d postgres -p 33550 -n -r -f sub_120.sql -c 140 -j

Re: Re: Parallel scan with SubTransGetTopmostTransaction assert coredump

2021-05-17 Thread Greg Nancarrow
l-worker case, the snapshots are not being setup correctly. Can you try the trivial change below and see if it prevents the coredump? Regards, Greg Nancarrow Fujitsu Australia diff --git a/src/backend/access/transam/parallel.c b/src/backend/access/transam/parallel.c index 14a8690019..8708890

Re: Re: Parallel scan with SubTransGetTopmostTransaction assert coredump

2021-05-18 Thread Greg Nancarrow
vironment, which I assume you have). Sure, IF it was deemed a proper solution, you'd only send the one snapshot, and adjust accordingly in ParallelWorkerMain(), but we need not worry about that in order to test it. Regards, Greg Nancarrow Fujitsu Australia

Re: Parallel scan with SubTransGetTopmostTransaction assert coredump

2021-05-18 Thread Greg Nancarrow
On Tue, May 18, 2021 at 9:41 PM houzj.f...@fujitsu.com wrote: > > > To: Pengchengliu > > Cc: Greg Nancarrow ; Andres Freund > > ; PostgreSQL-development > > Subject: Re: Re: Parallel scan with SubTransGetTopmostTransaction assert > > coredump > > &

Re: Parallel INSERT SELECT take 2

2021-05-19 Thread Greg Nancarrow
h the function oid and the index oid are returned. Provide a utility function "pg_get_max_parallel_hazard(regclass)" that returns the worst parallel DML safety hazard that can be found in the given relation. Users can use this function to do a quick check without caring about specific parallel-related objects. Regards, Greg Nancarrow Fujitsu Australia

Re: Re: Parallel scan with SubTransGetTopmostTransaction assert coredump

2021-05-19 Thread Greg Nancarrow
t Postgres with the patch applied and run the regression tests, with and without "force_parallel_mode=regress", and all tests pass. So if the fix is wrong, no tests currently exist that detect issues with it. Regards, Greg Nancarrow Fujitsu Australia v1-0001-PG14-Fix-parallel-worker

Re: Re[3]: On login trigger: take three

2021-05-20 Thread Greg Nancarrow
enable_client_connection_trigger = true # enables firing the client_connection trigger when a client connects Regards, Greg Nancarrow Fujitsu Australia

Re: Re: Parallel scan with SubTransGetTopmostTransaction assert coredump

2021-05-23 Thread Greg Nancarrow
On Thu, May 20, 2021 at 4:08 PM Greg Nancarrow wrote: > Keep cfbot happy, use the PG14 patch as latest. Regards, Greg Nancarrow Fujitsu Australia v2-0001-PG14-Fix-parallel-worker-failed-assertion-and-coredump.patch Description: Binary data

Re: Re: Parallel scan with SubTransGetTopmostTransaction assert coredump

2021-05-23 Thread Greg Nancarrow
On Mon, May 24, 2021 at 2:50 PM Michael Paquier wrote: > > On Mon, May 24, 2021 at 12:04:37PM +1000, Greg Nancarrow wrote: > > Keep cfbot happy, use the PG14 patch as latest. > > This stuff is usually very tricky. Agreed. That's why I was looking for experts in this sna

Re: Re: Parallel scan with SubTransGetTopmostTransaction assert coredump

2021-05-24 Thread Greg Nancarrow
had no crashes, from many runs. Regards, Greg Nancarrow Fujitsu Australia

Re: Consider parallel for lateral subqueries with limit

2021-05-27 Thread Greg Nancarrow
l || bms_is_empty(rel->lateral_relids)) && + limit_needed(subquery)) Thoughts? Regards, Greg Nancarrow Fujitsu Australia

Re: Parallel INSERT SELECT take 2

2021-05-28 Thread Greg Nancarrow
aints(Oid type_id) should be: List * GetDomainConstraints(Oid type_id) Regards, Greg Nancarrow Fujitsu Australia

Re: Parallel Full Hash Join

2021-05-30 Thread Greg Nancarrow
to show how it looks > with these three patches. "scan*" is new. Patches 0002, 0003 no longer apply to the master branch, seemingly because of subsequent changes to pgstat, so need rebasing. Regards, Greg Nancarrow Fujitsu Australia

pg_statsinfo - PG15 support?

2022-10-05 Thread Greg Nancarrow
removed and some new fields have been added). I also noticed that PG15 changes how shared libraries must request additional shared memory during initialization and pg_statsinfo source code would need updating for this. Regards, Greg Nancarrow Fujitsu Australia

Re: Parallel INSERT SELECT take 2

2021-06-01 Thread Greg Nancarrow
ck check without caring about specific parallel-related objects. --- Also, shouldn't support for "Parallel" be added for table output in PSQL? (e.g. \dt+) Regards, Greg Nancarrow Fujitsu Australia

Re: Re[3]: On login trigger: take three

2021-06-02 Thread Greg Nancarrow
On Fri, May 21, 2021 at 2:46 PM Greg Nancarrow wrote: > > On Thu, May 20, 2021 at 2:45 PM Ivan Panchenko wrote: > > > > I have upgraded the patch for the 14th version. > > > > I have some feedback on the patch: > I've attached an updated version of the patc

Re: pg_stat_progress_create_index vs. parallel index builds

2021-06-04 Thread Greg Nancarrow
llion records, and it took about 40 seconds, during which the "sorting live tuples" phase seemed to take about 8 seconds. Yet for the serial case, index creation took about 75 seconds, during which the "sorting live tuples" phase seemed to take about 1 second. Regards, Greg Nancarrow Fujitsu Australia

Re: pg_stat_progress_create_index vs. parallel index builds

2021-06-04 Thread Greg Nancarrow
On Fri, Jun 4, 2021 at 5:25 PM Greg Nancarrow wrote: > > What is slightly puzzling to me (and perhaps digging deeper will > reveal it) is why this "sorting live tuples" phase seems so short in > the serial case compared to the parallel case? > For example, in my tes

Re: [HACKERS] logical decoding of two-phase transactions

2021-06-07 Thread Greg Nancarrow
ription.sql regression tests. 25c25 < * Updates PG doumentation. --- > * Update PG documentation. 33c33 < * Prepare API for in-progress transactions is not supported. --- > * Prepare API for in-progress transactions. Regards, Greg Nancarrow Fujitsu Australia

Re: [HACKERS] logical decoding of two-phase transactions

2021-06-08 Thread Greg Nancarrow
same thing in pgoutput_rollback_prepared_txn(): I suggest adding the following line after the pfree() above: + txn->output_plugin_private = NULL; Regards, Greg Nancarrow Fujitsu Australia

Re: Parallel INSERT SELECT take 2

2021-06-09 Thread Greg Nancarrow
xplain (costs off) insert into testdef(a,d) select a,a*8 from test_data; -> should use "alter table testdef parallel dml unsafe;" before the explain Regards, Greg Nancarrow Fujitsu Australia

Issue with some calls to GetMultiXactIdMembers()

2021-06-16 Thread Greg Nancarrow
members == 0" case can't actually happen (right?). I decided not to mess with any of the calling code. Regards, Greg Nancarrow Fujitsu Australia 0001-Fix-possible-pfree-of-junk-members-value.patch Description: Binary data

Re: [HACKERS] logical decoding of two-phase transactions

2021-06-17 Thread Greg Nancarrow
prepare message (expected %X/%X)", + LSN_FORMAT_ARGS(prepare_data.prepare_lsn), + LSN_FORMAT_ARGS(remote_final_lsn; Without being more familiar with this code, it's difficult for me to judge exactly how many of such cases are in these patches. Regards, Greg Nancarrow Fujitsu Australia

Remove useless int64 range checks on BIGINT sequence MINVALUE/MAXVALUE values

2021-06-21 Thread Greg Nancarrow
old such values. I've attached a patch to remove those useless checks. The MINVALUE/MAXVALUE values are anyway int64 range-checked prior to this, as part of conversion to int64. Regards, Greg Nancarrow Fujitsu Australia v1-0001-Remove-useless-int64-range-checks-on-BIGINT-sequence.patch Description: Binary data

Re: Remove useless int64 range checks on BIGINT sequence MINVALUE/MAXVALUE values

2021-06-21 Thread Greg Nancarrow
oes not get missed. Updated the patch, and will add it to the Commitfest, thanks. Regards, Greg Nancarrow Fujitsu Australia v2-0001-Remove-useless-int64-range-checks-on-BIGINT-sequence.patch Description: Binary data

Re: [HACKERS] logical decoding of two-phase transactions

2021-06-21 Thread Greg Nancarrow
+ else if (!table_states_not_ready && last_start_times) AFTER: + else if (table_states_not_ready == NIL && last_start_times) Regards, Greg Nancarrow Fujitsu Australia

Re: Parallel scan with SubTransGetTopmostTransaction assert coredump

2021-06-22 Thread Greg Nancarrow
e active snapshot, for consistency with the rest of the code. I think that if there was something fundamentally wrong with the v2 patch's removal of that "later transaction snapshot" used by the parallel workers, then surely there would be a test failure somewhere - but that is not the case. I think the v2 patch should be restored as the proposed solution here. Regards, Greg Nancarrow Fujitsu Australia

Re: Assertion failure in HEAD and 13 after calling COMMIT in a stored proc

2021-06-22 Thread Greg Nancarrow
ommit in place, there is an active snapshot in place anyway, so for your example, that Assert no longer fires as it did before. However, I still think that your fix is valid and needed. Regards, Greg Nancarrow Fujitsu Australia

Re: Added schema level support for publication.

2021-06-23 Thread Greg Nancarrow
-- Check create publication on an object which is not schema (4) src/test/regress/sql/publication.sql BEFORE: +-- Drop schema that is not preset in the publication AFTER: +-- Drop schema that is not present in the publication Regards, Greg Nancarrow Fujitsu Australia

Re: Assertion failure in HEAD and 13 after calling COMMIT in a stored proc

2021-06-23 Thread Greg Nancarrow
. if (!skip_snapshot) PopActiveSnapshot(); Regards, Greg Nancarrow Fujitsu Australia

Re: [bug?] Missed parallel safety checks, and wrong parallel safety

2021-06-23 Thread Greg Nancarrow
rchy (to record the parents for the eventual locking in reverse order) without taking locks? Regards, Greg Nancarrow Fujitsu Australia

Re: Added schema level support for publication.

2021-06-24 Thread Greg Nancarrow
objtype(rel->rd_rel->relkind), ^~~ get_publication_type pgrowlocks.c:136:29: warning: implicit declaration of function ‘get_relkind_objtype’ [-Wimplicit-function-declaration] aclcheck_error(aclresult, get_relkind_objtype(rel->rd_rel->relkind), Regards, Greg Nancarrow Fujitsu Australia

Re: [bug?] Missed parallel safety checks, and wrong parallel safety

2021-06-30 Thread Greg Nancarrow
intended declared table parallel-safety. I can't really see some mixture of (a) and (b) being acceptable. Regards, Greg Nancarrow Fujitsu Australia

Re: row filtering for logical replication

2021-07-04 Thread Greg Nancarrow
they should break from the switch, otherwise cleanup code is missed. This is surely a bug. e.g. (3 similar cases of this) + if (!pgoutput_row_filter(relation, NULL, tuple, relentry->qual)) + return; should be: + if (!pgoutput_row_filter(relation, NULL, tuple, relentry->qual)) + break; Regards, Greg Nancarrow Fujitsu Australia

Re: Remove useless int64 range checks on BIGINT sequence MINVALUE/MAXVALUE values

2021-07-06 Thread Greg Nancarrow
hwhile. (After all, similar checks are not being done elsewhere in the Postgres code, AFAICS. e.g. "int" variables are not being checked to see whether they hold values greater than MAXINT). Regards, Greg Nancarrow Fujitsu Australia

Re: Re[3]: On login trigger: take three

2021-07-06 Thread Greg Nancarrow
e login trigger function, to satisfy the new poll_query_until expectations. Also, I updated a PG14 version check (now must check PG15 version). Regards, Greg Nancarrow Fujitsu Australia v16-0001-on_client_connect_event_trigger.patch Description: Binary data

Re: row filtering for logical replication

2021-07-06 Thread Greg Nancarrow
– thanks!) detailing the performance improvement. Regards, Greg Nancarrow Fujitsu Australia v16-0005-Improve-row-filtering-performance.patch Description: Binary data

Re: row filtering for logical replication

2021-07-07 Thread Greg Nancarrow
tch wasn't handling RelationSyncEntry invalidation, so I've updated it. For completeness, I'm posting the complete patch set with the updates, so you can look at it and compare with yours, and also it'll keep the cfbot happy until you post your updated patch. Regards, Greg

Re: Added schema level support for publication.

2021-07-08 Thread Greg Nancarrow
TRUNCATEs are). Could this be related to the issues that Hou-san has identified? Regards, Greg Nancarrow Fujitsu Australia

Re: row filtering for logical replication

2021-07-11 Thread Greg Nancarrow
lse has already decremented the refcount by the time it comes to deallocate the slot. Perhaps there's an order-of-cleanup or MemoryContext issue here or some buggy code somewhere, not sure yet. Regards, Greg Nancarrow Fujitsu Australia

Re: Remove useless int64 range checks on BIGINT sequence MINVALUE/MAXVALUE values

2021-07-11 Thread Greg Nancarrow
es don't need to > > be checked. > > Any thoughts on this, Greg? > The patch LGTM (it's the same as my original patch but with short comments). Regards, Greg Nancarrow Fujitsu Australia

Re: Skipping logical replication transactions on subscriber side

2021-08-25 Thread Greg Nancarrow
sage type into the switch as the default case - because then, if you add a new message type, you won't get a compiler warning (when warnings are enabled) for a missing switch case, which is a handy way to alert you that the new message type needs to be added as a case to the switch. Rega

Re: Skipping logical replication transactions on subscriber side

2021-08-25 Thread Greg Nancarrow
I see it's not easy to achieve it and still execute the non-error-case code after the switch. (you'd have to use a variable set in the default case, defeating the purpose, or have the switch in a separate function with return for each case) So the 0001 patch LGTM. Regards, Greg Nancarrow Fujitsu Australia

Fix erroneous parallel execution when modifying CTE is present in rewritten query

2021-08-26 Thread Greg Nancarrow
return true; +} + } + Regards, Greg Nancarrow Fujitsu Australia v1-0001-Propagate-CTE-property-flags-when-copying-a-CTE-list.patch Description: Binary data

Re: Added schema level support for publication.

2021-08-29 Thread Greg Nancarrow
ents + table and that publishes all changes for all the tables present in the AFTER: + Create a publication that publishes all changes for tables "users" and + "departments" and that publishes all changes for all the tables present in the Regards, Greg Nancarrow Fujitsu Australia

<    1   2   3   4   5   >