Re: Resetting spilled txn statistics in pg_stat_replication

2020-06-17 Thread Amit Kapila
On Thu, Jun 18, 2020 at 8:01 AM Masahiko Sawada wrote: > > On Wed, 17 Jun 2020 at 20:14, Amit Kapila wrote: > > > > > > I had written above in the context of persisting these stats. I mean > > to say if the process has bounced or server has restarted then the > > previous stats might not make mu

回复:回复:回复:回复:how to create index concurrently on partitioned table

2020-06-17 Thread 李杰(慎追)
> Not sure I am following. In the case of REINDEX, it seems to me that > the calls to validate_index() and index_concurrently_build() can > happen in a separate transaction for each index, as long as all the > calls to index_concurrently_swap() are grouped together in the same > transaction to mak

Re: min_safe_lsn column in pg_replication_slots view

2020-06-17 Thread Kyotaro Horiguchi
Thanks for the comments. At Wed, 17 Jun 2020 21:37:55 +0900, Fujii Masao wrote in > On 2020/06/15 16:35, Kyotaro Horiguchi wrote: > > At Mon, 15 Jun 2020 13:44:31 +0900, Michael Paquier > > wrote in > >> On Mon, Jun 15, 2020 at 12:40:03PM +0900, Fujii Masao wrote: > >>> BTW, I just wonder why

Re: Fast DSM segments

2020-06-17 Thread Thomas Munro
On Thu, Jun 11, 2020 at 5:37 AM Robert Haas wrote: > On Tue, Jun 9, 2020 at 6:03 PM Thomas Munro wrote: > > That all makes sense. Now I'm wondering if I should use exactly that > > word in the GUC... dynamic_shared_memory_preallocate? > > I tend to prefer verb-object rather than object-verb word

Re: Review for GetWALAvailability()

2020-06-17 Thread Fujii Masao
On 2020/06/18 14:40, Fujii Masao wrote: On 2020/06/18 11:44, Kyotaro Horiguchi wrote: At Wed, 17 Jun 2020 20:13:01 +0900, Fujii Masao wrote in ReplicationSlotAcquireInternal.  I think we should call ConditionVariablePrepareToSleep before the sorrounding for statement block. OK, so what

Re: Review for GetWALAvailability()

2020-06-17 Thread Fujii Masao
On 2020/06/18 11:44, Kyotaro Horiguchi wrote: At Wed, 17 Jun 2020 20:13:01 +0900, Fujii Masao wrote in ReplicationSlotAcquireInternal. I think we should call ConditionVariablePrepareToSleep before the sorrounding for statement block. OK, so what about the attached patch? I added Condition

Re: Binary transfer vs Text transfer

2020-06-17 Thread Aleksei Ivanov
Hi, Thanks for the attached link, but I also noticed using iftop, that during fetching the data there is almost no delay using text transfer, while there is several seconds in delay before data is starting fetching using binary transfer. Could you suggest where can I have a look to resolve it or d

RE: I'd like to discuss scaleout at PGCon

2020-06-17 Thread tsunakawa.ta...@fujitsu.com
Hello, It seems you didn't include pgsql-hackers. From: Sumanta Mukherjee > I saw the presentation and it is great except that it seems to be unclear of > both SD and SN if the storage and the compute are being explicitly > separated. Separation of storage and compute would have some cost a

Re: More tzdb fun: POSIXRULES is being deprecated upstream

2020-06-17 Thread Tom Lane
I wrote: > The minimum thing that we have to do, I'd say, is to change the > documentation to explain what happens if there's no posixrules file. Here's a proposed patch to do that. To explain this, we more or less have to fully document the POSIX timezone string format (otherwise nobody's gonna

Re: [Patch] ALTER SYSTEM READ ONLY

2020-06-17 Thread amul sul
On Wed, Jun 17, 2020 at 8:15 PM Robert Haas wrote: > > On Wed, Jun 17, 2020 at 9:51 AM tushar wrote: > > 1) ALTER SYSTEM > > > > postgres=# alter system read only; > > ALTER SYSTEM > > postgres=# alter system reset all; > > ALTER SYSTEM > > postgres=# create table t1(n int); > > ERROR: cannot e

Re: [Patch] ALTER SYSTEM READ ONLY

2020-06-17 Thread amul sul
On Wed, Jun 17, 2020 at 8:12 PM Robert Haas wrote: > > On Wed, Jun 17, 2020 at 9:02 AM Amit Kapila wrote: > > Do we prohibit the checkpointer to write dirty pages and write a > > checkpoint record as well? If so, will the checkpointer process > > writes the current dirty pages and writes a check

Re: [PATCH] Add support for choosing huge page size

2020-06-17 Thread Thomas Munro
Hi Odin, Documentation syntax error "2MB" shows up as: config.sgml:1605: parser error : Opening and ending tag mismatch: literal line 1602 and para ^ Please install the documentation tools https://www.postgresql.org/docs/devel/docguide-toolsets.html, rerun configure and "ma

Re: Creating a function for exposing memory usage of backend process

2020-06-17 Thread Fujii Masao
On 2020/06/17 22:00, torikoshia wrote: Hi, As you may know better than I do, backend processes sometimes use a lot of memory because of the various reasons like caches, prepared statements and cursors. When supporting PostgreSQL, I face situations for investigating the reason of memory bloat.

Missing HashAgg EXPLAIN ANALYZE details for parallel plans

2020-06-17 Thread David Rowley
Hi, Now that HashAgg can spill to disk, we see a few more details in EXPLAIN ANALYZE than we did previously, e.g. Peak Memory Usage, Disk Usage. However, the new code neglected to make EXPLAIN ANALYZE show these new details for parallel workers. Additionally, the new properties all were using Ex

Re: Transactions involving multiple postgres foreign servers, take 2

2020-06-17 Thread Tatsuo Ishii
>> My concern is, FDW+2PC without atomic visibility could lead to data >> inconsistency among servers in some cases. If my understanding is >> correct, FDW+2PC (without atomic visibility) cannot prevent data >> inconsistency in the case below. Initially table t1 has only one row >> with i = 0 on bo

Re: Review for GetWALAvailability()

2020-06-17 Thread Kyotaro Horiguchi
At Wed, 17 Jun 2020 20:13:01 +0900, Fujii Masao wrote in > > ReplicationSlotAcquireInternal. I think we should call > > ConditionVariablePrepareToSleep before the sorrounding for statement > > block. > > OK, so what about the attached patch? I added > ConditionVariablePrepareToSleep() > just b

Re: 回复:回复:回复:how to create index concurrently on partitioned table

2020-06-17 Thread Michael Paquier
On Wed, Jun 17, 2020 at 10:22:28PM +0800, 李杰(慎追) wrote: > However, I found a problem. If there are many partitions, > we may need to handle too many missing index entries when > validate_index(). Especially for the first partition, the time may > have been long and many entries are missing. In t

Re: Resetting spilled txn statistics in pg_stat_replication

2020-06-17 Thread Masahiko Sawada
On Wed, 17 Jun 2020 at 20:14, Amit Kapila wrote: > > On Wed, Jun 17, 2020 at 1:34 PM Masahiko Sawada > wrote: > > > > On Sat, 13 Jun 2020 at 14:23, Amit Kapila wrote: > > > > > > On Fri, Jun 12, 2020 at 6:11 PM Magnus Hagander > > > wrote: > > > > > > > > On Fri, Jun 12, 2020 at 10:23 AM Amit

Re: Transactions involving multiple postgres foreign servers, take 2

2020-06-17 Thread Masahiko Sawada
On Thu, 18 Jun 2020 at 08:31, Tatsuo Ishii wrote: > > > okay, so it seems we need few things which middleware (Pangea) expects > > if we have to follow the design of paper. > > Yes. > > > I haven't read the paper completely but it sounds quite restrictive > > (like both commits and snapshots need

Re: pg_regress cleans up tablespace twice.

2020-06-17 Thread Michael Paquier
On Wed, Jun 17, 2020 at 05:02:31PM +0900, Kyotaro Horiguchi wrote: > It look good to me as the Windows part. I agree that vcregress.pl > don't need to parse EXTRA_REGRESS_OPTS by allowing a bit more tight > bond between the caller sites of pg_regress and pg_regress. Thanks, applied this part to HE

Re: Review for GetWALAvailability()

2020-06-17 Thread Fujii Masao
On 2020/06/18 3:04, Alvaro Herrera wrote: I think passing the slot name when the slot is also passed is useless and wasteful; it'd be better to pass NULL for the name and ignore the strcmp() in that case -- in fact I suggest to forbid passing both name and slot. (Any failure there would risk

Re: Improve planner cost estimations for alternative subplans

2020-06-17 Thread Melanie Plageman
On Fri, Jun 5, 2020 at 9:08 AM Alexey Bashtanov wrote: > > In [1] we found a situation where it leads to a suboptimal plan, > as it bloats the overall cost into large figures, > a decision related to an outer part of the plan look negligible to the > planner, > and as a result it doesn't elaborat

Re: DROP relation IF EXISTS Docs and Tests - Bug Fix

2020-06-17 Thread David G. Johnston
On Wed, Jun 17, 2020 at 4:32 PM Tom Lane wrote: > "David G. Johnston" writes: > > I'm firmly of the belief that the existing behavior of DROP relation IF > > EXISTS is flawed - it should not be an error if there is a namespace > > collision but the relkind of the existing relation doesn't match

Re: DROP relation IF EXISTS Docs and Tests - Bug Fix

2020-06-17 Thread Tom Lane
"David G. Johnston" writes: > I'm firmly of the belief that the existing behavior of DROP relation IF > EXISTS is flawed - it should not be an error if there is a namespace > collision but the relkind of the existing relation doesn't match the > relkind set by the DROP command. I don't particular

Re: Transactions involving multiple postgres foreign servers, take 2

2020-06-17 Thread Tatsuo Ishii
> okay, so it seems we need few things which middleware (Pangea) expects > if we have to follow the design of paper. Yes. > I haven't read the paper completely but it sounds quite restrictive > (like both commits and snapshots need to wait). Maybe. There is a performance evaluation in the paper.

Minor issue with deduplication's single value strategy

2020-06-17 Thread Peter Geoghegan
nbtdedup.c's "single value strategy" is used when we have a leaf page that is full of duplicates of the same value. We infer that we will have many more in the future, and cooperate with the "single value strategy" used within nbtsplitloc.c. Deduplication should create 6 large posting list tuples

DROP relation IF EXISTS Docs and Tests - Bug Fix

2020-06-17 Thread David G. Johnston
This is a follow-up to Bug # 16492 which also links to a thread sent to -hackers back in 2018. I'm firmly of the belief that the existing behavior of DROP relation IF EXISTS is flawed - it should not be an error if there is a namespace collision but the relkind of the existing relation doesn't mat

Re: language cleanups in code and docs

2020-06-17 Thread Bruce Momjian
On Wed, Jun 17, 2020 at 01:59:26PM -0400, Robert Haas wrote: > On Mon, Jun 15, 2020 at 2:23 PM Andres Freund wrote: > > 0002: code: s/master/primary/ > > 0003: code: s/master/leader/ > > 0006: docs: s/master/root/ > > 0007: docs: s/master/supervisor/ > > I'd just like to make the pointer here tha

Re: global barrier & atomics in signal handlers (Re: Atomic operations within spinlocks)

2020-06-17 Thread Tom Lane
Robert Haas writes: > On Wed, Jun 17, 2020 at 3:45 PM Tom Lane wrote: >> The macros are kind of necessary unless you want to make s_lock.h >> a bunch messier, because we use #ifdef tests on them. > Where? See the "Default Definitions", down near the end. >> We could get rid of the double layer

Re: global barrier & atomics in signal handlers (Re: Atomic operations within spinlocks)

2020-06-17 Thread Robert Haas
On Wed, Jun 17, 2020 at 3:45 PM Tom Lane wrote: > Robert Haas writes: > > This seems like it's straight out of the department of pointless > > abstraction layers. Maybe we should remove all of the S_WHATEVER() > > stuff and just define SpinLockAcquire() where we currently define > > S_LOCK(), Spi

Re: global barrier & atomics in signal handlers (Re: Atomic operations within spinlocks)

2020-06-17 Thread Tom Lane
Robert Haas writes: > This seems like it's straight out of the department of pointless > abstraction layers. Maybe we should remove all of the S_WHATEVER() > stuff and just define SpinLockAcquire() where we currently define > S_LOCK(), SpinLockRelease() where we currently define S_UNLOCK(), etc. >

Re: global barrier & atomics in signal handlers (Re: Atomic operations within spinlocks)

2020-06-17 Thread Robert Haas
On Wed, Jun 17, 2020 at 2:33 PM Andres Freund wrote: > > It seems odd and confusing that we have both > > S_LOCK() and s_lock(), anyway. Differentiating functions based on case > > is not great practice. > > It's a terrible idea, yes. Since we don't actually have any non-default > implementation

Re: Binary transfer vs Text transfer

2020-06-17 Thread Andres Freund
Hi, On 2020-06-17 11:55:44 -0700, Aleksei Ivanov wrote: > I have one question related to my current measurements results. > > I am fetching integers in text format like: > > Select * from table limit 1000. It take 18.5 seconds to finish and the > transfer data is 633 MB. > > When I fetchin

Binary transfer vs Text transfer

2020-06-17 Thread Aleksei Ivanov
Hello, colleagues, I have one question related to my current measurements results. I am fetching integers in text format like: Select * from table limit 1000. It take 18.5 seconds to finish and the transfer data is 633 MB. When I fetching the same data using binary cursor, the transfer data

Re: Review for GetWALAvailability()

2020-06-17 Thread Alvaro Herrera
On 2020-Jun-17, Kyotaro Horiguchi wrote: > @@ -342,7 +351,14 @@ pg_get_replication_slots(PG_FUNCTION_ARGS) > else > nulls[i++] = true; > > - walstate = GetWALAvailability(slot_contents.data.restart_lsn); > + /* use last_invalidated_lsn

Re: global barrier & atomics in signal handlers (Re: Atomic operations within spinlocks)

2020-06-17 Thread Andres Freund
Hi, On 2020-06-17 10:34:31 -0400, Robert Haas wrote: > On Tue, Jun 16, 2020 at 3:28 PM Andres Freund wrote: > > > I think 0003 looks a little strange: it seems to be > > > testing things that might be implementation details of other things, > > > and I'm not sure that's really correct. In particu

Re: language cleanups in code and docs

2020-06-17 Thread Andres Freund
Hi, On 2020-06-17 13:59:26 -0400, Robert Haas wrote: > On Mon, Jun 15, 2020 at 2:23 PM Andres Freund wrote: > > 0002: code: s/master/primary/ > > 0003: code: s/master/leader/ > > 0006: docs: s/master/root/ > > 0007: docs: s/master/supervisor/ > > I'd just like to make the pointer here that there

Re: language cleanups in code and docs

2020-06-17 Thread Tom Lane
Robert Haas writes: > On Mon, Jun 15, 2020 at 2:23 PM Andres Freund wrote: >> 0002: code: s/master/primary/ >> 0003: code: s/master/leader/ >> 0006: docs: s/master/root/ >> 0007: docs: s/master/supervisor/ > I'd just like to make the pointer here that there's value in trying to > use different t

Re: [patch] demote

2020-06-17 Thread Andres Freund
Hi, On 2020-06-17 17:44:51 +0200, Jehan-Guillaume de Rorthais wrote: > As Amul sent a patch about "ALTER SYSTEM READ ONLY"[1], with similar futur > objectives than mine, I decided to share the humble patch I am playing with to > step down an instance from primary to standby status. To make sure w

Re: More tzdb fun: POSIXRULES is being deprecated upstream

2020-06-17 Thread Tom Lane
Last year I wrote: > Paul Eggert, in https://mm.icann.org/pipermail/tz/2019-June/028172.html: >> zic’s -p option was intended as a transition from historical >> System V code that treated TZ="XXXnYYY" as meaning US >> daylight-saving rules in a time zone n hours west of UT, >> with XXX abbreviating

Re: [Patch] ALTER SYSTEM READ ONLY

2020-06-17 Thread Andres Freund
Hi, On 2020-06-17 12:07:22 -0400, Robert Haas wrote: > On Wed, Jun 17, 2020 at 10:58 AM Tom Lane wrote: > > I also think that putting such a thing into ALTER SYSTEM has got big > > logical problems. Someday we will probably want to have ALTER SYSTEM > > write WAL so that standby servers can abso

Re: Review for GetWALAvailability()

2020-06-17 Thread Alvaro Herrera
I think passing the slot name when the slot is also passed is useless and wasteful; it'd be better to pass NULL for the name and ignore the strcmp() in that case -- in fact I suggest to forbid passing both name and slot. (Any failure there would risk raising an error during checkpoint, which is un

Re: language cleanups in code and docs

2020-06-17 Thread Robert Haas
On Mon, Jun 15, 2020 at 2:23 PM Andres Freund wrote: > 0002: code: s/master/primary/ > 0003: code: s/master/leader/ > 0006: docs: s/master/root/ > 0007: docs: s/master/supervisor/ I'd just like to make the pointer here that there's value in trying to use different terminology for different things

Re: [Patch] ALTER SYSTEM READ ONLY

2020-06-17 Thread Robert Haas
On Wed, Jun 17, 2020 at 12:45 PM Tom Lane wrote: > > Writing hint bits and marking index tuples as killed do not write WAL > > unless checksums are enabled. > > And your point is? I thought enabling checksums was considered > good practice these days. I don't want to have an argument about what

Re: [Patch] ALTER SYSTEM READ ONLY

2020-06-17 Thread Tom Lane
Robert Haas writes: > On Wed, Jun 17, 2020 at 12:27 PM Tom Lane wrote: >> Which of the things I mentioned don't require writing WAL? > Writing hint bits and marking index tuples as killed do not write WAL > unless checksums are enabled. And your point is? I thought enabling checksums was consi

Re: [Patch] ALTER SYSTEM READ ONLY

2020-06-17 Thread Robert Haas
On Wed, Jun 17, 2020 at 12:27 PM Tom Lane wrote: > Which of the things I mentioned don't require writing WAL? Writing hint bits and marking index tuples as killed do not write WAL unless checksums are enabled. > You're right that these are the same things that we already forbid on a > standby, f

Re: [patch] demote

2020-06-17 Thread Robert Haas
On Wed, Jun 17, 2020 at 11:45 AM Jehan-Guillaume de Rorthais wrote: > As Amul sent a patch about "ALTER SYSTEM READ ONLY"[1], with similar futur > objectives than mine, I decided to share the humble patch I am playing with to > step down an instance from primary to standby status. Cool! This was

Re: [Patch] ALTER SYSTEM READ ONLY

2020-06-17 Thread Tom Lane
Robert Haas writes: > This seems like pretty dubious hand-waving. Of course, things that > write WAL are going to be broken by a switch that prevents writing > WAL; but if they were not, there would be no purpose in having such a > switch, so that's not really an argument. But you seem to have mix

Re: language cleanups in code and docs

2020-06-17 Thread David Steele
On 6/17/20 12:08 PM, Magnus Hagander wrote: On Wed, Jun 17, 2020 at 4:15 PM Andrew Dunstan mailto:andrew.duns...@2ndquadrant.com>> I'm not sure I like doing s/Black/Block/ here. It reads oddly. There are too many other uses of Block in the sources. Forbidden might be a better subst

Re: language cleanups in code and docs

2020-06-17 Thread Jonathan S. Katz
On 6/17/20 12:08 PM, Magnus Hagander wrote: > > > On Wed, Jun 17, 2020 at 4:15 PM Andrew Dunstan > mailto:andrew.duns...@2ndquadrant.com>> > wrote: > > > On 6/17/20 6:32 AM, Magnus Hagander wrote: > > > > > > > > > > > > In looking at this I realize we also have exac

Re: language cleanups in code and docs

2020-06-17 Thread Magnus Hagander
On Wed, Jun 17, 2020 at 4:15 PM Andrew Dunstan < andrew.duns...@2ndquadrant.com> wrote: > > On 6/17/20 6:32 AM, Magnus Hagander wrote: > > > > > > > > > > > > In looking at this I realize we also have exactly one thing referred > > to as "blacklist" in our codebase, which is the "enum blacklist" (

Re: language cleanups in code and docs

2020-06-17 Thread Andrew Dunstan
On 6/17/20 11:00 AM, Tom Lane wrote: > Andrew Dunstan writes: >> On 6/17/20 6:32 AM, Magnus Hagander wrote: >>> In looking at this I realize we also have exactly one thing referred >>> to as "blacklist" in our codebase, which is the "enum blacklist" (and >>> then a small internal variable in pgi

Re: [Patch] ALTER SYSTEM READ ONLY

2020-06-17 Thread Robert Haas
On Wed, Jun 17, 2020 at 10:58 AM Tom Lane wrote: > Aside from the points you mention, such a switch would break autovacuum. > It would break the ability for scans to do HOT-chain cleanup, which would > likely lead to some odd behaviors (if, eg, somebody flips the switch > between where that's supp

Re: improving basebackup.c's file-reading code

2020-06-17 Thread Robert Haas
On Wed, Apr 29, 2020 at 5:52 AM Hamid Akhtar wrote: > The idea and the patch looks good to me. > > It makes sense to change fread to basebackup_read_file which internally calls > pg_pread which is a portable function as opposed to read. As you've > mentioned, this is much better for error handli

[patch] demote

2020-06-17 Thread Jehan-Guillaume de Rorthais
Hi, As Amul sent a patch about "ALTER SYSTEM READ ONLY"[1], with similar futur objectives than mine, I decided to share the humble patch I am playing with to step down an instance from primary to standby status. I'm still wondering about the coding style, but as the discussion about this kind of

Re: jsonpath versus NaN

2020-06-17 Thread Tom Lane
Alexander Korotkov writes: > On Thu, Jun 11, 2020 at 10:00 PM Tom Lane wrote: >> I don't think this is very relevant. The SQL standard has not got the >> concepts of Inf or NaN either (see 4.4.2 Characteristics of numbers), >> therefore their definition is only envisioning that a string represen

Re: tablespace_map code cleanup

2020-06-17 Thread Robert Haas
On Wed, May 27, 2020 at 8:11 PM Kyotaro Horiguchi wrote: > That makes sense to me. Thanks! Great. Thanks to you and Amit for reviewing. I have committed the patches. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: language cleanups in code and docs

2020-06-17 Thread Tom Lane
Andrew Dunstan writes: > On 6/17/20 6:32 AM, Magnus Hagander wrote: >> In looking at this I realize we also have exactly one thing referred >> to as "blacklist" in our codebase, which is the "enum blacklist" (and >> then a small internal variable in pgindent). AFAICT, it's not actually >> exposed

Re: [Patch] ALTER SYSTEM READ ONLY

2020-06-17 Thread Tom Lane
Amit Kapila writes: > On Tue, Jun 16, 2020 at 7:26 PM amul sul wrote: >> Attached patch proposes $Subject feature which forces the system into >> read-only >> mode where insert write-ahead log will be prohibited until ALTER SYSTEM READ >> WRITE executed. > Do we prohibit the checkpointer to wri

Re: [Patch] ALTER SYSTEM READ ONLY

2020-06-17 Thread Robert Haas
On Wed, Jun 17, 2020 at 9:51 AM tushar wrote: > 1) ALTER SYSTEM > > postgres=# alter system read only; > ALTER SYSTEM > postgres=# alter system reset all; > ALTER SYSTEM > postgres=# create table t1(n int); > ERROR: cannot execute CREATE TABLE in a read-only transaction > > Initially i thought a

Re: [Patch] ALTER SYSTEM READ ONLY

2020-06-17 Thread Robert Haas
On Wed, Jun 17, 2020 at 9:02 AM Amit Kapila wrote: > Do we prohibit the checkpointer to write dirty pages and write a > checkpoint record as well? If so, will the checkpointer process > writes the current dirty pages and writes a checkpoint record or we > skip that as well? I think the definitio

Re: global barrier & atomics in signal handlers (Re: Atomic operations within spinlocks)

2020-06-17 Thread Robert Haas
On Tue, Jun 16, 2020 at 3:28 PM Andres Freund wrote: > > I think 0003 looks a little strange: it seems to be > > testing things that might be implementation details of other things, > > and I'm not sure that's really correct. In particular: > > My main motivation was to have something that runs mo

回复:回复:回复:how to create index concurrently on partitioned table

2020-06-17 Thread 李杰(慎追)
> We can refer to the implementation in the ReindexRelationConcurrently, > in the three phases of the REINDEX CONCURRENTLY, > all indexes of the partitions are operated one by one in each phase. > In this way, we can maintain the consistency of the entire partitioned table > index. > After we impl

Re: language cleanups in code and docs

2020-06-17 Thread Andrew Dunstan
On 6/17/20 6:32 AM, Magnus Hagander wrote: > > > > > > In looking at this I realize we also have exactly one thing referred > to as "blacklist" in our codebase, which is the "enum blacklist" (and > then a small internal variable in pgindent). AFAICT, it's not actually > exposed to userspace anywh

Re: [PATCH] Missing links between system catalog documentation pages

2020-06-17 Thread Dagfinn Ilmari Mannsåker
Fabien COELHO writes: > Hello Dagfinn, > >>> The attached patch makes the first mention of another system catalog or >>> view (as well as pg_hba.conf in pg_hba_file_lines) a link, for easier >>> navigation. > > Why only the first mention? It seems unlikely that I would ever read > such chapter li

Re: [Patch] ALTER SYSTEM READ ONLY

2020-06-17 Thread tushar
On 6/16/20 7:25 PM, amul sul wrote: Attached patch proposes $Subject feature which forces the system into read-only mode where insert write-ahead log will be prohibited until ALTER SYSTEM READ WRITE executed. Thanks Amul. 1) ALTER SYSTEM postgres=# alter system read only; ALTER SYSTEM postg

Re: language cleanups in code and docs

2020-06-17 Thread Jonathan S. Katz
On 6/17/20 6:06 AM, Laurenz Albe wrote: > On Tue, 2020-06-16 at 19:55 -0400, Tom Lane wrote: >> Andrew Dunstan writes: >>> On 6/15/20 2:22 PM, Andres Freund wrote: 2) 'master' as a reference to the branch. Personally I be in favor of changing the branch name, but it seems like it'd be be

Re: language cleanups in code and docs

2020-06-17 Thread Jonathan S. Katz
On 6/17/20 6:32 AM, Magnus Hagander wrote: > In looking at this I realize we also have exactly one thing referred to > as "blacklist" in our codebase, which is the "enum blacklist" (and then > a small internal variable in pgindent). AFAICT, it's not actually > exposed to userspace anywhere, so we

Re: [Patch] ALTER SYSTEM READ ONLY

2020-06-17 Thread Amit Kapila
On Tue, Jun 16, 2020 at 7:26 PM amul sul wrote: > > Hi, > > Attached patch proposes $Subject feature which forces the system into > read-only > mode where insert write-ahead log will be prohibited until ALTER SYSTEM READ > WRITE executed. > > The high-level goal is to make the availability/scale-

Creating a function for exposing memory usage of backend process

2020-06-17 Thread torikoshia
Hi, As you may know better than I do, backend processes sometimes use a lot of memory because of the various reasons like caches, prepared statements and cursors. When supporting PostgreSQL, I face situations for investigating the reason of memory bloat. AFAIK, the way to examine it is attaching

Re: Add A Glossary

2020-06-17 Thread Jürgen Purtz
On 17.06.20 02:09, Alvaro Herrera wrote: On 2020-Jun-09, Jürgen Purtz wrote: Can you agree to the following definitions? If no, we can alternatively formulate for each of them: "Under discussion - currently not defined". My proposals are inspired by chapter 2.2 Concepts: "Tables are grouped in

Re: min_safe_lsn column in pg_replication_slots view

2020-06-17 Thread Fujii Masao
On 2020/06/15 16:35, Kyotaro Horiguchi wrote: At Mon, 15 Jun 2020 13:44:31 +0900, Michael Paquier wrote in On Mon, Jun 15, 2020 at 12:40:03PM +0900, Fujii Masao wrote: BTW, I just wonder why each row in pg_replication_slots needs to have min_safe_lsn column? Basically min_safe_lsn should b

Re: pgstattuple: Have pgstattuple_approx accept TOAST tables

2020-06-17 Thread Laurenz Albe
On Fri, 2020-04-17 at 13:01 +0200, Peter Eisentraut wrote: > I alluded to this in [0], but it's better discussed in its own thread. > > I think the check that makes pgstattuple_approx reject TOAST tables is a > mistake. They have visibility and free space map, and it works just > fine if the ch

Re: Resetting spilled txn statistics in pg_stat_replication

2020-06-17 Thread Amit Kapila
On Wed, Jun 17, 2020 at 1:34 PM Masahiko Sawada wrote: > > On Sat, 13 Jun 2020 at 14:23, Amit Kapila wrote: > > > > On Fri, Jun 12, 2020 at 6:11 PM Magnus Hagander wrote: > > > > > > On Fri, Jun 12, 2020 at 10:23 AM Amit Kapila > > > wrote: > > >> > > > > > > > > > The problem with "lifetime o

Re: Review for GetWALAvailability()

2020-06-17 Thread Fujii Masao
On 2020/06/17 17:30, Kyotaro Horiguchi wrote: At Wed, 17 Jun 2020 17:01:11 +0900, Fujii Masao wrote in On 2020/06/17 12:10, Kyotaro Horiguchi wrote: At Tue, 16 Jun 2020 22:40:56 -0400, Alvaro Herrera wrote in On 2020-Jun-17, Fujii Masao wrote: On 2020/06/17 3:50, Alvaro Herrera wrote:

Re: Operator class parameters and sgml docs

2020-06-17 Thread Alexander Korotkov
On Wed, Jun 17, 2020 at 2:50 AM Peter Geoghegan wrote: > On Tue, Jun 16, 2020 at 4:24 AM Alexander Korotkov > wrote: > > Thank you for patience. The documentation patch is attached. I think > > it requires review by native english speaker. > > * "...paramaters that controls" should be "...param

Re: language cleanups in code and docs

2020-06-17 Thread Magnus Hagander
On Mon, Jun 15, 2020 at 8:23 PM Andres Freund wrote: > Hi, > > We've removed the use of "slave" from most of the repo (one use > remained, included here), but we didn't do the same for master. In the > attached series I replaced most of the uses. > > 0001: tap tests: s/master/primary/ > Pretty

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

2020-06-17 Thread Amit Kapila
On Tue, Jun 16, 2020 at 2:36 PM Amit Kapila wrote: > > On Mon, Jun 15, 2020 at 6:29 PM Amit Kapila wrote: > > > > I have few more comments on the patch > > 0013-Change-buffile-interface-required-for-streaming-.patch: > > > > Review comments on 0014-Worker-tempfile-use-the-shared-buffile-infrastru

Re: language cleanups in code and docs

2020-06-17 Thread Laurenz Albe
On Tue, 2020-06-16 at 19:55 -0400, Tom Lane wrote: > Andrew Dunstan writes: > > On 6/15/20 2:22 PM, Andres Freund wrote: > > > 2) 'master' as a reference to the branch. Personally I be in favor of > > > changing the branch name, but it seems like it'd be better done as a > > > somewhat separate di

Re: Asynchronous Append on postgres_fdw nodes.

2020-06-17 Thread Andrey V. Lepikhov
On 6/16/20 1:30 PM, Kyotaro Horiguchi wrote: They return 25056 rows, which is far more than 9741 rows. So remote join won. Of course the number of returning rows is not the only factor of the cost change but is the most significant factor in this case. Thanks for the attention. I see one sligh

Re: language cleanups in code and docs

2020-06-17 Thread Magnus Hagander
On Wed, Jun 17, 2020 at 3:44 AM Tom Lane wrote: > Alvaro Herrera writes: > > On 2020-Jun-16, Tom Lane wrote: > >> "master" is the default branch name established by git, is it not? Not > >> something we picked. > > > Git itself is discussing this: > > > https://public-inbox.org/git/41438a0f-50e

Re: Review for GetWALAvailability()

2020-06-17 Thread Kyotaro Horiguchi
At Wed, 17 Jun 2020 17:01:11 +0900, Fujii Masao wrote in > > > On 2020/06/17 12:10, Kyotaro Horiguchi wrote: > > At Tue, 16 Jun 2020 22:40:56 -0400, Alvaro Herrera > > wrote in > >> On 2020-Jun-17, Fujii Masao wrote: > >>> On 2020/06/17 3:50, Alvaro Herrera wrote: > >> > >>> So InvalidateObso

Re: calling procedures is slow and consumes extra much memory against calling function

2020-06-17 Thread Pavel Stehule
st 17. 6. 2020 v 7:52 odesílatel Amit Khandekar napsal: > On Wed, 10 Jun 2020 at 17:12, Pavel Stehule > wrote: > > st 10. 6. 2020 v 12:26 odesílatel Amit Khandekar > napsal: > >> Could you show an example testcase that tests this recursive scenario, > >> with which your earlier patch fails the

Re: remove some STATUS_* symbols

2020-06-17 Thread Peter Eisentraut
On 2020-06-12 09:30, Michael Paquier wrote: On Thu, Jun 11, 2020 at 03:55:59PM +0200, Peter Eisentraut wrote: On 2020-01-16 13:56, Robert Haas wrote: IMHO, custom enums for each particular case would be a big improvement over supposedly-generic STATUS codes. It makes it clearer which values are

Re: Resetting spilled txn statistics in pg_stat_replication

2020-06-17 Thread Masahiko Sawada
On Sat, 13 Jun 2020 at 14:23, Amit Kapila wrote: > > On Fri, Jun 12, 2020 at 6:11 PM Magnus Hagander wrote: > > > > On Fri, Jun 12, 2020 at 10:23 AM Amit Kapila > > wrote: > >> > > > > > > The problem with "lifetime of a process" is that it's not predictable. A > > replication process might "b

Re: pg_regress cleans up tablespace twice.

2020-06-17 Thread Kyotaro Horiguchi
Thanks for working on this. At Wed, 17 Jun 2020 16:12:07 +0900, Michael Paquier wrote in > On Fri, May 15, 2020 at 05:25:08PM +0900, Kyotaro Horiguchi wrote: > > I thought of that but didn't in the patch. I refrained from doing > > that because the output directory is dedicatedly created at th

Re: Review for GetWALAvailability()

2020-06-17 Thread Fujii Masao
On 2020/06/17 12:10, Kyotaro Horiguchi wrote: At Tue, 16 Jun 2020 22:40:56 -0400, Alvaro Herrera wrote in On 2020-Jun-17, Fujii Masao wrote: On 2020/06/17 3:50, Alvaro Herrera wrote: So InvalidateObsoleteReplicationSlots() can terminate normal backends. But do we want to do this? If we w

Re: Remove dead forceSync parameter of XactLogCommitRecord()

2020-06-17 Thread Michael Paquier
On Tue, Jun 16, 2020 at 08:26:15PM -0700, Noah Misch wrote: > I think someone planned to have XactLogCommitRecord() use its forceSync > parameter instead of reading the forceSyncCommit global variable, but that > didn't happen. I'd like to remove the parameter, as attached. This has no > function

Re: TAP tests and symlinks on Windows

2020-06-17 Thread Michael Paquier
On Tue, Jun 16, 2020 at 07:53:26AM -0400, Andrew Dunstan wrote: > Not one of them has it. Argh. > I think we'll need a dynamic test for its presence rather than just > assuming it's there. (Use require in an eval for this). Sure. No problem with implementing an automatic detection. > However,

Re: TAP tests and symlinks on Windows

2020-06-17 Thread Michael Paquier
On Tue, Jun 16, 2020 at 08:32:03AM -0400, Andrew Dunstan wrote: > On 6/16/20 8:24 AM, Peter Eisentraut wrote: >> MSYS2, which is basically Cygwin, emulates symlinks with junction >> points, so this happens to work for our purpose.  We could therefore >> enable these tests in that environment, if we

Re: pg_regress cleans up tablespace twice.

2020-06-17 Thread Michael Paquier
On Fri, May 15, 2020 at 05:25:08PM +0900, Kyotaro Horiguchi wrote: > I thought of that but didn't in the patch. I refrained from doing > that because the output directory is dedicatedly created at the only > place (pg_upgrade test) where the --outputdir is specified. (I think I > tend to do too-mu