should libpq also require TLSv1.2 by default?

2020-06-23 Thread Peter Eisentraut
In PG13, we raised the server-side default of ssl_min_protocol_version to TLSv1.2. We also added a connection setting named ssl_min_protocol_version to libpq. But AFAICT, the default value of the libpq setting is empty, so any protocol version will be accepted. Is this what we wanted? Shoul

Allow CURRENT_ROLE in GRANTED BY

2020-06-23 Thread Peter Eisentraut
I was checking some loose ends in SQL conformance, when I noticed: We support GRANT role ... GRANTED BY CURRENT_USER, but we don't support CURRENT_ROLE in that place, even though in PostgreSQL they are equivalent. Here is a trivial patch to add that. -- Peter Eisentraut http://ww

Re: Update InsertPgAttributeTuple comment to match new signature

2020-06-23 Thread Michael Paquier
On Tue, Jun 23, 2020 at 02:31:05PM +0900, Michael Paquier wrote: > Looks right to me, good catch. I'll apply that tomorrow my time > except if there are any objections in-between. And done. -- Michael signature.asc Description: PGP signature

Re: Threading in BGWorkers (!)

2020-06-23 Thread Chapman Flack
On 06/23/20 23:08, Tom Lane wrote: > I dunno. It's not even adequate for the use-case of reporting an > error, because waiting till after the current transaction commits > is surely not what should happen in that case. In the case of the kind of exuberantly-threaded language runtime of which Jav

Re: Default setting for enable_hashagg_disk

2020-06-23 Thread Justin Pryzby
On Wed, Jun 24, 2020 at 02:11:57PM +1200, David Rowley wrote: > On Tue, 23 Jun 2020 at 08:24, Jeff Davis wrote: > > Another way of looking at it is that the weird behavior is already > > there in v12, so there are already users relying on this weird behavior > > as a crutch for some other planner

Re: Threading in BGWorkers (!)

2020-06-23 Thread Tom Lane
Chapman Flack writes: > On 06/23/20 22:13, Tom Lane wrote: >> I'm not sure whether the other idea >>> It would be nice to be able to also asynchronously set some flag >>> like ExtensionServiceRequested, which could be checked as part of >>> CHECK_FOR_INTERRUPTS or even at more limited times, such

Re: Threading in BGWorkers (!)

2020-06-23 Thread Chapman Flack
On 06/23/20 22:13, Tom Lane wrote: > 1. elog.c is in itself not-thread-safe, because it uses a static data > structure to track the message being built. > > 2. It uses palloc, another large pile of not-thread-safe infrastructure. ... I'm sure now that I shouldn't have mentioned (1) - muddied wate

Re: SIGSEGV from START_REPLICATION 0/XXXXXXX in XLogSendPhysical () at walsender.c:2762

2020-06-23 Thread Kyotaro Horiguchi
At Tue, 23 Jun 2020 10:51:40 +0900, Michael Paquier wrote in > On Sun, Jun 21, 2020 at 01:02:34PM -0700, Andres Freund wrote: > > I still maintain that adding restrictions here is a bad idea. Even > > disregarding the discussion of running normal queries interspersed, it's > > useful to be able

Re: EXPLAIN: Non-parallel ancestor plan nodes exclude parallel worker instrumentation

2020-06-23 Thread Amit Kapila
On Wed, Jun 24, 2020 at 3:18 AM Maciek Sakrejda wrote: > > On Tue, Jun 23, 2020 at 2:57 AM Amit Kapila wrote: > > I don't think this is an odd situation because in this case, child > > nodes like "Nested Loop" and "Parallel Seq Scan" has a value of > > 'loops' as 3. So, to get the correct stats

Re: Review for GetWALAvailability()

2020-06-23 Thread Kyotaro Horiguchi
At Tue, 23 Jun 2020 19:06:25 -0400, Alvaro Herrera wrote in > On 2020-Jun-16, Kyotaro Horiguchi wrote: > > > I saw that the "reserved" is the state where slots are working to > > retain segments, and "normal" is the state to indicate that "WAL > > segments are within max_wal_size", which is ort

Re: Threading in BGWorkers (!)

2020-06-23 Thread Tom Lane
Andres Freund writes: > On 2020-06-23 09:19:36 -0400, Chapman Flack wrote: >> 1) It would be nice to be able to ereport from an arbitrary thread. > I think that's way harder than what you make it sound here. Indeed. Just for starters: 1. elog.c is in itself not-thread-safe, because it uses a s

Re: Default setting for enable_hashagg_disk

2020-06-23 Thread David Rowley
On Tue, 23 Jun 2020 at 08:24, Jeff Davis wrote: > Another way of looking at it is that the weird behavior is already > there in v12, so there are already users relying on this weird behavior > as a crutch for some other planner mistake. The question is whether we > want to: > > (a) take the weird

Re: Removal of currtid()/currtid2() and some table AM cleanup

2020-06-23 Thread Michael Paquier
On Tue, Jun 23, 2020 at 02:02:33PM +0900, Michael Paquier wrote: > Actually, while reviewing the code, the only code path where we use > currtid2() involves positioned_load() and LATEST_TUPLE_LOAD. And the > only location where this happens is in SC_pos_reload_with_key(), where > I don't actually

Re: Threading in BGWorkers (!)

2020-06-23 Thread Andres Freund
Hi, On 2020-06-23 21:50:26 -0400, Chapman Flack wrote: > On 06/23/20 21:44, Andres Freund wrote: > > > I think that's way harder than what you make it sound here. The locking > > for shm_mq doesn't really work inside a process. In contrast to the > > single threaded case something like a volatile

Re: Threading in BGWorkers (!)

2020-06-23 Thread Chapman Flack
On 06/23/20 21:44, Andres Freund wrote: > I think that's way harder than what you make it sound here. The locking > for shm_mq doesn't really work inside a process. In contrast to the > single threaded case something like a volatile write to > ParallelMessagePending doesn't guarantee much, because

Re: Threading in BGWorkers (!)

2020-06-23 Thread Andres Freund
Hi, On 2020-06-23 09:19:36 -0400, Chapman Flack wrote: > 1) It would be nice to be able to ereport from an arbitrary thread. There >is already support in core to forward messages from parallel workers: >the worker signals the lead process after adding a message to a shm_mq >referenced

Re: Assertion failure in pg_copy_logical_replication_slot()

2020-06-23 Thread Alvaro Herrera
On 2020-Jun-23, Fujii Masao wrote: > If restart_lsn of logical replication slot gets behind more than > max_slot_wal_keep_size from the current LSN, the logical replication > slot would be invalidated and its restart_lsn is reset to an invalid LSN. > If this logical replication slot with an invali

Re: min_safe_lsn column in pg_replication_slots view

2020-06-23 Thread Alvaro Herrera
On 2020-Jun-23, Kyotaro Horiguchi wrote: > At Tue, 23 Jun 2020 11:50:34 +0530, Amit Kapila > wrote in > > On Mon, Jun 22, 2020 at 6:32 PM Fujii Masao > > wrote: > > > We should expose the LSN calculated from > > > "the current WAL LSN - max(wal_keep_segments * 16MB, > > > max_slot_wal_keep_

Re: Review for GetWALAvailability()

2020-06-23 Thread Alvaro Herrera
On 2020-Jun-16, Kyotaro Horiguchi wrote: > I saw that the "reserved" is the state where slots are working to > retain segments, and "normal" is the state to indicate that "WAL > segments are within max_wal_size", which is orthogonal to the notion > of "reserved". So it seems to me useless when th

Re: Avoiding hash join batch explosions with extreme skew and weird stats

2020-06-23 Thread Tomas Vondra
On Mon, Jun 08, 2020 at 05:12:25PM -0700, Melanie Plageman wrote: On Wed, May 27, 2020 at 7:25 PM Melanie Plageman wrote: I've attached a rebased patch which includes the "provisionally detach" deadlock hazard fix approach Alas, the "provisional detach" logic proved incorrect (see last poin

pg_bsd_indent compiles bytecode

2020-06-23 Thread Alvaro Herrera
I just noticed that when you compile pg_bsd_indent with a PG tree that has --enable-jit (or something around that), then it compiles the source files into bytecode. Obviously this is not harmful since these files don't get installed, but I wonder if our compiles aren't being excessively generous.

Re: EXPLAIN: Non-parallel ancestor plan nodes exclude parallel worker instrumentation

2020-06-23 Thread Maciek Sakrejda
On Tue, Jun 23, 2020 at 2:57 AM Amit Kapila wrote: > I don't think this is an odd situation because in this case, child > nodes like "Nested Loop" and "Parallel Seq Scan" has a value of > 'loops' as 3. So, to get the correct stats at those nodes, you need > to divide it by 3 whereas, at Gather no

Re: Extracting only the columns needed for a query

2020-06-23 Thread Melanie Plageman
On Fri, Mar 13, 2020 at 12:09 PM Dmitry Dolgov <9erthali...@gmail.com> wrote: > I've also noticed that for partitioned tables every partition is > evaluated separately. IIRC they structure cannot differ, does it > makes sense then? Good point. At some point, we had discussed only collecting the

Curious - "logical replication launcher" (PID) existed with exit code 1

2020-06-23 Thread David G. Johnston
In the following log file the presence of "exit code 1" after performing a "pg_ctl stop -m smart" shutdown is bugging me. I take it most people would just ignore it as noise but a clean install from source, startup, and shutdown would ideally not result in a non-zero exit code being sent to the lo

Re: some more pg_dump refactoring

2020-06-23 Thread Daniel Gustafsson
> On 23 Jun 2020, at 14:57, Peter Eisentraut > wrote: > > Here is a patch to reorganize dumpFunc() and dumpAgg() in pg_dump, similar to > daa9fe8a5264a3f192efa5ddee8fb011ad9da365. Instead of repeating the almost > same large query in each version branch, use one > query and add a few columns

Re: [HACKERS] Custom compression methods

2020-06-23 Thread Andres Freund
Hi, On 2020-06-23 14:27:47 -0400, Robert Haas wrote: > On Mon, Jun 22, 2020 at 4:53 PM Andres Freund wrote: > > > Or maybe we add 1 or 2 "privileged" built-in compressors that get > > > dedicated bit-patterns in the upper 2 bits of the size field, with the > > > last bit pattern being reserved fo

Re: Assertion failure in pg_copy_logical_replication_slot()

2020-06-23 Thread Fujii Masao
On 2020/06/23 18:42, Kyotaro Horiguchi wrote: At Tue, 23 Jun 2020 00:17:47 +0900, Fujii Masao wrote in Hi, If restart_lsn of logical replication slot gets behind more than max_slot_wal_keep_size from the current LSN, the logical replication slot would be invalidated and its restart_lsn is

Re: Move syncscan.c?

2020-06-23 Thread Andres Freund
Hi, On 2020-06-23 13:30:39 +1200, Thomas Munro wrote: > It's a bit odd that syncscan.c is used by both heapam.c and tableam.c, > and provides a generic block-synchronization mechanism that other > table AMs might want to use too, but it lives under > src/backend/access/heap. It doesn't actually d

Re: [HACKERS] Custom compression methods

2020-06-23 Thread Robert Haas
On Mon, Jun 22, 2020 at 4:53 PM Andres Freund wrote: > > Or maybe we add 1 or 2 "privileged" built-in compressors that get > > dedicated bit-patterns in the upper 2 bits of the size field, with the > > last bit pattern being reserved for future algorithms. (e.g. 0x00 = > > pglz, 0x01 = lz4, 0x10 =

Re: Backpatch b61d161c14 (Introduce vacuum errcontext ...)

2020-06-23 Thread Andres Freund
Hi, On 2020-06-23 00:14:40 -0400, Tom Lane wrote: > Andres Freund writes: > > I am only suggesting that where you save the old location, as currently > > done with LVRelStats olderrinfo, you instead use a more specific > > type. Not that you should pass that anywhere (except for > > update_vacuum

Re: [PATCH] Initial progress reporting for COPY command

2020-06-23 Thread Fujii Masao
On 2020/06/22 21:14, Tomas Vondra wrote: On Sun, Jun 21, 2020 at 01:40:34PM +0200, Josef Šimánek wrote: Thanks for all comments. I have updated code to support more options (including STDIN/STDOUT) and added some documentation. Patch is attached and can be found also at https://github.com/si

Re: [PATCH] Initial progress reporting for COPY command

2020-06-23 Thread Fujii Masao
On 2020/06/22 17:21, Josef Šimánek wrote: po 22. 6. 2020 v 4:48 odesílatel Fujii Masao mailto:masao.fu...@oss.nttdata.com>> napsal: On 2020/06/21 20:33, Josef Šimánek wrote: > > > po 15. 6. 2020 v 6:39 odesílatel Fujii Masao mailto:masao.fu...@oss.nttdata.com>

Re: hashagg slowdown due to spill changes

2020-06-23 Thread Andres Freund
Hi, On 2020-06-23 09:23:57 -0700, Melanie Plageman wrote: > On Mon, Jun 22, 2020 at 9:02 PM Andres Freund wrote: > > It's not this patch's fault, but none, really none, of this stuff should > > be in the executor. > > > > > Were you thinking it could be done in grouping_planner() and then the > b

Re: hashagg slowdown due to spill changes

2020-06-23 Thread Melanie Plageman
On Mon, Jun 22, 2020 at 9:02 PM Andres Freund wrote: > > > /* > > - * find_unaggregated_cols > > - * Construct a bitmapset of the column numbers of un-aggregated Vars > > - * appearing in our targetlist and qual (HAVING clause) > > + * Walk tlist and qual to find referenced colnos, divid

Re: pg_resetwal --next-transaction-id may cause database failed to restart.

2020-06-23 Thread Alvaro Herrera
On 2020-Jun-22, movead...@highgo.ca wrote: > hello hackers, > > When I try to use pg_resetwal tool to skip some transaction ID, I get a > problem that is > the tool can accept all transaction id I offered with '-x' option, however, > the database > may failed to restart because of can not read

Re: Decomposing xml into table

2020-06-23 Thread Chapman Flack
On 06/23/20 08:57, Thomas Kellerer wrote: > Surafel Temesgen schrieb am 23.06.2020 um 13:59: >>> Did you try the xmltable function? >> >> yes i know it but i am proposing changing given xml data in to >> relational form and insert it to desired table at once > Well, xmltable() does change the XML

Re: Building postgresql with higher major version of separate libpq package

2020-06-23 Thread Tom Lane
Patrik Novotny writes: > as to my recent findings, I'm not able to build postgresql 10.13 > against libpq 12.1, as in that case, postgresql is missing changes > implemented in libpq 10.12 (and 12.2) [1]. The commit you cite changed only private, internal details in libpq, so it's not apparent to

Re: Backpatch b61d161c14 (Introduce vacuum errcontext ...)

2020-06-23 Thread Justin Pryzby
On Tue, Jun 23, 2020 at 12:14:40AM -0400, Tom Lane wrote: > Andres Freund writes: > > I am only suggesting that where you save the old location, as currently > > done with LVRelStats olderrinfo, you instead use a more specific > > type. Not that you should pass that anywhere (except for > > update

Re: Internal key management system

2020-06-23 Thread Masahiko Sawada
On Fri, 19 Jun 2020 at 15:44, Fabien COELHO wrote: > > > Hello Masahiko-san, > > > What I referred to "only one key" is KEK. > > Ok, sorry, I misunderstood. > > >>> Yeah, it depends on KMS, meaning we need different extensions for > >>> different KMS. A KMS might support an interface that creates

Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions

2020-06-23 Thread Dilip Kumar
On Tue, Jun 23, 2020 at 10:13 AM Dilip Kumar wrote: > > On Tue, Jun 23, 2020 at 8:18 AM Amit Kapila wrote: > > > > On Mon, Jun 22, 2020 at 6:38 PM Dilip Kumar wrote: > > > > > > On Mon, Jun 22, 2020 at 5:26 PM Amit Kapila > > > wrote: > > > > > > > > > > @@ -2012,8 +2014,6 @@ ReorderBufferForg

Building postgresql with higher major version of separate libpq package

2020-06-23 Thread Patrik Novotny
Hello all, as to my recent findings, I'm not able to build postgresql 10.13 against libpq 12.1, as in that case, postgresql is missing changes implemented in libpq 10.12 (and 12.2) [1]. So to rebase to postgresql 10.13 on a system with a separated libpq package shipped at version 12.1, I'm require

Re: [PATCH] fix size sum table_parallelscan_estimate (src/backend/access/table/tableam.c)

2020-06-23 Thread Alvaro Herrera
On 2020-Jun-23, Ranier Vilela wrote: > Hi, > > Fix typo on sum size table_parallelscan_estimate. > If IsMVCCSnapshot(snapshot is true, add_size return is being lost. add_size() already adds, no? You don't need to add again. -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreS

Re: Threading in BGWorkers (!)

2020-06-23 Thread Chapman Flack
On 06/22/20 23:38, Tom Lane wrote: > bgworkers, or you could dispatch the threaded work to a non-Postgres-ish > process as PL/Java does. The only advantage I can see of doing work in a > process that's not at arm's-length is to have access to PG computational > or IPC facilities, and none of that

Re: Resetting spilled txn statistics in pg_stat_replication

2020-06-23 Thread Amit Kapila
On Tue, Jun 23, 2020 at 3:48 PM Tomas Vondra wrote: > > On Tue, Jun 23, 2020 at 10:58:18AM +0530, Amit Kapila wrote: > >On Tue, Jun 23, 2020 at 9:32 AM Masahiko Sawada > > wrote: > >> > >> On Sun, 21 Jun 2020 at 06:57, Tomas Vondra > >> wrote: > >> > > >> > > > >> > >What if the decoding has bee

Re: Decomposing xml into table

2020-06-23 Thread Andreas Karlsson
On 6/22/20 8:49 PM, Surafel Temesgen wrote: Comments? I feel it would make more sense to add features like this to an external tool, e.g pgloader. But even if we add it to the core PostgreSQL project I feel the XML parsing should be done in the client, not in the database server. The COPY co

Re: Decomposing xml into table

2020-06-23 Thread Thomas Kellerer
Surafel Temesgen schrieb am 23.06.2020 um 13:59: >> Did you try the xmltable function? > > yes i know it but i am proposing changing given xml data in to > relational form and insert it to desired table at once Well, xmltable() does change the XML data to a relational form and the result can direc

some more pg_dump refactoring

2020-06-23 Thread Peter Eisentraut
Here is a patch to reorganize dumpFunc() and dumpAgg() in pg_dump, similar to daa9fe8a5264a3f192efa5ddee8fb011ad9da365. Instead of repeating the almost same large query in each version branch, use one query and add a few columns to the SELECT list depending on the version. This saves a lot of

Re: [PATCH] Initial progress reporting for COPY command

2020-06-23 Thread Bharath Rupireddy
> po 15. 6. 2020 v 7:34 odesílatel Bharath Rupireddy > napsal: >> >> > I'm using ftell to get current position in file to populate >> > file_bytes_processed without error handling (ftell can return -1L and also >> > populate errno on problems). >> > >> > 1. Is that a good way to get progress of

[PATCH] fix size sum table_parallelscan_estimate (src/backend/access/table/tableam.c)

2020-06-23 Thread Ranier Vilela
Hi, Fix typo on sum size table_parallelscan_estimate. If IsMVCCSnapshot(snapshot is true, add_size return is being lost. regards, Ranier Vilela fix_table_parallelscan_estimate_size.patch Description: Binary data

Re: Decomposing xml into table

2020-06-23 Thread Surafel Temesgen
Hey Tom On Mon, Jun 22, 2020 at 10:13 PM Tom Lane wrote: > Big -1 on that. COPY is not for general-purpose data transformation. > The more unrelated features we load onto it, the slower it will get, > and probably also the more buggy and unmaintainable. what new format handling takes to add r

Re: [PATCH] Initial progress reporting for COPY command

2020-06-23 Thread Josef Šimánek
út 23. 6. 2020 v 13:15 odesílatel Tomas Vondra napsal: > On Tue, Jun 23, 2020 at 03:40:08PM +0530, vignesh C wrote: > >On Mon, Jun 22, 2020 at 4:28 PM Josef Šimánek > wrote: > >> > >> Thanks for the hint regarding "CopyReadLineText". I'll take a look. > >> > >> For now I have tested those cases:

Re: Decomposing xml into table

2020-06-23 Thread Pavel Stehule
út 23. 6. 2020 v 13:59 odesílatel Surafel Temesgen napsal: > hey Pavel > > On Mon, Jun 22, 2020 at 9:59 PM Pavel Stehule > wrote: > >> >> Did you try the xmltable function? >> >> > yes i know it but i am proposing changing given xml data in to relational > form and insert it to desired table at

Re: [PATCH] Initial progress reporting for COPY command

2020-06-23 Thread Pavel Stehule
út 23. 6. 2020 v 13:15 odesílatel Tomas Vondra napsal: > On Tue, Jun 23, 2020 at 03:40:08PM +0530, vignesh C wrote: > >On Mon, Jun 22, 2020 at 4:28 PM Josef Šimánek > wrote: > >> > >> Thanks for the hint regarding "CopyReadLineText". I'll take a look. > >> > >> For now I have tested those cases:

Re: Decomposing xml into table

2020-06-23 Thread Surafel Temesgen
hey Pavel On Mon, Jun 22, 2020 at 9:59 PM Pavel Stehule wrote: > > Did you try the xmltable function? > > yes i know it but i am proposing changing given xml data in to relational form and insert it to desired table at once regards Surafel

Re: [PATCH] Initial progress reporting for COPY command

2020-06-23 Thread Tomas Vondra
On Tue, Jun 23, 2020 at 03:40:08PM +0530, vignesh C wrote: On Mon, Jun 22, 2020 at 4:28 PM Josef Šimánek wrote: Thanks for the hint regarding "CopyReadLineText". I'll take a look. For now I have tested those cases: CREATE TABLE test(id int); INSERT INTO test SELECT 1 FROM generate_series(1,

Re: Parallel Seq Scan vs kernel read ahead

2020-06-23 Thread Ranier Vilela
Em seg., 22 de jun. de 2020 às 23:29, David Rowley escreveu: > On Tue, 23 Jun 2020 at 07:33, Robert Haas wrote: > > On Mon, Jun 22, 2020 at 12:47 PM Ranier Vilela > wrote: > > > Questions: > > > 1. Why acquire and release lock in retry: loop. > > > > This is a super-bad idea. Note the coding ru

Re: TAP tests and symlinks on Windows

2020-06-23 Thread Michael Paquier
On Wed, Jun 17, 2020 at 04:44:34PM +0900, Michael Paquier wrote: > Okay. This could be a problem as jacana is proving to have good > coverage AFAIK. So it looks like we are really heading in the > direction is still skipping the test if there is no support for > symlink in the environment. At lea

Re: Resetting spilled txn statistics in pg_stat_replication

2020-06-23 Thread Tomas Vondra
On Tue, Jun 23, 2020 at 10:58:18AM +0530, Amit Kapila wrote: On Tue, Jun 23, 2020 at 9:32 AM Masahiko Sawada wrote: On Sun, 21 Jun 2020 at 06:57, Tomas Vondra wrote: > > > > >What if the decoding has been performed by multiple backends using the > >same slot? In that case, it will be difficu

Re: [PATCH] Initial progress reporting for COPY command

2020-06-23 Thread vignesh C
On Mon, Jun 22, 2020 at 4:28 PM Josef Šimánek wrote: > > Thanks for the hint regarding "CopyReadLineText". I'll take a look. > > For now I have tested those cases: > > CREATE TABLE test(id int); > INSERT INTO test SELECT 1 FROM generate_series(1, 100); > COPY (SELECT * FROM test) TO '/tmp/ids'

Re: EXPLAIN: Non-parallel ancestor plan nodes exclude parallel worker instrumentation

2020-06-23 Thread Amit Kapila
On Tue, Jun 23, 2020 at 12:55 AM Maciek Sakrejda wrote: > > Hello, > > I had some questions about the behavior of some accounting in parallel > EXPLAIN plans. Take the following plan: > > ``` > Gather (cost=1000.43..750173.74 rows=2 width=235) (actual > time=1665.122..1665.122 rows=0 loops=1) >

Re: proposal: unescape_text function

2020-06-23 Thread Pavel Stehule
po 22. 6. 2020 v 5:48 odesílatel Pavel Stehule napsal: > Hi > > There is one user request for unescape function in core. > > > https://stackoverflow.com/questions/20124393/convert-escaped-unicode-character-back-to-actual-character-in-postgresql/20125412?noredirect=1#comment110502526_20125412 > >

Re: BUG #15293: Stored Procedure Triggered by Logical Replication is Unable to use Notification Events

2020-06-23 Thread Daniel Danzberger
On Fri, 2019-06-28 at 17:22 -0400, Alvaro Herrera wrote: > On 2019-Feb-22, Robert Welin wrote: > > > I have reproduced this bug on PostgreSQL version 10.7 and 11.2 > > using the > > steps described in Michael Powers' original report. The issue also > > still > > seems to be present even with the p

Re: Assertion failure in pg_copy_logical_replication_slot()

2020-06-23 Thread Kyotaro Horiguchi
At Tue, 23 Jun 2020 00:17:47 +0900, Fujii Masao wrote in > Hi, > > If restart_lsn of logical replication slot gets behind more than > max_slot_wal_keep_size from the current LSN, the logical replication > slot would be invalidated and its restart_lsn is reset to an invalid > LSN. > If this logi

Re: Review for GetWALAvailability()

2020-06-23 Thread Kyotaro Horiguchi
Thanks for looking this. At Fri, 19 Jun 2020 18:23:59 -0400, Alvaro Herrera wrote in > On 2020-Jun-17, Kyotaro Horiguchi wrote: > > > @@ -9524,7 +9533,7 @@ GetWALAvailability(XLogRecPtr targetLSN) > > * the first WAL segment file since startup, which causes the status > > being > >

Re: min_safe_lsn column in pg_replication_slots view

2020-06-23 Thread Kyotaro Horiguchi
At Tue, 23 Jun 2020 11:50:34 +0530, Amit Kapila wrote in > On Mon, Jun 22, 2020 at 6:32 PM Fujii Masao > wrote: > > > > On 2020/06/22 21:01, Amit Kapila wrote: > > > On Mon, Jun 22, 2020 at 11:19 AM Michael Paquier > > > wrote: > > >> > > >> On Sat, Jun 20, 2020 at 03:53:54PM +0900, Michael

Re: Threading in BGWorkers (!)

2020-06-23 Thread James Sewell
On Tue, 23 Jun 2020 at 17:26, Konstantin Knizhnik wrote: > On 23.06.2020 10:15, James Sewell wrote: > > Using multithreading in bgworker is possible if you do not use any >> Postgres runtime inside thread procedures or do it in exclusive critical >> section. >> It is not so convenient but possibl

Re: Threading in BGWorkers (!)

2020-06-23 Thread Konstantin Knizhnik
On 23.06.2020 10:15, James Sewell wrote: Using multithreading in bgworker is possible if you do not use any Postgres runtime inside thread procedures or do it in exclusive critical section. It is not so convenient but possible. The most difficult thing from my point

Re: Threading in BGWorkers (!)

2020-06-23 Thread James Sewell
On Tue, 23 Jun 2020 at 17:15, James Sewell wrote: > Using multithreading in bgworker is possible if you do not use any >> Postgres runtime inside thread procedures or do it in exclusive critical >> section. >> It is not so convenient but possible. The most difficult thing from my >> point of view

Re: Threading in BGWorkers (!)

2020-06-23 Thread James Sewell
> Using multithreading in bgworker is possible if you do not use any > Postgres runtime inside thread procedures or do it in exclusive critical > section. > It is not so convenient but possible. The most difficult thing from my > point of view is error reporting. > Happy to be proved wrong, but I

Re: Threading in BGWorkers (!)

2020-06-23 Thread Konstantin Knizhnik
On 23.06.2020 06:38, Tom Lane wrote: James Sewell writes: I was talking about PostgreSQL and threading on IRC the other day - which I know is a frowned upon topic - and just wanted to frame the same questions here and hopefully get a discussion going. I think the short answer about threadin