Re: Movement of restart_lsn position movement of logical replication slots is very slow

2020-12-23 Thread Amit Kapila
On Wed, Dec 23, 2020 at 7:06 PM Jammie wrote: > > Thanks Amit for the response. > Two things : > 1) In our observation via PSQL the advance command as well do not move the > restart_lsn immediately. It is similar to our approach that use the > confirmed_flush_lsn via stream > 2) I am ok to under

Re: postgres_fdw - cached connection leaks if the associated user mapping/foreign server is dropped

2020-12-23 Thread Bharath Rupireddy
On Thu, Dec 24, 2020 at 7:21 AM Fujii Masao wrote: > On 2020/12/23 23:40, Bharath Rupireddy wrote: > > On Wed, Dec 23, 2020 at 7:31 PM Fujii Masao > > wrote: > >> I agree to make pgfdw_xact_callback() close the connection when > >> entry->invalidated == true. But I think that it's better to get

Re: A failure of standby to follow timeline switch

2020-12-23 Thread Fujii Masao
On 2020/12/09 17:43, Kyotaro Horiguchi wrote: Hello. We found a behavioral change (which seems to be a bug) in recovery at PG13. The following steps might seem somewhat strange but the replication code deliberately cope with the case. This is a sequense seen while operating a HA cluseter us

Re: Cannot ship records to subscriber for partition tables using logical replication (publish_via_partition_root=false)

2020-12-23 Thread Amit Kapila
On Thu, Dec 24, 2020 at 11:02 AM Li Japin wrote: > > Hi, hackers > > When I use logical stream replication on partition table, I find that if we > create a new > partitions after the subscription on subscriber, the records in new > partitions cannot be > shipped to the subscriber. > > Here is a

Re: Movement of restart_lsn position movement of logical replication slots is very slow

2020-12-23 Thread Jammie
However when the situation comes and that one slot gets behind it never recovers and no way to recover from this situation even after reading using advance ro pg_logical_get_changes sql command. On Wed, Dec 23, 2020 at 7:05 PM Jammie wrote: > Thanks Amit for the response. > Two things : > 1) In

Re: Parallel Inserts in CREATE TABLE AS

2020-12-23 Thread Amit Kapila
On Thu, Dec 24, 2020 at 10:25 AM vignesh C wrote: > > On Tue, Dec 22, 2020 at 2:16 PM Bharath Rupireddy > wrote: > > > > On Tue, Dec 22, 2020 at 12:32 PM Bharath Rupireddy > > Attaching v14 patch set that has above changes. Please consider this > > for further review. > > > > Few comments: > In t

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

2020-12-23 Thread Amit Kapila
On Wed, Dec 23, 2020 at 3:08 PM Ajin Cherian wrote: > > > > Can you please update the patch for the points we agreed upon? > > Changed and attached. > Thanks, I have looked at these patches again and it seems patches 0001 to 0004 are in good shape, and among those v33-0001-Extend-the-output-plugi

Cannot ship records to subscriber for partition tables using logical replication (publish_via_partition_root=false)

2020-12-23 Thread Li Japin
Hi, hackers When I use logical stream replication on partition table, I find that if we create a new partitions after the subscription on subscriber, the records in new partitions cannot be shipped to the subscriber. Here is an example: 1. Create a view to check the subscription tables. ```

Re: Parallel Inserts in CREATE TABLE AS

2020-12-23 Thread vignesh C
On Tue, Dec 22, 2020 at 2:16 PM Bharath Rupireddy wrote: > > On Tue, Dec 22, 2020 at 12:32 PM Bharath Rupireddy > Attaching v14 patch set that has above changes. Please consider this > for further review. > Few comments: In the below case, should create be above Gather? postgres=# explain create

Re: Fail Fast In CTAS/CMV If Relation Already Exists To Avoid Unnecessary Rewrite, Planning Costs

2020-12-23 Thread Michael Paquier
On Thu, Dec 24, 2020 at 09:10:22AM +0530, Bharath Rupireddy wrote: > Since I tested that with all the formats manually here and it works, > so I don't want to make the test cases complicated with adding > explain_filter() function into matview.sql and select_into.sql and all > that. I'm okay withou

Re: New IndexAM API controlling index vacuum strategies

2020-12-23 Thread Peter Geoghegan
On Tue, Dec 22, 2020 at 2:54 PM Masahiko Sawada wrote: > I've started this separate thread from [1] for discussing the general > API design of index vacuum. This is a very difficult and very important problem. Clearly defining the problem is probably the hardest part. This prototype patch seems l

Re: Fail Fast In CTAS/CMV If Relation Already Exists To Avoid Unnecessary Rewrite, Planning Costs

2020-12-23 Thread Bharath Rupireddy
On Thu, Dec 24, 2020 at 7:40 AM Michael Paquier wrote: > > On Wed, Dec 23, 2020 at 07:13:33PM +0530, Bharath Rupireddy wrote: > > +1. Shall we add some test cases(with xml, yaml, json formats as is > > currently being done in explain.sql) to cover that? We can have the > > explain_filter() functio

Re: [PATCH] Logical decoding of TRUNCATE

2020-12-23 Thread Noah Misch
On Mon, Dec 21, 2020 at 09:42:47AM -0800, Andres Freund wrote: > On 2020-12-20 15:54:31 -0800, Peter Geoghegan wrote: > > On Sun, Dec 20, 2020 at 3:13 PM Andres Freund wrote: > > > Hm. Do I understand correctly that this problem is hit solely because > > > the parallel mode code relies on there al

Re: Confused about stream replication protocol documentation

2020-12-23 Thread Li Japin
On Dec 23, 2020, at 8:11 PM, Fujii Masao mailto:masao.fu...@oss.nttdata.com>> wrote: On 2020/12/23 11:08, Li Japin wrote: On Dec 22, 2020, at 11:13 PM, Fujii Masao mailto:masao.fu...@oss.nttdata.com> > wrote: ‘B’ means a backend and ‘F’ means a frontend. M

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2020-12-23 Thread Michael Paquier
On Thu, Dec 24, 2020 at 10:50:34AM +0900, Michael Paquier wrote: > FWIW, it still makes the most sense to me to keep the options that are > extracted from the grammar or things that apply to all the > sub-routines of REINDEX to be tracked in a single structure, so this > should include only the REI

Re: Fail Fast In CTAS/CMV If Relation Already Exists To Avoid Unnecessary Rewrite, Planning Costs

2020-12-23 Thread Michael Paquier
On Wed, Dec 23, 2020 at 07:13:33PM +0530, Bharath Rupireddy wrote: > +1. Shall we add some test cases(with xml, yaml, json formats as is > currently being done in explain.sql) to cover that? We can have the > explain_filter() function to remove the unstable parts in the output, > it looks something

Re: postgres_fdw - cached connection leaks if the associated user mapping/foreign server is dropped

2020-12-23 Thread Fujii Masao
On 2020/12/23 23:40, Bharath Rupireddy wrote: On Wed, Dec 23, 2020 at 7:31 PM Fujii Masao wrote: I agree to make pgfdw_xact_callback() close the connection when entry->invalidated == true. But I think that it's better to get rid of have_invalid_connections flag and make pgfdw_inval_callback(

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2020-12-23 Thread Michael Paquier
On Wed, Dec 23, 2020 at 07:07:54PM -0600, Justin Pryzby wrote: > On Wed, Dec 23, 2020 at 09:14:18PM -0300, Alvaro Herrera wrote: >> On 2020-Dec-23, Justin Pryzby wrote: >>> This was getting ugly: >>> >>> extern void reindex_index(Oid indexId, bool skip_constraint_checks, >>>

RE: how to use valgrind for TAP tests

2020-12-23 Thread osumi.takami...@fujitsu.com
Hi, Alexander On Sunday, December 20, 2020 5:00 PM Alexander Lakhin wrote: > > "osumi.takami...@fujitsu.com" writes: > >> I have a question about how to execute valgrind with TAP tests in > >> order to check some patches in the community. > >> My main interest is testing src/test/subscription now

RE: how to use valgrind for TAP tests

2020-12-23 Thread osumi.takami...@fujitsu.com
Hello On Saturday, December 19, 2020 1:03 AM Tom Lane wrote: > "osumi.takami...@fujitsu.com" writes: > > I have a question about how to execute valgrind with TAP tests in > > order to check some patches in the community. > > My main interest is testing src/test/subscription now but is there any

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2020-12-23 Thread Justin Pryzby
On Wed, Dec 23, 2020 at 09:14:18PM -0300, Alvaro Herrera wrote: > On 2020-Dec-23, Justin Pryzby wrote: > > > This was getting ugly: > > > > extern void reindex_index(Oid indexId, bool skip_constraint_checks, > > char relpersistence, int options, Oid > > tablespaceOid)Z

Re: New Table Access Methods for Multi and Single Inserts

2020-12-23 Thread Bharath Rupireddy
On Mon, Dec 21, 2020 at 1:17 PM Justin Pryzby wrote: > On Fri, Dec 18, 2020 at 11:54:39AM -0600, Justin Pryzby wrote: > > On Fri, Dec 18, 2020 at 07:39:14AM +0530, Bharath Rupireddy wrote: > > > On Fri, Dec 18, 2020 at 2:14 AM Justin Pryzby > > > wrote: > > > > Are you thinking that TableInsertS

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2020-12-23 Thread Alvaro Herrera
On 2020-Dec-23, Justin Pryzby wrote: > This was getting ugly: > > extern void reindex_index(Oid indexId, bool skip_constraint_checks, > char relpersistence, int options, Oid > tablespaceOid)Z Is this what I suggested?

timestamp bogus parser?

2020-12-23 Thread Fabien COELHO
Hello, I tried: psql> SELECT TIMESTAMP '2020-12-23Z19:28:45'; The result of which is: 2020-12-23 00:00:00 This is disappointing. Ok, my fault, I should have written TIMESTAMPTZ, or use T instead of Z, or whatever. Anyway, is there a rational for this behavior? I would have expected ei

Re: Re: Cache relation sizes?

2020-12-23 Thread Thomas Munro
On Wed, Dec 23, 2020 at 1:31 AM 陈佳昕(步真) wrote: > I studied your patch these days and found there might be a problem. > When execute 'drop database', the smgr shared pool will not be removed > because of no call 'smgr_drop_sr'. Function 'dropdb' in dbcommands.c remove > the buffer from bufferpool

Re: Cache relation sizes?

2020-12-23 Thread Thomas Munro
On Thu, Dec 17, 2020 at 10:22 PM Andy Fan wrote: > Let me try to understand your point. Suppose process 1 extends a file to > 2 blocks from 1 block, and fsync is not called, then a). the lseek *may* still > return 1 based on the comments in the ReadBuffer_common ("because > of buggy Linux kernels

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2020-12-23 Thread Justin Pryzby
On Wed, Dec 23, 2020 at 07:22:05PM -0300, Alvaro Herrera wrote: > Also: it seems a bit weird to me to put the flags inside the options > struct. I would keep them separate -- so initially the options struct > would only have the tablespace OID, on API cleanliness grounds: I don't see why they'd b

Re: Discarding DISCARD ALL

2020-12-23 Thread Andreas Karlsson
On 12/23/20 6:49 PM, Simon Riggs wrote: The whole premise of the patch is tighter integration, with the server providing the facilities that poolers need. I am all for that. Ideally I would want builtin connection pooling but short term I think the way forward is most likely tighter integratio

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2020-12-23 Thread Alvaro Herrera
On 2020-Dec-23, Michael Paquier wrote: > bool > -reindex_relation(Oid relid, int flags, int options) > +reindex_relation(Oid relid, int flags, ReindexOptions *options) > { > Relationrel; > Oid toast_relid; Wait a minute. reindex_relation has 'flags' and

Re: Implementing Incremental View Maintenance

2020-12-23 Thread Tatsuo Ishii
Hi Yugo, > 1. Creating an index on the matview automatically Nice. > 2. Use a weaker lock on the matview if possible > > If the view has only one base table in this query, RowExclusiveLock is > held on the view instead of AccessExclusiveLock, because we don't > need to wait other concurrent tra

Re: pg_ls_tmpdir to show directories and shared filesets (and pg_ls_*)

2020-12-23 Thread Stephen Frost
Greetings, * Justin Pryzby (pry...@telsasoft.com) wrote: > On Mon, Nov 23, 2020 at 04:14:18PM -0500, Tom Lane wrote: > > * I don't think it's okay to change the existing signatures of > > pg_ls_logdir() et al. Even if you can make an argument that it's > > not too harmful to add more output colum

Re: pg_ls_tmpdir to show directories and shared filesets (and pg_ls_*)

2020-12-23 Thread Justin Pryzby
On Mon, Nov 23, 2020 at 04:14:18PM -0500, Tom Lane wrote: > * I don't think it's okay to change the existing signatures of > pg_ls_logdir() et al. Even if you can make an argument that it's > not too harmful to add more output columns, replacing pg_stat_file's > isdir output with something of a di

Re: Perform COPY FROM encoding conversions in larger chunks

2020-12-23 Thread John Naylor
On Wed, Dec 23, 2020 at 3:41 AM Heikki Linnakangas wrote: > > I'm not sure it's worth the trouble, though. Custom conversions are very > rare. And I don't think any other object can depend on a conversion, so > you can always drop the conversion before upgrade, and re-create it with > the new fun

Postgres Spark connector

2020-12-23 Thread Zhihong Yu
Hi, I searched for Postgres support in Apache Spark. I found Spark doc related to JDBC. I wonder if the community is aware of Spark connector for Postgres (hopefully open source) where predicate involving jsonb columns can be pushed down. Your input is appreciated. Thanks

Re: proposal - support tsv output format for psql

2020-12-23 Thread Pavel Stehule
st 23. 12. 2020 v 17:38 odesílatel Andreas Karlsson napsal: > On 12/23/20 7:18 AM, Pavel Stehule wrote:> I am playing with clipboard > on Linux, and I found a way, how to redirect > > psql output to clipboard via wl-copy or xclip and then to Libre Office. > > Now it looks so best format is tsv >

Re: Discarding DISCARD ALL

2020-12-23 Thread Simon Riggs
On Wed, 23 Dec 2020 at 15:19, Andreas Karlsson wrote: > > On 12/23/20 3:47 PM, Vladimir Sitnikov wrote: > > Simon>It seems strange to me that we put this work onto the pooler, forcing > > Simon>poolers to repeatedly issue the same command > > > > What if poolers learn to manage connections and pre

Re: proposal - support tsv output format for psql

2020-12-23 Thread Andreas Karlsson
On 12/23/20 7:18 AM, Pavel Stehule wrote:> I am playing with clipboard on Linux, and I found a way, how to redirect psql output to clipboard via wl-copy or xclip and then to Libre Office. Now it looks so best format is tsv select * from pg_database \g (format=tsv) | wl-paste -t application/x-l

Re: MultiXact\SLRU buffers configuration

2020-12-23 Thread Gilles Darold
Le 13/12/2020 à 18:24, Andrey Borodin a écrit : 13 дек. 2020 г., в 14:17, Gilles Darold написал(а): I've done more review on these patches. Thanks, Gilles! I'll incorporate all your fixes to patchset. Can you also benchmark conditional variable sleep? The patch "Add conditional variable to

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2020-12-23 Thread Alexey Kondratov
On 2020-12-23 10:38, Michael Paquier wrote: On Tue, Dec 22, 2020 at 03:15:37PM -0600, Justin Pryzby wrote: Now, I really think utility.c ought to pass in a pointer to a local ReindexOptions variable to avoid all the memory context, which is unnecessary and prone to error. Yeah, it sounds rig

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2020-12-23 Thread Alexey Kondratov
On 2020-12-23 08:22, Justin Pryzby wrote: On Tue, Dec 22, 2020 at 03:22:19PM -0800, Zhihong Yu wrote: Justin: For reindex_index() : + if (options->tablespaceOid == MyDatabaseTableSpace) + options->tablespaceOid = InvalidOid; ... + oldTablespaceOid = iRel->rd_rel->reltablespace; + if

Re: proposal - support tsv output format for psql

2020-12-23 Thread Pavel Stehule
st 23. 12. 2020 v 16:54 odesílatel Bruce Momjian napsal: > On Wed, Dec 23, 2020 at 04:39:48PM +0100, Pavel Stehule wrote: > > > > > > st 23. 12. 2020 v 16:24 odesílatel Tom Lane napsal: > > > > Bruce Momjian writes: > > > On Wed, Dec 23, 2020 at 07:18:24AM +0100, Pavel Stehule wrote: >

Re: proposal - support tsv output format for psql

2020-12-23 Thread Andrew Dunstan
On 12/23/20 10:13 AM, Pavel Stehule wrote: > > > After this second check, I think the new format is not necessary, > because tsv in LO is not tsv, but it is cracked csv > > I agree, I don't think this is a format we need to spent much time on. If you set the quote to an unlikely character lik

Re: proposal - support tsv output format for psql

2020-12-23 Thread Bruce Momjian
On Wed, Dec 23, 2020 at 04:39:48PM +0100, Pavel Stehule wrote: > > > st 23. 12. 2020 v 16:24 odesílatel Tom Lane napsal: > > Bruce Momjian writes: > > On Wed, Dec 23, 2020 at 07:18:24AM +0100, Pavel Stehule wrote: > >> Implementation of tsv format should not be hard. > >> What

Re: proposal - support tsv output format for psql

2020-12-23 Thread Pavel Stehule
st 23. 12. 2020 v 16:24 odesílatel Tom Lane napsal: > Bruce Momjian writes: > > On Wed, Dec 23, 2020 at 07:18:24AM +0100, Pavel Stehule wrote: > >> Implementation of tsv format should not be hard. > >> What do you think about this? > > > How would you handle tabs in the data? > > The main proble

Re: proposal - support tsv output format for psql

2020-12-23 Thread Tom Lane
Bruce Momjian writes: > On Wed, Dec 23, 2020 at 07:18:24AM +0100, Pavel Stehule wrote: >> Implementation of tsv format should not be hard. >> What do you think about this? > How would you handle tabs in the data? The main problem with csv is the severe lack of standardization around what to do w

Re: Discarding DISCARD ALL

2020-12-23 Thread Andreas Karlsson
On 12/23/20 3:47 PM, Vladimir Sitnikov wrote: Simon>It seems strange to me that we put this work onto the pooler, forcing Simon>poolers to repeatedly issue the same command What if poolers learn to manage connections and prepared statements better? Then poolers won't have to reset the session ev

Re: proposal - support tsv output format for psql

2020-12-23 Thread Pavel Stehule
st 23. 12. 2020 v 15:21 odesílatel Bruce Momjian napsal: > On Wed, Dec 23, 2020 at 07:18:24AM +0100, Pavel Stehule wrote: > > Hi > > > > I am playing with clipboard on Linux, and I found a way, how to redirect > psql > > output to clipboard via wl-copy or xclip and then to Libre Office. Now > it

Re: Discarding DISCARD ALL

2020-12-23 Thread Vladimir Sitnikov
Simon>It seems strange to me that we put this work onto the pooler, forcing Simon>poolers to repeatedly issue the same command What if poolers learn to manage connections and prepared statements better? Then poolers won't have to reset the session every time, and everyone wins. Simon>This has an

Re: postgres_fdw - cached connection leaks if the associated user mapping/foreign server is dropped

2020-12-23 Thread Bharath Rupireddy
On Wed, Dec 23, 2020 at 7:31 PM Fujii Masao wrote: > I agree to make pgfdw_xact_callback() close the connection when > entry->invalidated == true. But I think that it's better to get rid of > have_invalid_connections flag and make pgfdw_inval_callback() close > the connection immediately if entry-

Discarding DISCARD ALL

2020-12-23 Thread Simon Riggs
Currently, session poolers operating in transaction mode need to send a "server_reset_query" which is mostly DISCARD ALL. It seems strange to me that we put this work onto the pooler, forcing poolers to repeatedly issue the same command, at some cost in performance. Measuring the overhead with pgb

Re: proposal - support tsv output format for psql

2020-12-23 Thread Bruce Momjian
On Wed, Dec 23, 2020 at 07:18:24AM +0100, Pavel Stehule wrote: > Hi > > I am playing with clipboard on Linux, and I found a way, how to redirect psql > output to clipboard via wl-copy or xclip and then to Libre Office. Now it > looks > so best format is tsv > > select * from pg_database \g (form

Re: Feature request: Connection string parsing for postgres_fdw

2020-12-23 Thread Eric Hanson
On Wed, Dec 23, 2020 at 5:39 AM Ashutosh Bapat wrote: > https://www.postgresql.org/docs/13/libpq-connect.html#LIBPQ-PARAMKEYWORDS > lists the parameters that postgres_fdw accepts. "dbname" can be more > than just dbname. See > https://www.postgresql.org/docs/13/libpq-connect.html#LIBPQ-CONNSTRING

Re: [PATCH] Automatic HASH and LIST partition creation

2020-12-23 Thread Pavel Borisov
> > My 0.02 €: What I think does not matter much, what committers think is the > way to pass something. However, I do not think that such an idea would > pass a committer:-) > The same idea was the reason for my proposal to make automatic partitioning clauses to be in accordance with existing decl

Re: postgres_fdw - cached connection leaks if the associated user mapping/foreign server is dropped

2020-12-23 Thread Fujii Masao
On 2020/12/15 11:38, Bharath Rupireddy wrote: Hi, As discussed in [1], in postgres_fdw the cached connections to remote servers can stay until the lifetime of the local session without getting a chance to disconnect (connection leak), if the underlying user mapping or foreign server is dropped

RE: [Patch] Optimize dropping of relation buffers using dlist

2020-12-23 Thread tsunakawa.ta...@fujitsu.com
From: Jamison, Kirk/ジャミソン カーク compiles. Passes the regression tests too. > Your feedbacks are definitely welcome. The code looks correct and has become further compact. Remains ready for committer. Regards Takayuki Tsunakawa

Re: [PATCH] Automatic HASH and LIST partition creation

2020-12-23 Thread Fabien COELHO
Fabien, do you consider it possible to change the syntax of declarative partitioning too? My 0.02 €: What I think does not matter much, what committers think is the way to pass something. However, I do not think that such an idea would pass a committer:-) It is problematic as it is already

Re: Fail Fast In CTAS/CMV If Relation Already Exists To Avoid Unnecessary Rewrite, Planning Costs

2020-12-23 Thread Bharath Rupireddy
On Wed, Dec 23, 2020 at 6:01 PM Michael Paquier wrote: > On Tue, Dec 22, 2020 at 03:12:15PM +0530, Bharath Rupireddy wrote: > > On Tue, Dec 22, 2020 at 2:07 PM Michael Paquier wrote: > >> Note: I'd like to think that we could choose a better name for > >> CheckRelExistenceInCTAS(). > > > > I chan

Re: libpq compression

2020-12-23 Thread Daniil Zakhlystov
Hi! I’ve contacted Yann Collet (developer of ZSTD) and told him about our discussion. Here is his comment: > Hi Daniil > • Is this an expected behavior of ZSTD to consume more memory during > the decompression of data that was compressed with a high compression ratio? > > I assume that

Re: Feature request: Connection string parsing for postgres_fdw

2020-12-23 Thread Ashutosh Bapat
On Wed, Dec 23, 2020 at 6:35 PM Eric Hanson wrote: > > I'm trying to store connection to postgres_fdw in the database I want to be > able to store the full breadth of connection styles and all the different > types of connections that libpq supports. But having some troubles. > > Postgres_fdw

Re: Movement of restart_lsn position movement of logical replication slots is very slow

2020-12-23 Thread Jammie
Thanks Amit for the response. Two things : 1) In our observation via PSQL the advance command as well do not move the restart_lsn immediately. It is similar to our approach that use the confirmed_flush_lsn via stream 2) I am ok to understand the point that we are not reading from the stream so we m

Feature request: Connection string parsing for postgres_fdw

2020-12-23 Thread Eric Hanson
I'm trying to store connection to postgres_fdw in the database I want to be able to store the full breadth of connection styles and all the different types of connections that libpq supports. But having some troubles. Postgres_fdw wants options passed into CREATE SERVER, all broken out into sepa

RE: [Patch] Optimize dropping of relation buffers using dlist

2020-12-23 Thread k.jami...@fujitsu.com
On Wed, December 23, 2020 5:57 PM (GMT+9), Amit Kapila wrote: > > > > At Wed, 23 Dec 2020 04:22:19 +, "tsunakawa.ta...@fujitsu.com" > > wrote in > > > From: Amit Kapila > > > > + /* Get the number of blocks for a relation's fork */ block[i][j] > > > > + = smgrnblocks(smgr_reln[i], j, &cached)

Re: Deadlock between backend and recovery may not be detected

2020-12-23 Thread Fujii Masao
On 2020/12/23 19:28, Masahiko Sawada wrote: On Tue, Dec 22, 2020 at 11:58 PM Fujii Masao wrote: On 2020/12/22 20:42, Fujii Masao wrote: On 2020/12/22 10:25, Masahiko Sawada wrote: On Fri, Dec 18, 2020 at 6:36 PM Fujii Masao wrote: On 2020/12/17 2:15, Fujii Masao wrote: On 2020/

Re: Fail Fast In CTAS/CMV If Relation Already Exists To Avoid Unnecessary Rewrite, Planning Costs

2020-12-23 Thread Michael Paquier
On Tue, Dec 22, 2020 at 03:12:15PM +0530, Bharath Rupireddy wrote: > On Tue, Dec 22, 2020 at 2:07 PM Michael Paquier wrote: >> Note: I'd like to think that we could choose a better name for >> CheckRelExistenceInCTAS(). > > I changed it to IsCTASRelCreationAllowed() and attached a v5 patch. > Ple

Re: Confused about stream replication protocol documentation

2020-12-23 Thread Fujii Masao
On 2020/12/23 11:08, Li Japin wrote: On Dec 22, 2020, at 11:13 PM, Fujii Masao mailto:masao.fu...@oss.nttdata.com>> wrote: ‘B’ means a backend and ‘F’ means a frontend. Maybe as [1] does, we should add the note like "Each is marked to indicate that it can be sent by a frontend (F) and a bac

Re: [PATCH] Automatic HASH and LIST partition creation

2020-12-23 Thread Pavel Borisov
> > > > BTW could you tell me a couple of words about pros and cons of c-code > > syntax parsing comparing to parsing using gram.y trees? > > I'd rather use an automatic tool (lexer/parser) if possible instead of > doing it by hand if I can. If you want a really nice syntax with clever > tricks, th

Re: Logical decoding without slots: decoding in lockstep with recovery

2020-12-23 Thread Amit Kapila
On Wed, Dec 23, 2020 at 12:26 PM Craig Ringer wrote: > > Hi all > > I want to share an idea I've looked at a few times where I've run into > situations where logical slots were inadvertently dropped, or where it became > necessary to decode changes in the past on a slot. > > As most of you will

Re: Deadlock between backend and recovery may not be detected

2020-12-23 Thread Masahiko Sawada
On Tue, Dec 22, 2020 at 11:58 PM Fujii Masao wrote: > > > > On 2020/12/22 20:42, Fujii Masao wrote: > > > > > > On 2020/12/22 10:25, Masahiko Sawada wrote: > >> On Fri, Dec 18, 2020 at 6:36 PM Fujii Masao > >> wrote: > >>> > >>> > >>> > >>> On 2020/12/17 2:15, Fujii Masao wrote: > > >

Re: Single transaction in the tablesync worker?

2020-12-23 Thread Amit Kapila
On Tue, Dec 22, 2020 at 4:58 PM Peter Smith wrote: > > On Mon, Dec 21, 2020 at 11:36 PM Amit Kapila wrote: > > > > On Mon, Dec 21, 2020 at 3:17 PM Peter Smith wrote: > > > > > > On Mon, Dec 21, 2020 at 4:23 PM Amit Kapila > > > wrote: > > > > > > > Few other comments: > > > > =

Re: Single transaction in the tablesync worker?

2020-12-23 Thread Amit Kapila
On Wed, Dec 23, 2020 at 11:49 AM Peter Smith wrote: > > Hi Amit. > > PSA my v7 WIP patch for the Solution1. > Few comments: 1. + * Rarely, the DropSubscription may be issued when a tablesync still + * is in SYNCDONE but not yet in READY state. If this happens then + * the drop sl

Re: Single transaction in the tablesync worker?

2020-12-23 Thread Peter Smith
Hi Amit. PSA my v8 WIP patch for the Solution1. This has the same code changes as the v7 patch, but the v8 patch can be applied to the current PG OSS master code base. Coded / WIP: * tablesync slot is now permanent instead of temporary. The tablesync slot name is no longer tied to the Sub

RE: Parallel copy

2020-12-23 Thread Hou, Zhijie
Hi > Yes this optimization can be done, I will handle this in the next patch > set. > I have a suggestion for the parallel safety-check. As designed, The leader does not participate in the insertion of data. If User use (PARALLEL 1), there is only one worker process which will do the insertion

Re: [POC] Fast COPY FROM command for the table with foreign partitions

2020-12-23 Thread Andrey V. Lepikhov
On 12/22/20 12:04 PM, Tang, Haiying wrote: Hi Andrey, There is an error report in your patch as follows. Please take a check. https://travis-ci.org/github/postgresql-cfbot/postgresql/jobs/750682857#L1519 copyfrom.c:374:21: error: ‘save_cur_lineno’ is used uninitialized in this function [-Wer

Re: [Patch] Optimize dropping of relation buffers using dlist

2020-12-23 Thread Amit Kapila
On Wed, Dec 23, 2020 at 10:42 AM Kyotaro Horiguchi wrote: > > At Wed, 23 Dec 2020 04:22:19 +, "tsunakawa.ta...@fujitsu.com" > wrote in > > From: Amit Kapila > > > + /* Get the number of blocks for a relation's fork */ > > > + block[i][j] = smgrnblocks(smgr_reln[i], j, &cached); > > > + > >

Re: [Patch] Optimize dropping of relation buffers using dlist

2020-12-23 Thread Amit Kapila
On Wed, Dec 23, 2020 at 1:07 PM k.jami...@fujitsu.com wrote: > > On Tuesday, December 22, 2020 9:11 PM, Amit Kapila wrote: > > > In this code, I am slightly worried about the additional cost of each time > > checking smgrexists. Consider a case where there are many relations and only > > one or fe