Re: MultiXact\SLRU buffers configuration

2020-07-08 Thread Andrey M. Borodin
> 2 июля 2020 г., в 17:02, Daniel Gustafsson написал(а): > >> On 15 May 2020, at 02:03, Kyotaro Horiguchi wrote: > >> Generally in such cases, condition variables would work. In the >> attached PoC, the reader side gets no penalty in the "likely" code >> path. The writer side always calls C

Re: Resetting spilled txn statistics in pg_stat_replication

2020-07-08 Thread Amit Kapila
On Wed, Jul 8, 2020 at 11:28 AM Masahiko Sawada wrote: > > On Tue, 7 Jul 2020 at 17:50, Magnus Hagander wrote: > > > > > > > > On Tue, Jul 7, 2020 at 5:10 AM Amit Kapila wrote: > >> > >> On Tue, Jul 7, 2020 at 7:07 AM Masahiko Sawada > >> wrote: > >> > > >> > On Mon, 6 Jul 2020 at 20:45, Amit K

Re: [doc] modifying unit from characters to bytes

2020-07-08 Thread Daniel Gustafsson
> On 8 Jul 2020, at 04:25, Fujii Masao wrote: > > On 2020/07/08 10:54, torikoshia wrote: >> Hi, >> The manual describes the size of pg_stat_activity.query >> as below: >> | By default the query text is truncated at 1024 characters; >> When considering multibyte characters, it seems more >> accur

Re: Is it useful to record whether plans are generic or custom?

2020-07-08 Thread Fujii Masao
On 2020/07/08 10:14, torikoshia wrote: On 2020-07-06 22:16, Fujii Masao wrote: On 2020/06/11 14:59, torikoshia wrote: On 2020-06-10 18:00, Kyotaro Horiguchi wrote: +    TupleDescInitEntry(tupdesc, (AttrNumber) 8, "last_plan", This could be a problem if we showed the last plan in this vie

Re: Resetting spilled txn statistics in pg_stat_replication

2020-07-08 Thread Masahiko Sawada
On Wed, 8 Jul 2020 at 16:04, Amit Kapila wrote: > > On Wed, Jul 8, 2020 at 11:28 AM Masahiko Sawada > wrote: > > > > On Tue, 7 Jul 2020 at 17:50, Magnus Hagander wrote: > > > > > > > > > > > > On Tue, Jul 7, 2020 at 5:10 AM Amit Kapila > > > wrote: > > >> > > >> On Tue, Jul 7, 2020 at 7:07 AM

Typo in pgstat.c

2020-07-08 Thread Daniel Gustafsson
Spotted a small typo in pgstat.c this morning, attached patch fixes this. cheers ./daniel pgstat_proejects.diff Description: Binary data

Re: [doc] modifying unit from characters to bytes

2020-07-08 Thread Fujii Masao
On 2020/07/08 16:17, Daniel Gustafsson wrote: On 8 Jul 2020, at 04:25, Fujii Masao wrote: On 2020/07/08 10:54, torikoshia wrote: Hi, The manual describes the size of pg_stat_activity.query as below: | By default the query text is truncated at 1024 characters; When considering multibyte ch

Re: [doc] modifying unit from characters to bytes

2020-07-08 Thread Daniel Gustafsson
> On 8 Jul 2020, at 10:05, Fujii Masao wrote: > > On 2020/07/08 16:17, Daniel Gustafsson wrote: >>> On 8 Jul 2020, at 04:25, Fujii Masao wrote: >>> >>> On 2020/07/08 10:54, torikoshia wrote: Hi, The manual describes the size of pg_stat_activity.query as below: | By default

Re: Typo in pgstat.c

2020-07-08 Thread Magnus Hagander
On Wed, Jul 8, 2020 at 10:05 AM Daniel Gustafsson wrote: > Spotted a small typo in pgstat.c this morning, attached patch fixes this. > Thanks, applied. -- Magnus Hagander Me: https://www.hagander.net/ Work: https://www.redpill-linpro.com/

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

2020-07-08 Thread Amit Kapila
On Wed, Jul 8, 2020 at 9:36 AM Amit Kapila wrote: > > On Sun, Jul 5, 2020 at 8:37 PM Dilip Kumar wrote: > > > > I have compared the changes logged at command end vs logged at commit > > time. I have ignored the invalidation for the transaction which has > > any aborted subtransaction in it. Whi

Re: Quick doc patch

2020-07-08 Thread Alexander Korotkov
Hi! On Wed, Jul 8, 2020 at 4:43 AM Michael Paquier wrote: > On Tue, Jul 07, 2020 at 06:36:10PM +0900, Michael Paquier wrote: > > On Tue, Jul 07, 2020 at 09:58:59AM +0200, Daniel Gustafsson wrote: > >> I agree, it looks like a copy-pasteo in 15cb2bd2700 which introduced the > >> paragraph for both

Add session statistics to pg_stat_database

2020-07-08 Thread Laurenz Albe
Here is a patch that adds the following to pg_stat_database: - number of connections - number of sessions that were not disconnected regularly - total time spent in database sessions - total time spent executing queries - total idle in transaction time This is useful to check if connection pooling

Re: Modifying data type of slot_keep_segs from XLogRecPtr to XLogSegNo

2020-07-08 Thread Fujii Masao
On 2020/07/08 15:22, Fujii Masao wrote: On 2020/07/08 11:55, torikoshia wrote: On 2020-07-08 11:15, Fujii Masao wrote: On 2020/07/08 11:02, torikoshia wrote: Hi, Currently, slot_keep_segs is defined as "XLogRecPtr" in KeepLogSeg(), but it seems that should be "XLogSegNo" because this var

Re: Global snapshots

2020-07-08 Thread Amit Kapila
On Wed, Jul 8, 2020 at 11:16 AM Masahiko Sawada wrote: > > On Tue, 7 Jul 2020 at 15:40, Amit Kapila wrote: > > > > > > Okay, but isn't there some advantage with this approach (manage 2PC at > > postgres_fdw level) as well which is that any node will be capable of > > handling global transactions

Retry Cached Remote Connections for postgres_fdw in case remote backend gets killed/goes away

2020-07-08 Thread Bharath Rupireddy
Hi, Currently with the postgres_fdw remote connections cached in the local backend, the queries that use the cached connections from local backend will not check whether the remote backend is killed or gone away, and it goes tries to submit the query and fails if the remote backend is killed. Thi

Re: standby recovery fails (tablespace related) (tentative patch and discussion)

2020-07-08 Thread Paul Guo
Looks like my previous reply was held for moderation (maybe due to my new email address). I configured my pg account today using the new email address. I guess this email would be held for moderation. I’m now replying my previous reply email and attaching the new patch series. On Jul 6, 2020,

Re: Towards easier AMs: Cleaning up inappropriate use of name "relkind"

2020-07-08 Thread Michael Paquier
On Wed, Jul 01, 2020 at 09:46:34AM -0700, Mark Dilger wrote: > Rebased patch attached. Thanks for mentioning it! There are two patches on this thread v2-0001 being much smaller than v2-0002. I have looked at 0001 for now, and, like Alvaro, this renaming makes sense to me. Those commands work on

[PATCH v2] Allow COPY "text" to output a header and add header matching mode to COPY FROM

2020-07-08 Thread Rémi Lapeyre
Hi, here's a new version of the patch that should apply cleanly. I'll monitor the status on http://cfbot.cputube.org/ Rémi --- contrib/file_fdw/input/file_fdw.source | 7 +- contrib/file_fdw/output/file_fdw.source | 13 ++-- doc/src/sgml/ref/copy.sgml | 9 ++- src/backend/command

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

2020-07-08 Thread Fujii Masao
On 2020/07/07 22:02, torikoshia wrote: On 2020-07-06 15:16, Fujii Masao wrote: On 2020/07/06 12:12, torikoshia wrote: On Fri, Jul 3, 2020 at 7:33 PM Fujii Masao wrote: Thanks for your review! I like more specific name like pg_backend_memory_contexts. Agreed. When I was trying to add t

Re: [PATCH v2] Allow COPY "text" to output a header and add header matching mode to COPY FROM

2020-07-08 Thread Daniel Gustafsson
> On 8 Jul 2020, at 13:45, Rémi Lapeyre wrote: > > Hi, here's a new version of the patch that should apply cleanly. I'll monitor > the status on http://cfbot.cputube.org/ Please reply to the old thread about this, as that's the one connected to the Commitfest entry and thats where all the discus

Re: Multi-byte character case-folding

2020-07-08 Thread Robert Haas
On Mon, Jul 6, 2020 at 8:32 PM Tom Lane wrote: > test=# create table MYÉCLASS (f1 text); > CREATE TABLE > test=# \dt > List of relations > Schema | Name | Type | Owner > +--+---+-- > public | myÉclass | table | postgres > (1 row) > > pg_dump will rende

Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit

2020-07-08 Thread Bharath Rupireddy
> > If I understand it correctly, your suggestion is to add > > keep_connection option and use that while defining the server object. > > IMO having keep_connection option at the server object level may not > > serve the purpose being discussed here. > > For instance, let's say I create a foreign s

Re: TAP tests and symlinks on Windows

2020-07-08 Thread Andrew Dunstan
On 7/3/20 10:11 AM, Peter Eisentraut wrote: > On 2020-06-30 14:13, Michael Paquier wrote: >> Attached is an updated patch, where I have tried to use a better >> wording in all the code paths involved. > > This new patch doesn't work for me on MSYS2 yet. > > It fails right now in 010_pg_basebackup

Re: Default setting for enable_hashagg_disk

2020-07-08 Thread Stephen Frost
Greetings, * Alvaro Herrera (alvhe...@2ndquadrant.com) wrote: > On 2020-Jun-25, Andres Freund wrote: > > > >My point here is that maybe we don't need to offer a GUC to explicitly > > >turn spilling off; it seems sufficient to let users change work_mem so > > >that spilling will naturally not occu

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

2020-07-08 Thread Ajin Cherian
I was going through this thread and testing and reviewing the patches, I think this is a great feature to have and one which customers would appreciate. I wanted to help out, and I saw a request for a test patch for a GUC to always enable streaming on logical replication. Here's one on top of patch

Re: [PATCH v2] Allow COPY "text" to output a header and add header matching mode to COPY FROM

2020-07-08 Thread Rémi Lapeyre
> > Please reply to the old thread about this, as that's the one connected to the > Commitfest entry and thats where all the discussion has happened. While > additional threads can be attached to a CF entry, it's for when multiple > discussions are relevant to a patch, a single discussion should

Re: [PATCH v2] Allow COPY "text" to output a header and add header matching mode to COPY FROM

2020-07-08 Thread Justin Pryzby
On Wed, Jul 08, 2020 at 03:21:48PM +0200, Daniel Gustafsson wrote: > > On 8 Jul 2020, at 13:45, Rémi Lapeyre wrote: > > > > Hi, here's a new version of the patch that should apply cleanly. I'll > > monitor > > the status on http://cfbot.cputube.org/ > > Please reply to the old thread about this

Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit

2020-07-08 Thread Robert Haas
On Wed, Jul 8, 2020 at 9:26 AM Bharath Rupireddy wrote: > If the cached connection idle time property is used (I'm thinking we > can define it per server object) then the local backend might have to > close the connections which are lying unused more than idle time. To > perform this task, the loc

Re: OpenSSL 3.0.0 compatibility

2020-07-08 Thread Robert Haas
On Tue, Jul 7, 2020 at 1:46 PM Peter Eisentraut wrote: > Trying to move this along, where would be a good place to define > OPENSSL_API_COMPAT? The only place that's shared between frontend and > backend code is c.h. The attached patch does it that way. So, if we go this way, does that mean tha

Re: TAP tests and symlinks on Windows

2020-07-08 Thread Juan José Santamaría Flecha
On Wed, Jul 8, 2020 at 3:54 PM Andrew Dunstan < andrew.duns...@2ndquadrant.com> wrote: > > Incidentally, perl2host is arguably a bad name for this routine - there > is nothing perl-specific about the paths, they are provided by the msys > environment. Maybe virtual2host or some such would be a bet

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

2020-07-08 Thread Robert Haas
On Wed, Jun 24, 2020 at 11:04 AM Alvaro Herrera wrote: > ISTM that a reasonable compromise is that if you use -x (or -c, -m, -O) > and the input value is outside the range supported by existing files, > then it's a fatal error; unless you use --force, which turns it into > just a warning. One pot

Re: max_slot_wal_keep_size and wal_keep_segments

2020-07-08 Thread Fujii Masao
On 2020/07/02 2:18, David Steele wrote: On 7/1/20 10:54 AM, Alvaro Herrera wrote: On 2020-Jul-01, Fujii Masao wrote: On 2020/07/01 12:26, Alvaro Herrera wrote: On 2020-Jun-30, Fujii Masao wrote: When I talked about max_slot_wal_keep_size as new feature in v13 at the conference, I received

Re: OpenSSL 3.0.0 compatibility

2020-07-08 Thread Peter Eisentraut
On 2020-07-08 16:51, Robert Haas wrote: On Tue, Jul 7, 2020 at 1:46 PM Peter Eisentraut wrote: Trying to move this along, where would be a good place to define OPENSSL_API_COMPAT? The only place that's shared between frontend and backend code is c.h. The attached patch does it that way. So,

Re: TAP tests and symlinks on Windows

2020-07-08 Thread Andrew Dunstan
On 7/8/20 11:07 AM, Juan José Santamaría Flecha wrote: > > On Wed, Jul 8, 2020 at 3:54 PM Andrew Dunstan > > wrote: > > > Incidentally, perl2host is arguably a bad name for this routine - > there > is nothing perl-specific about the paths, they

Re: max_slot_wal_keep_size and wal_keep_segments

2020-07-08 Thread Alvaro Herrera
On 2020-Jul-09, Fujii Masao wrote: > I attached the patch that renames wal_keep_segments to wal_keep_size. Looks good in a quick once-over. Just two small wording comments: > > Independently of max_wal_size, > -+ 1 most recent WAL files are > + most recent megabytes > + WAL fil

Re: TAP tests and symlinks on Windows

2020-07-08 Thread Alvaro Herrera
On 2020-Jul-08, Andrew Dunstan wrote: > On 7/8/20 11:07 AM, Juan José Santamaría Flecha wrote: > > There is a utility cygpath [1] meant for the conversion between Unix > > and Windows path formats, that might be a meaningful name also. > > > > [1] http://cygwin.net/cygwin-ug-net/cygpath.html > >

Re: Missing HashAgg EXPLAIN ANALYZE details for parallel plans

2020-07-08 Thread Justin Pryzby
On Fri, Jun 19, 2020 at 02:02:29PM +1200, David Rowley wrote: > if (es->format == EXPLAIN_FORMAT_TEXT) > { > ExplainIndentText(es); > appendStringInfo(es->str, "Sort Method: %s %s: %ldkB\n", ... > As for this patch, I don't think it's unreasonable to have the 3 > possible HashAgg properties on a

Re: Multi-byte character case-folding

2020-07-08 Thread Alvaro Herrera
On 2020-Jul-08, Robert Haas wrote: > That's not to say that I have any good idea what to do about this. I > just disagree with labelling the above case as a success. Yeah, particularly since it works differently in single-char encodings. -- Álvaro Herrerahttps://www.2ndQuadrant.

Re: Multi-byte character case-folding

2020-07-08 Thread Tom Lane
Robert Haas writes: > That's not to say that I have any good idea what to do about this. I > just disagree with labelling the above case as a success. I can't say that I like it either. But I'm afraid that changing it now will create many more problems than it solves. re

Re: posgres 12 bug (partitioned table)

2020-07-08 Thread Soumyadeep Chakraborty
Hey Amit, On Tue, Jul 7, 2020 at 7:17 PM Amit Langote wrote: > Ah, I see. You might've noticed that ExecInsert() only ever sees leaf > partitions, because tuple routing would've switched the result > relation to a leaf partition by the time we are in ExecInsert(). So, > table_tuple_insert() alw

Re: Hybrid Hash/Nested Loop joins and caching results from subplans

2020-07-08 Thread Andres Freund
Hi, On 2020-05-20 23:44:27 +1200, David Rowley wrote: > I've attached a patch which implements this. The new node type is > called "Result Cache". I'm not particularly wedded to keeping that > name, but if I change it, I only want to do it once. I've got a few > other names I mind, but I don't f

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

2020-07-08 Thread Andres Freund
Hi, I think this is an incredibly useful feature. On 2020-07-07 22:02:10 +0900, torikoshia wrote: > > There can be multiple memory contexts with the same name. So I'm afraid > > that it's difficult to identify the actual parent memory context from > > this > > "parent" column. This is ok when lo

Re: TAP tests and symlinks on Windows

2020-07-08 Thread Andrew Dunstan
On 7/8/20 12:22 PM, Alvaro Herrera wrote: > On 2020-Jul-08, Andrew Dunstan wrote: > >> On 7/8/20 11:07 AM, Juan José Santamaría Flecha wrote: >>> There is a utility cygpath [1] meant for the conversion between Unix >>> and Windows path formats, that might be a meaningful name also. >>> >>> [1] ht

Re: min_safe_lsn column in pg_replication_slots view

2020-07-08 Thread Tom Lane
Alvaro Herrera writes: > In absence of other suggestions I gave this the name XLogMBVarToSegs, > and redefined ConvertToXSegs to use that. Didn't touch callers in > xlog.c to avoid pointless churn. Pushed to both master and 13. The buildfarm's sparc64 members seem unhappy with this.

Reigning in ExecParallelHashRepartitionFirst

2020-07-08 Thread Melanie Plageman
Last week as I was working on adaptive hash join [1] and trying to get parallel adaptive hash join batch 0 to spill correctly, I noticed what seemed like a problem with the code to repartition batch 0. If we run out of space while inserting tuples into the hashtable during the build phase of paral

Re: language cleanups in code and docs

2020-07-08 Thread Andres Freund
Hi, I've pushed most of the changes. On 2020-06-16 18:59:25 -0400, David Steele wrote: > On 6/16/20 6:27 PM, Andres Freund wrote: > > On 2020-06-16 17:14:57 -0400, David Steele wrote: > > > On 6/15/20 2:22 PM, Andres Freund wrote: > > > > > > 0008: docs: WIP multi-master rephrasing. > > > >

Postgres is not able to handle more than 4k tables!?

2020-07-08 Thread Konstantin Knizhnik
I want to explain one bad situation we have encountered with one of our customers. There are ~5000 tables in their database. And what is worse - most of them are actively used. Then several flaws of Postgres make their system almost stuck. Autovacuum is periodically processing all this 5k relat

Re: language cleanups in code and docs

2020-07-08 Thread David Steele
On 7/8/20 4:39 PM, Andres Freund wrote: Hi, I've pushed most of the changes. On 2020-06-16 18:59:25 -0400, David Steele wrote: On 6/16/20 6:27 PM, Andres Freund wrote: On 2020-06-16 17:14:57 -0400, David Steele wrote: On 6/15/20 2:22 PM, Andres Freund wrote: 0008: docs: WIP multi-master r

Re: language cleanups in code and docs

2020-07-08 Thread Alvaro Herrera
On 2020-Jul-08, David Steele wrote: > On 7/8/20 4:39 PM, Andres Freund wrote: > I think this phrasing in the original/updated version is pretty awkward: > > + A standby server that cannot be connected to until it is promoted to a > + primary server is called a ... Yeah. > How about: > > + A

Re: language cleanups in code and docs

2020-07-08 Thread David Steele
On 7/8/20 5:17 PM, Alvaro Herrera wrote: On 2020-Jul-08, David Steele wrote: On 7/8/20 4:39 PM, Andres Freund wrote: I think this phrasing in the original/updated version is pretty awkward: + A standby server that cannot be connected to until it is promoted to a + primary server is called

Re: Is this a bug in pg_current_logfile() on Windows?

2020-07-08 Thread Tom Lane
[ redirecting to pghackers ] Thomas Kellerer writes: > Tom Lane schrieb am 08.07.2020 um 18:41: >> Somehow, the reading file is being left in binary mode and thus it's >> failing to convert \r\n back to plain \n. >> Now the weird thing about that is I'd have expected "r" and "w" modes >> to imply

Re: Postgres is not able to handle more than 4k tables!?

2020-07-08 Thread Tom Lane
Konstantin Knizhnik writes: > There are several thousand clients, most of which are executing complex > queries. So, that's really the core of your problem. We don't promise that you can run several thousand backends at once. Usually it's recommended that you stick a connection pooler in front

Re: [PATCH] Btree BackwardScan race condition on Standby during VACUUM

2020-07-08 Thread Peter Geoghegan
Hi Michail, On Sun, Apr 5, 2020 at 10:04 AM Michail Nikolaev wrote: > > I added > > something about this to the nbtree README in commit 9f83468b353. > > I have added some updates to your notes in the updated patch version. My apologies for the extended delay here. My intention is to commit th

Re: Missing HashAgg EXPLAIN ANALYZE details for parallel plans

2020-07-08 Thread David Rowley
On Thu, 9 Jul 2020 at 04:30, Justin Pryzby wrote: > I've just noticed another inconsistency: > For "Sort", there's no space before "kB", but your patch (9bdb300d) uses a > space for text mode. Thanks for the report. I just pushed a fix for that. David

Re: jsonpath versus NaN

2020-07-08 Thread Tom Lane
Alexander Korotkov writes: > The patchset is attached, sorry for the delay. > The first patch improves error messages, which appears to be unclear > for me. If one applies .double() method to a numeric value, we > restrict that this numeric value should fit to double precision type. > If it does

Re: Hybrid Hash/Nested Loop joins and caching results from subplans

2020-07-08 Thread David Rowley
On Thu, 9 Jul 2020 at 04:53, Andres Freund wrote: > > On 2020-05-20 23:44:27 +1200, David Rowley wrote: > > I've attached a patch which implements this. The new node type is > > called "Result Cache". I'm not particularly wedded to keeping that > > name, but if I change it, I only want to do it

Re: Index Skip Scan (new UniqueKeys)

2020-07-08 Thread Peter Geoghegan
On Tue, Jun 9, 2020 at 3:20 AM Dmitry Dolgov <9erthali...@gmail.com> wrote: > * Btree-implementation contains btree specific code to implement amskip, > introduced in the previous patch. The way that you're dealing with B-Tree tuples here needs to account for posting list tuples: > +

Re: min_safe_lsn column in pg_replication_slots view

2020-07-08 Thread Alvaro Herrera
On 2020-Jul-08, Tom Lane wrote: > Alvaro Herrera writes: > > In absence of other suggestions I gave this the name XLogMBVarToSegs, > > and redefined ConvertToXSegs to use that. Didn't touch callers in > > xlog.c to avoid pointless churn. Pushed to both master and 13. > > The buildfarm's sparc6

Re: Is this a bug in pg_current_logfile() on Windows?

2020-07-08 Thread Andrew Dunstan
On 7/8/20 5:26 PM, Tom Lane wrote: > > However ... I put in a test case to try to expose this failure, and > our Windows buildfarm critters remain perfectly happy. So what's up > with that? After some digging around, I believe the reason is that > PostgresNode::psql is stripping the \r from pg_

Re: min_safe_lsn column in pg_replication_slots view

2020-07-08 Thread Tom Lane
Alvaro Herrera writes: > On 2020-Jul-08, Tom Lane wrote: >> The buildfarm's sparc64 members seem unhappy with this. > Hmm. Some of them are, yeah, but it's not universal. For example > mussurana and ibisbill are not showing failures. Ah, right, I was thinking they hadn't run since this commit,

Re: Is this a bug in pg_current_logfile() on Windows?

2020-07-08 Thread Tom Lane
Andrew Dunstan writes: > On 7/8/20 5:26 PM, Tom Lane wrote: >> However ... I put in a test case to try to expose this failure, and >> our Windows buildfarm critters remain perfectly happy. So what's up >> with that? After some digging around, I believe the reason is that >> PostgresNode::psql is

Re: min_safe_lsn column in pg_replication_slots view

2020-07-08 Thread Alvaro Herrera
On 2020-Jul-08, Tom Lane wrote: > Alvaro Herrera writes: > > Anyway the error is pretty strange: only GetWALAvailability is showing a > > problem, but the size calculation in the view function def is returning > > a negative number, as expected. > > We've previously noted what seem to be compile

Re: min_safe_lsn column in pg_replication_slots view

2020-07-08 Thread Tom Lane
Alvaro Herrera writes: > On 2020-Jul-08, Tom Lane wrote: >> We've previously noted what seem to be compiler optimization bugs on >> both sparc32 and sparc64; the latest thread about that is >> https://www.postgresql.org/message-id/flat/f28f842d-e82b-4e30-a81a-2a1f9fa4a8e1%40www.fastmail.com >> Thi

RE: Postgres is not able to handle more than 4k tables!?

2020-07-08 Thread tsunakawa.ta...@fujitsu.com
From: Konstantin Knizhnik > Autovacuum is periodically processing all this 5k relations (because > them are actively updated). > And as far as most of this tables are small enough autovacuum complete > processing of them almost in the same time. > As a result autovacuum workers produce ~5k invalid

Re: min_safe_lsn column in pg_replication_slots view

2020-07-08 Thread Alvaro Herrera
On 2020-Jul-08, Tom Lane wrote: > Alvaro Herrera writes: > > Ouch. So 12 builds with -O0 but 13 does not? > > Unless Tom's changed the animal's config since that thread, yes. I verified the configs in branches 12 and 13 in one of the failing animals, and yes that's still the case. > > Did we

Re: Reigning in ExecParallelHashRepartitionFirst

2020-07-08 Thread Melanie Plageman
s/reign/rein/ in $subject https://www.merriam-webster.com/words-at-play/do-you-rein-in-or-reign-in-something

Re: min_safe_lsn column in pg_replication_slots view

2020-07-08 Thread Tom Lane
Alvaro Herrera writes: > On 2020-Jul-08, Tom Lane wrote: >> We did not. If it's a compiler bug, and one as phase-of-the-moon- >> dependent as this seems to be, I'd have zero confidence that any >> specific source code change would fix it (barring someone confidently >> explaining exactly what the

Re: jsonpath versus NaN

2020-07-08 Thread Alexander Korotkov
On Thu, Jul 9, 2020 at 1:20 AM Tom Lane wrote: > Alexander Korotkov writes: > > The patchset is attached, sorry for the delay. > > > The first patch improves error messages, which appears to be unclear > > for me. If one applies .double() method to a numeric value, we > > restrict that this nume

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

2020-07-08 Thread movead...@highgo.ca
>> ISTM that a reasonable compromise is that if you use -x (or -c, -m, -O) >> and the input value is outside the range supported by existing files, >> then it's a fatal error; unless you use --force, which turns it into >> just a warning. >One potential problem is that you might be using --force

Re: A patch for get origin from commit_ts.

2020-07-08 Thread movead...@highgo.ca
>There is a conflict in catversion.h. If you wish to test the patch, >please feel free to use the attached where I have updated the >attribute name to roident. I think everything is ok, but be careful the new patch is in Windows format now. Regards, Highgo Software (Canada/China/Pakistan) URL

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

2020-07-08 Thread Amit Kapila
On Wed, Jul 8, 2020 at 7:31 PM Ajin Cherian wrote: > > I was going through this thread and testing and reviewing the patches, I > think this is a great feature to have and one which customers would > appreciate. I wanted to help out, and I saw a request for a test patch for a > GUC to always en

Implement UNLOGGED clause for COPY FROM

2020-07-08 Thread osumi.takami...@fujitsu.com
Hello, hackers. I've been thinking to suggest a peformance-oriented feature for COPY FROM. It's UNLOGGED clause, which means data loading skipping WAL generation. How to make it work is the following. 1. Aquire ACCESS EXCLUSIVE mode to lock the target table and its indexes. 2. Mark those relatio

Re: Is this a bug in pg_current_logfile() on Windows?

2020-07-08 Thread Tom Lane
I wrote: > Andrew Dunstan writes: >> Seems reasonable. If we rip it out completely we'll have to find all the >> places it breaks and fix them. And we'll almost certainly get new >> breakage. If it's hiding a real bug we'll have to do that, but I'd be >> reluctant unless there's actual proof. > H

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

2020-07-08 Thread Ajin Cherian
On Thu, Jul 9, 2020 at 12:28 PM Amit Kapila wrote: > On Wed, Jul 8, 2020 at 7:31 PM Ajin Cherian wrote: > > Thanks for showing the interest in patch. How have you ensured that > streaming is happening? I don't think the proposed patch can ensure > it for every case because we also rely on logi

Re: Resetting spilled txn statistics in pg_stat_replication

2020-07-08 Thread Amit Kapila
On Wed, Jul 8, 2020 at 1:14 PM Masahiko Sawada wrote: > > On Wed, 8 Jul 2020 at 16:04, Amit Kapila wrote: > > > > On Wed, Jul 8, 2020 at 11:28 AM Masahiko Sawada > > wrote: > > > > > > > > > > > If we need them to be persistent across time like that, perhaps we > > > > simply need to assign oid

pgsql-hackers archive broken?

2020-07-08 Thread Tatsuo Ishii
It seems I cannot access to pgsql-hackers archives. https://www.postgresql.org/list/pgsql-hackers/2020-07/ Error 503 Backend fetch failed Backend fetch failed Guru Meditation: XID: 68609318 Varnish cache server -- Tatsuo Ishii SRA OSS, Inc. Japan English: http://www.sraoss.co.jp/index_en.php Ja

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

2020-07-08 Thread Amit Kapila
On Thu, Jul 9, 2020 at 8:18 AM Ajin Cherian wrote: > > On Thu, Jul 9, 2020 at 12:28 PM Amit Kapila wrote: >> >> On Wed, Jul 8, 2020 at 7:31 PM Ajin Cherian wrote: >> >> Thanks for showing the interest in patch. How have you ensured that >> streaming is happening? I don't think the proposed pat

Re: Implement UNLOGGED clause for COPY FROM

2020-07-08 Thread Fujii Masao
On 2020/07/09 11:36, osumi.takami...@fujitsu.com wrote: Hello, hackers. I've been thinking to suggest a peformance-oriented feature for COPY FROM. It's UNLOGGED clause, which means data loading skipping WAL generation. This feature can work safely with wal_level=replica or logical? Or it c

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

2020-07-08 Thread Dilip Kumar
On Thu, Jul 9, 2020 at 8:47 AM Amit Kapila wrote: > > On Thu, Jul 9, 2020 at 8:18 AM Ajin Cherian wrote: > > > > On Thu, Jul 9, 2020 at 12:28 PM Amit Kapila wrote: > >> > >> On Wed, Jul 8, 2020 at 7:31 PM Ajin Cherian wrote: > >> > >> Thanks for showing the interest in patch. How have you ensu

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

2020-07-08 Thread Amit Kapila
On Thu, Jul 2, 2020 at 9:07 AM Amit Kapila wrote: > > On Tue, Jun 30, 2020 at 9:30 AM Amit Kapila wrote: > > > > > > > > If I am not missing anything then that change was in > > > lazy_cleanup_index and after this patch, it won't be required because > > > we are using a different variable name. >

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

2020-07-08 Thread Amit Kapila
On Thu, Jul 9, 2020 at 8:55 AM Dilip Kumar wrote: > > On Thu, Jul 9, 2020 at 8:47 AM Amit Kapila wrote: > > > > On Thu, Jul 9, 2020 at 8:18 AM Ajin Cherian wrote: > > > > > > On Thu, Jul 9, 2020 at 12:28 PM Amit Kapila > > > wrote: > > >> > > >> On Wed, Jul 8, 2020 at 7:31 PM Ajin Cherian wro

ALTER TABLE validate foreign key dependency problem

2020-07-08 Thread David Rowley
Hi, I had an ALTER TABLE dependency problem reported to me. Here's a simplified version of it: CREATE TABLE t (a INT, PRIMARY KEY(a)); ALTER TABLE t ADD CONSTRAINT t_fkey FOREIGN KEY (a) REFERENCES t(a) NOT VALID; ALTER TABLE t VALIDATE CONSTRAINT t_fkey, ALTER a TYPE BIGINT; Which results in:

Re: pgsql-hackers archive broken?

2020-07-08 Thread David Rowley
On Thu, 9 Jul 2020 at 15:15, Tatsuo Ishii wrote: > > It seems I cannot access to pgsql-hackers archives. > https://www.postgresql.org/list/pgsql-hackers/2020-07/ > > Error 503 Backend fetch failed I just hit this too. Cross-posting to www. David

Re: pgsql-hackers archive broken?

2020-07-08 Thread vignesh C
On Thu, Jul 9, 2020 at 9:28 AM David Rowley wrote: > > On Thu, 9 Jul 2020 at 15:15, Tatsuo Ishii wrote: > > > > It seems I cannot access to pgsql-hackers archives. > > https://www.postgresql.org/list/pgsql-hackers/2020-07/ > > > > Error 503 Backend fetch failed > > I just hit this too. Cross-pos

Re: Modifying data type of slot_keep_segs from XLogRecPtr to XLogSegNo

2020-07-08 Thread Kyotaro Horiguchi
At Wed, 8 Jul 2020 21:27:04 +0900, Fujii Masao wrote in > > > On 2020/07/08 15:22, Fujii Masao wrote: > > On 2020/07/08 11:55, torikoshia wrote: > >> On 2020-07-08 11:15, Fujii Masao wrote: > >>> On 2020/07/08 11:02, torikoshia wrote: > Hi, > > Currently, slot_keep_segs is defin

Re: TAP tests and symlinks on Windows

2020-07-08 Thread Juan José Santamaría Flecha
On Wed, Jul 8, 2020 at 7:18 PM Andrew Dunstan < andrew.duns...@2ndquadrant.com> wrote: > > On 7/8/20 12:22 PM, Alvaro Herrera wrote: > > On 2020-Jul-08, Andrew Dunstan wrote: > > > >> On 7/8/20 11:07 AM, Juan José Santamaría Flecha wrote: > >>> There is a utility cygpath [1] meant for the conversi

Re: [doc] modifying unit from characters to bytes

2020-07-08 Thread Fujii Masao
On 2020/07/08 17:12, Daniel Gustafsson wrote: On 8 Jul 2020, at 10:05, Fujii Masao wrote: On 2020/07/08 16:17, Daniel Gustafsson wrote: On 8 Jul 2020, at 04:25, Fujii Masao wrote: On 2020/07/08 10:54, torikoshia wrote: Hi, The manual describes the size of pg_stat_activity.query as below:

Re: max_slot_wal_keep_size and wal_keep_segments

2020-07-08 Thread Kyotaro Horiguchi
At Thu, 9 Jul 2020 00:37:57 +0900, Fujii Masao wrote in > > > On 2020/07/02 2:18, David Steele wrote: > > On 7/1/20 10:54 AM, Alvaro Herrera wrote: > >> On 2020-Jul-01, Fujii Masao wrote: > >> > >>> On 2020/07/01 12:26, Alvaro Herrera wrote: > On 2020-Jun-30, Fujii Masao wrote: > > >

Re: pgsql-hackers archive broken?

2020-07-08 Thread Alvaro Herrera
On 2020-Jul-09, vignesh C wrote: > On Thu, Jul 9, 2020 at 9:28 AM David Rowley wrote: > > > > On Thu, 9 Jul 2020 at 15:15, Tatsuo Ishii wrote: > > > > > > It seems I cannot access to pgsql-hackers archives. > > > https://www.postgresql.org/list/pgsql-hackers/2020-07/ > > > > > > Error 503 Backen

Re: Implement UNLOGGED clause for COPY FROM

2020-07-08 Thread David G. Johnston
On Wednesday, July 8, 2020, osumi.takami...@fujitsu.com < osumi.takami...@fujitsu.com> wrote: > > 5. Sync the data to disk by performing checkpoint. > This step seems to invalidate the idea outright. The checkpoint command is superuser only and isn’t table specific. This seems to require both th

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

2020-07-08 Thread Alvaro Herrera
On 2020-Jul-09, movead...@highgo.ca wrote: > >> ISTM that a reasonable compromise is that if you use -x (or -c, -m, -O) > >> and the input value is outside the range supported by existing files, > >> then it's a fatal error; unless you use --force, which turns it into > >> just a warning. > > >O

Re: Auto-vectorization speeds up multiplication of large-precision numerics

2020-07-08 Thread Amit Khandekar
FYI : this one is present in the July commitfest.

Re: A patch for get origin from commit_ts.

2020-07-08 Thread Michael Paquier
On Thu, Jul 09, 2020 at 10:04:23AM +0800, movead...@highgo.ca wrote: > but be careful the new patch is in Windows format now. That would be surprising. Why do you think that? -- Michael signature.asc Description: PGP signature

RE: Implement UNLOGGED clause for COPY FROM

2020-07-08 Thread osumi.takami...@fujitsu.com
Fujii-san Thank you for your interest in this idea. > This feature can work safely with wal_level=replica or logical? > Or it can work only with wal_level=minimal? >If yes, what is the main difference > between this method and wal_skip_threshold? I'm thinking this feature can be used when you set

Re: A patch for get origin from commit_ts.

2020-07-08 Thread movead...@highgo.ca
>> but be careful the new patch is in Windows format now. >That would be surprising. Why do you think that? I am not sure why, I can not apply your patch, and I open it with vscode and shows a CRLF format, if I change the patch to LF then nothing wrong. Regards, Highgo Software (Canada/China/

RE: Implement UNLOGGED clause for COPY FROM

2020-07-08 Thread tsunakawa.ta...@fujitsu.com
From: David G. Johnston > This step seems to invalidate the idea outright. The checkpoint command is > superuser only and isn’t table specific. This seems to require both those > things to be changed. Perhaps FlushRelationBuffers() followed by smgrsync() can be used instead. Or, depending o

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

2020-07-08 Thread Amit Khandekar
On Wed, 17 Jun 2020 at 13:54, Pavel Stehule wrote: > > > > 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

Re: Postgres is not able to handle more than 4k tables!?

2020-07-08 Thread Konstantin Knizhnik
On 09.07.2020 03:49, tsunakawa.ta...@fujitsu.com wrote: From: Konstantin Knizhnik Autovacuum is periodically processing all this 5k relations (because them are actively updated). And as far as most of this tables are small enough autovacuum complete processing of them almost in the same time

Re: A patch for get origin from commit_ts.

2020-07-08 Thread Michael Paquier
On Thu, Jul 09, 2020 at 02:19:46PM +0800, movead...@highgo.ca wrote: > I am not sure why, I can not apply your patch, and I open it > with vscode and shows a CRLF format, if I change the patch to > LF then nothing wrong. This looks like an issue in your environment, like with git's autocrlf or suc

Re: pgbench and timestamps (bounced)

2020-07-08 Thread Fabien COELHO
Attached v2 fixes some errors, per cfbot. -- Fabien.diff --git a/doc/src/sgml/ref/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgml index 9f3bb5fce6..9894ae9c04 100644 --- a/doc/src/sgml/ref/pgbench.sgml +++ b/doc/src/sgml/ref/pgbench.sgml @@ -998,15 +998,14 @@ pgbench options d There is a

  1   2   >