Re: Single transaction in the tablesync worker?

2021-02-02 Thread Ajin Cherian
On Tue, Feb 2, 2021 at 9:03 PM Ajin Cherian wrote: > I am sorry, my above steps were not correct. I think the reason for > the failure I was seeing were some other steps I did prior to this. I > will recreate this and update you with the appropriate steps. The correct steps are as follows: Publ

Re: Typo in tablesync comment

2021-02-02 Thread Peter Smith
On Wed, Feb 3, 2021 at 6:13 PM Michael Paquier wrote: > > On Tue, Feb 02, 2021 at 07:23:37PM +0530, Amit Kapila wrote: > > I don't mind changing to your proposed text but I think the current > > wording is also okay and seems clear to me. > > Reading that again, I still find the word "transient" t

Re: Printing backtrace of postgres processes

2021-02-02 Thread Tom Lane
vignesh C writes: > On Mon, Feb 1, 2021 at 11:04 AM Bharath Rupireddy > wrote: >> Are these superuser and permission checks enough from a security >> standpoint that we don't expose some sensitive information to the >> user? > This will just print the backtrace of the current backend. Users > ca

Re: Typo in tablesync comment

2021-02-02 Thread Michael Paquier
On Tue, Feb 02, 2021 at 07:23:37PM +0530, Amit Kapila wrote: > I don't mind changing to your proposed text but I think the current > wording is also okay and seems clear to me. Reading that again, I still find the word "transient" to be misleading in this context. Any extra opinions? -- Michael

Re: Printing backtrace of postgres processes

2021-02-02 Thread vignesh C
On Mon, Feb 1, 2021 at 11:04 AM Bharath Rupireddy wrote: > > On Mon, Feb 1, 2021 at 6:14 AM Bharath Rupireddy > wrote: > > On Fri, Jan 29, 2021 at 7:10 PM vignesh C wrote: > > > > 4) How about following > > > > + errmsg("must be a superuser to print backtrace > > > > of backe

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

2021-02-02 Thread Justin Pryzby
On Wed, Feb 03, 2021 at 03:37:39PM +0900, Michael Paquier wrote: > index 627b36300c..4ee3951ca0 100644 > --- a/doc/src/sgml/ref/reindex.sgml > +++ b/doc/src/sgml/ref/reindex.sgml > @@ -293,8 +311,30 @@ REINDEX [ ( class="parameter">option [, ...] ) ] { IN > respectively. Each partition of the

Re: Printing backtrace of postgres processes

2021-02-02 Thread vignesh C
Thanks Bharath for your comments. On Mon, Feb 1, 2021 at 6:14 AM Bharath Rupireddy wrote: > > On Fri, Jan 29, 2021 at 7:10 PM vignesh C wrote: > > > 4) How about following > > > + errmsg("must be a superuser to print backtrace > > > of backend process"))); > > > instead of >

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

2021-02-02 Thread Michael Paquier
On Tue, Feb 02, 2021 at 10:32:19AM +0900, Michael Paquier wrote: > On Mon, Feb 01, 2021 at 06:28:57PM +0300, Alexey Kondratov wrote: > > Hm, IIUC, REINDEX CONCURRENTLY doesn't use either of them. It directly uses > > index_create() with a proper tablespaceOid instead of > > SetRelationTableSpace().

Can we have a new SQL callable function to get Postmaster PID?

2021-02-02 Thread Bharath Rupireddy
Hi, Can we have a new function, say pg_postgres_pid(), to return postmaster PID similar to pg_backend_pid()? At times, it will be difficult to use OS level commands to get the postmaster pid of a backend to which it is connected. It's even worse if we have multiple postgres server instances runnin

Re: Support ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION ... syntax

2021-02-02 Thread Bharath Rupireddy
On Thu, Jan 28, 2021 at 10:07 AM japin wrote: > Attaching v3 patches, please consider these for further review. I think we can add a commitfest entry for this feature, so that the patches will be tested on cfbot. Ignore if done already. With Regards, Bharath Rupireddy. EnterpriseDB: http://www.e

Re: Identify missing publications from publisher while create/alter subscription.

2021-02-02 Thread Bharath Rupireddy
On Mon, Jan 25, 2021 at 10:32 PM vignesh C wrote: > > I mean it doesn’t seem right to disallow to create the subscription if > > the publisher doesn't exist, and my reasoning was even though the > > publisher exists while creating the subscription you might drop it > > later right?. So basically,

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

2021-02-02 Thread Bharath Rupireddy
On Tue, Feb 2, 2021 at 9:45 AM Fujii Masao wrote: > One merit of keep_connections that I found is that we can use it even > when connecting to the older PostgreSQL that doesn't support > idle_session_timeout. Also it seems simpler to use keep_connections > rather than setting idle_session_timeout

Re: [HACKERS] Custom compression methods

2021-02-02 Thread Dilip Kumar
On Wed, Feb 3, 2021 at 2:07 AM Robert Haas wrote: > > Even more review comments, still looking mostly at 0001: > > If there's a reason why parallel_schedule is arranging to run the > compression test in parallel with nothing else, the comment in that > file should explain the reason. If there isn'

Re: memory leak in auto_explain

2021-02-02 Thread japin
On Wed, 03 Feb 2021 at 02:13, Tom Lane wrote: > japin writes: >> Here's my analysis: >> 1) In the explain_ExecutorEnd(), it will create a ExplainState on SQL >> function >> memory context, which is a long-lived, cause the memory grow up. > > Yeah, agreed. I think people looking at this have a

Re: Single transaction in the tablesync worker?

2021-02-02 Thread Peter Smith
On Wed, Feb 3, 2021 at 1:34 PM Amit Kapila wrote: > > On Wed, Feb 3, 2021 at 6:38 AM Peter Smith wrote: > > > > On Wed, Feb 3, 2021 at 12:26 AM Amit Kapila wrote: > > > > > > On Tue, Feb 2, 2021 at 3:31 PM Peter Smith wrote: > > > > > > > > After seeing Ajin's test [ac0202] which did a DROP TAB

Re: Single transaction in the tablesync worker?

2021-02-02 Thread Amit Kapila
On Wed, Feb 3, 2021 at 6:38 AM Peter Smith wrote: > > On Wed, Feb 3, 2021 at 12:26 AM Amit Kapila wrote: > > > > On Tue, Feb 2, 2021 at 3:31 PM Peter Smith wrote: > > > > > > After seeing Ajin's test [ac0202] which did a DROP TABLE, I have also > > > tried a simple test where I do a DROP TABLE w

Re: libpq debug log

2021-02-02 Thread Kyotaro Horiguchi
At Wed, 3 Feb 2021 01:26:41 +, "tsunakawa.ta...@fujitsu.com" wrote in > (41) > +void > +PQtraceEx(PGconn *conn, FILE *debug_port, int flags) > +{ > + if (conn == NULL) > + return; > ... > + if (!debug_port) > + return; > > The if should better be as follows t

RE: libpq debug log

2021-02-02 Thread tsunakawa.ta...@fujitsu.com
From: 'Alvaro Herrera' > > + conn->fe_msg->num_fields != DEF_FE_MSGFIELDS) > The rationale for that second condition is this: if the memory allocated > is the initial size, we don't free memory, because it would just be > allocated of the same size next time, and that size is not very b

Re: adding wait_start column to pg_locks

2021-02-02 Thread Fujii Masao
On 2021/02/03 1:49, Fujii Masao wrote: On 2021/02/02 22:00, torikoshia wrote: On 2021-01-25 23:44, Fujii Masao wrote: Another comment is; Doesn't the change of MyProc->waitStart need the lock table's partition lock? If yes, we can do that by moving LWLockRelease(partitionLock) just after t

Re: Single transaction in the tablesync worker?

2021-02-02 Thread Ajin Cherian
On Wed, Feb 3, 2021 at 12:24 AM Amit Kapila wrote: > The problem here is that we are allowing to drop the table when table > synchronization is still in progress and then we don't have any way to > know the corresponding slot or origin. I think we can try to drop the > slot and origin as well but

RE: libpq debug log

2021-02-02 Thread tsunakawa.ta...@fujitsu.com
(39) + of tracing. If (flags & PQTRACE_OUTPUT_TIMESTAMPS) is + true, then timestamp is not printed with each message. The flag name (OUTPUT) and its description (not printed) doesn't match. I think you can use less programmatical expression like "If flags contains PQTRACE_OUTPUT_TIME

Re: Single transaction in the tablesync worker?

2021-02-02 Thread Peter Smith
On Wed, Feb 3, 2021 at 12:26 AM Amit Kapila wrote: > > On Tue, Feb 2, 2021 at 3:31 PM Peter Smith wrote: > > > > After seeing Ajin's test [ac0202] which did a DROP TABLE, I have also > > tried a simple test where I do a DROP TABLE with very bad timing for > > the tablesync worker. It seems that d

RE: Determine parallel-safety of partition relations for Inserts

2021-02-02 Thread Hou, Zhijie
> For v3_0003-reloption-parallel_dml-src.patch : > +   table_close(rel, NoLock); > Since the rel would always be closed, it seems the return value from  > RelationGetParallelDML() can be assigned to a variable, followed by call to  > table_close(), then the return statement. Thanks for the commen

RE: Determine parallel-safety of partition relations for Inserts

2021-02-02 Thread Hou, Zhijie
Hi, Attaching v5 patches with the changes: * rebase the code on the greg's latest parallel insert patch * fix some code style. Please consider it for further review. Best regards, Houzj v5_0004-reloption-parallel_dml-test-and-doc.patch Description: v5_0004-reloption-parallel_dml-tes

Re: LogwrtResult contended spinlock

2021-02-02 Thread Andres Freund
Hi, On 2021-02-02 20:19:19 -0300, Alvaro Herrera wrote: > > > @@ -1169,6 +1169,8 @@ XLogInsertRecord(XLogRecData *rdata, > > > { > > > /* advance global request to include new block(s) > > > */ > > > pg_atomic_monotonic_advance_u64(&XLogCtl->LogwrtRqst.Write, > > >

Re: Recording foreign key relationships for the system catalogs

2021-02-02 Thread Tom Lane
I wrote: > * It would now be possible to remove the PGNSP and PGUID kluges > entirely in favor of plain BKI_LOOKUP references to pg_namespace > and pg_authid. The catalog header usage would get a little > more verbose: BKI_DEFAULT(PGNSP) becomes BKI_DEFAULT(pg_catalog) > and BKI_DEFAULT(PGUID) bec

Re: LogwrtResult contended spinlock

2021-02-02 Thread Alvaro Herrera
Hello, So I addressed about half of your comments in this version merely by fixing silly bugs. The problem I had which I described as "synchronization fails" was one of those silly bugs. So in further thinking, it seems simpler to make only LogwrtResult atomic, and leave LogwrtRqst as currently,

Re: Proposal: Save user's original authenticated identity for logging

2021-02-02 Thread Jacob Champion
On Thu, 2021-01-28 at 18:22 +, Jacob Champion wrote: > = Proposal = > > I propose that every auth method should store the string it uses to > identify a user -- what I'll call an "authenticated identity" -- into > one central location in Port, after authentication succeeds but before > any pg_

Re: Recording foreign key relationships for the system catalogs

2021-02-02 Thread Tom Lane
"Joel Jacobson" writes: > On Tue, Feb 2, 2021, at 17:00, Tom Lane wrote: >> Appreciate the review! Please confirm if you agree with above >> analysis. > Yes, I agree with the analysis. Cool, thanks. I've pushed it now. regards, tom lane

Re: Background writer and checkpointer in crash recovery

2021-02-02 Thread Robert Haas
On Sat, Aug 29, 2020 at 8:13 PM Thomas Munro wrote: > Currently we don't run the bgwriter process during crash recovery. > I've CCed Simon and Heikki who established this in commit cdd46c76. > Based on that commit message, I think the bar to clear to change the > policy is to show that it's useful

Re: Perform COPY FROM encoding conversions in larger chunks

2021-02-02 Thread John Naylor
On Mon, Feb 1, 2021 at 12:15 PM Heikki Linnakangas wrote: > Thanks. I fixed it slightly differently, and also changed LocalToUtf() > to follow the same pattern, even though LocalToUtf() did not have the > same bug. Looks good to me. > I added a bunch of tests for various built-in conversions. N

Re: [PATCH] Doc: improve documentation of oid columns that can be zero. (correct version)

2021-02-02 Thread Tom Lane
"Joel Jacobson" writes: > Doc: improve documentation of oid columns that can be zero. Since this is pretty closely tied to the catalog-foreign-key work, I went ahead and reviewed/pushed it. The zero notations now match up with what we'd found in the other thread. regards

Re: [HACKERS] Custom compression methods

2021-02-02 Thread Robert Haas
Even more review comments, still looking mostly at 0001: If there's a reason why parallel_schedule is arranging to run the compression test in parallel with nothing else, the comment in that file should explain the reason. If there isn't, it should be added to a parallel group that doesn't have th

Re: New IndexAM API controlling index vacuum strategies

2021-02-02 Thread Peter Geoghegan
On Tue, Feb 2, 2021 at 6:28 AM Victor Yegorov wrote: > I really like this idea! Cool! > It resembles the approach used in bottom-up index deletion, block-based > accounting provides a better estimate for the usefulness of the operation. It does resemble bottom-up index deletion, in one importan

Re: Thoughts on "killed tuples" index hint bits support on standby

2021-02-02 Thread Michail Nikolaev
Hello, Peter. > AFAICT that's not true, at least not in any practical sense. See the > comment in the middle of MarkBufferDirtyHint() that begins with "If we > must not write WAL, due to a relfilenode-specific...", and see the > "Checksums" section at the end of src/backend/storage/page/README. Th

Re: Recording foreign key relationships for the system catalogs

2021-02-02 Thread Joel Jacobson
On Tue, Feb 2, 2021, at 17:00, Tom Lane wrote: >No, I think it's correct as-is (and this is one reason that I chose to >have two separate FK entries for cases like this). confrelid can be >zero in rows that are not FK constraints. However, such a row must >also have empty confkey. The above entr

Re: bugfix - plpgsql - statement counter is incremented 2x for FOR stmt

2021-02-02 Thread Pavel Stehule
út 2. 2. 2021 v 20:36 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > When I fixed one plpgsql_check issue, I found another plpgsql issue. Now > we > > have field nstatements that hold a number of plpgsql statements in > > function. Unfortunately I made an error when I wrote this functio

Re: bugfix - plpgsql - statement counter is incremented 2x for FOR stmt

2021-02-02 Thread Tom Lane
Pavel Stehule writes: > When I fixed one plpgsql_check issue, I found another plpgsql issue. Now we > have field nstatements that hold a number of plpgsql statements in > function. Unfortunately I made an error when I wrote this functionality and > for FOR statements, this counter is incremented 2

Re: memory leak in auto_explain

2021-02-02 Thread Tom Lane
japin writes: > Here's my analysis: > 1) In the explain_ExecutorEnd(), it will create a ExplainState on SQL function > memory context, which is a long-lived, cause the memory grow up. Yeah, agreed. I think people looking at this have assumed that the ExecutorEnd hook would automatically be runni

bugfix - plpgsql - statement counter is incremented 2x for FOR stmt

2021-02-02 Thread Pavel Stehule
Hi When I fixed one plpgsql_check issue, I found another plpgsql issue. Now we have field nstatements that hold a number of plpgsql statements in function. Unfortunately I made an error when I wrote this functionality and for FOR statements, this counter is incremented 2x. Higher number than a rea

Re: adding wait_start column to pg_locks

2021-02-02 Thread Fujii Masao
On 2021/02/02 22:00, torikoshia wrote: On 2021-01-25 23:44, Fujii Masao wrote: Another comment is; Doesn't the change of MyProc->waitStart need the lock table's partition lock? If yes, we can do that by moving LWLockRelease(partitionLock) just after the change of MyProc->waitStart, but which

Re: Recording foreign key relationships for the system catalogs

2021-02-02 Thread Tom Lane
"Joel Jacobson" writes: > I could only find one minor error, > found by running the regression-tests, > and then using the query below to compare "is_opt" > with my own "zero_values" in my tool > that derives its value from pg_catalog content. > ... > I therefore think is_opt should be changed to

Re: Key management with tests

2021-02-02 Thread Bruce Momjian
On Mon, Feb 1, 2021 at 07:47:57PM -0500, Bruce Momjian wrote: > On Mon, Feb 1, 2021 at 06:31:32PM -0500, Stephen Frost wrote: > > * Bruce Momjian (br...@momjian.us) wrote: > > > The purpose of cluster file encryption is to prevent users with read > > > access to the directories used to store

Re: Add primary keys to system catalogs

2021-02-02 Thread Julien Rouhaud
On Tue, Feb 2, 2021 at 11:17 PM Tom Lane wrote: > > Dunno about refobjversion; I have my doubts that putting that info in > pg_depend was a sane design choice at all. But from what I understand > of it, wouldn't all deps on a given object necessarily have the same > version? Correct, assuming of

Re: Add primary keys to system catalogs

2021-02-02 Thread Tom Lane
Peter Eisentraut writes: > I do wonder, however, under what circumstances code would be put into a > situation where it would add the exact same dependency again, and also > under what circumstances it would add a dependency between the same > objects but a different deptype, and how that would

Race between KeepFileRestoredFromArchive() and restartpoint

2021-02-02 Thread Noah Misch
A race with KeepFileRestoredFromArchive() can cause a restartpoint to fail, as seen once on the buildfarm[1]. The attached patch adds a test case; it applies atop the "stop events" patch[2]. We have two systems for adding long-term pg_wal directory entries. KeepFileRestoredFromArchive() adds the

Re: Add primary keys to system catalogs

2021-02-02 Thread Julien Rouhaud
On Tue, Feb 2, 2021 at 6:49 PM Peter Eisentraut wrote: > > I do wonder, however, under what circumstances code would be put into a > situation where it would add the exact same dependency again, and also > under what circumstances it would add a dependency between the same > objects but a differen

Re: New IndexAM API controlling index vacuum strategies

2021-02-02 Thread Victor Yegorov
вт, 2 февр. 2021 г. в 05:27, Peter Geoghegan : > And now here is the second thing I thought of, which is much better: > > Sometimes 1% of the dead tuples in a heap relation will be spread > across 90%+ of the pages. With other workloads 1% of dead tuples might > be highly concentrated, and appear

Re: libpq debug log

2021-02-02 Thread 'Alvaro Herrera'
On 2021-Jan-29, tsunakawa.ta...@fujitsu.com wrote: > (30) > +/* > + * Deallocate FE/BE message tracking memory. We only do this because > + * FE message can grow arbitrarily large, and skip it in the initial state, > + * because it's likely pointless. > + */ > +void > +pqTraceUninit(PGconn *conn)

Re: [PATCH] remove deprecated v8.2 containment operators

2021-02-02 Thread Justin Pryzby
On Mon, Nov 30, 2020 at 02:09:10PM -0500, Tom Lane wrote: > Justin Pryzby writes: > > I think this is waiting on me to provide a patch for the contrib/ modules > > with > > update script removing the SQL operators, and documentating their > > deprecation. > > Right. We can remove the SQL opera

Re: Typo in tablesync comment

2021-02-02 Thread Amit Kapila
On Tue, Feb 2, 2021 at 10:49 AM Michael Paquier wrote: > > On Tue, Feb 02, 2021 at 10:38:31AM +1100, Peter Smith wrote: > > PSA a trivial patch to correct what seems like a typo in the tablesync > > comment. > > - * subscribed tables and their state. Some transient state during data > - *

RE: libpq debug log

2021-02-02 Thread iwata....@fujitsu.com
Hi all, Thank you Kirk san for creating the v14 patch. I update the patch. I fixed all of Tsunakawa san's review comments. I am trying to solve three bugs. Two bags were pointed out by Alvaro san in a previous e-mail. And I found one bug. > From: Alvaro Herrera > Sent: Friday, January 22, 202

Re: Single transaction in the tablesync worker?

2021-02-02 Thread Amit Kapila
On Tue, Feb 2, 2021 at 3:31 PM Peter Smith wrote: > > After seeing Ajin's test [ac0202] which did a DROP TABLE, I have also > tried a simple test where I do a DROP TABLE with very bad timing for > the tablesync worker. It seems that doing this can cause the sync > worker's MyLogicalRepWorker->reli

Re: Single transaction in the tablesync worker?

2021-02-02 Thread Amit Kapila
On Tue, Feb 2, 2021 at 11:35 AM Ajin Cherian wrote: > > Another failure I see in my testing > The problem here is that we are allowing to drop the table when table synchronization is still in progress and then we don't have any way to know the corresponding slot or origin. I think we can try to d

Re: adding wait_start column to pg_locks

2021-02-02 Thread torikoshia
On 2021-01-25 23:44, Fujii Masao wrote: Another comment is; Doesn't the change of MyProc->waitStart need the lock table's partition lock? If yes, we can do that by moving LWLockRelease(partitionLock) just after the change of MyProc->waitStart, but which causes the time that lwlock is being held t

Re: [PATCH] Doc: improve documentation of oid columns that can be zero. (correct version)

2021-02-02 Thread Joel Jacobson
On Tue, Feb 2, 2021, at 12:34, Euler Taveira wrote: >You should probably email: webmaster (at) postgresql (dot) org Thanks, done. /Joel

Re: row filtering for logical replication

2021-02-02 Thread Euler Taveira
On Tue, Feb 2, 2021, at 8:38 AM, japin wrote: > In 0003 patch, function GetPublicationRelationQuals() has been defined, but it > never used. So why should we define it? Thanks for taking a look again. It is an oversight. It was introduced in an attempt to refactor ALTER PUBLICATION SET TABLE. In A

Re: Improve new hash partition bound check error messages

2021-02-02 Thread Heikki Linnakangas
On 02/02/2021 12:35, Peter Eisentraut wrote: I had a bit of trouble parsing the error message "every hash partition modulus must be a factor of the next larger modulus", so I went into the code, added some comments and added errdetail messages for each case. I think it's a bit clearer now. Yea

Re: Improve new hash partition bound check error messages

2021-02-02 Thread Amit Langote
On Tue, Feb 2, 2021 at 7:36 PM Peter Eisentraut wrote: > I had a bit of trouble parsing the error message "every hash partition > modulus must be a factor of the next larger modulus", so I went into the > code, added some comments and added errdetail messages for each case. I > think it's a bit c

Re: row filtering for logical replication

2021-02-02 Thread japin
On Tue, 02 Feb 2021 at 19:16, japin wrote: > On Tue, 02 Feb 2021 at 13:02, Michael Paquier wrote: >> On Mon, Feb 01, 2021 at 04:11:50PM -0300, Euler Taveira wrote: >>> After the commit 3696a600e2, the last patch does not apply cleanly. I'm >>> attaching another version to address the documentat

Re: [PATCH] Doc: improve documentation of oid columns that can be zero. (correct version)

2021-02-02 Thread Euler Taveira
On Tue, Feb 2, 2021, at 5:13 AM, Joel Jacobson wrote: > I've tried to login to the CF interface a couple of times now, but seems to > have lost my password. > I've tried to use the "Password reset" form [1], but I don't get any email. > The email is correct, because when I try to re-register it sa

Re: Typo in tablesync comment

2021-02-02 Thread Euler Taveira
On Tue, Feb 2, 2021, at 2:19 AM, Michael Paquier wrote: > On Tue, Feb 02, 2021 at 10:38:31AM +1100, Peter Smith wrote: > > PSA a trivial patch to correct what seems like a typo in the tablesync > > comment. > > - * subscribed tables and their state. Some transient state during data > - *

Re: row filtering for logical replication

2021-02-02 Thread japin
On Tue, 02 Feb 2021 at 13:02, Michael Paquier wrote: > On Mon, Feb 01, 2021 at 04:11:50PM -0300, Euler Taveira wrote: >> After the commit 3696a600e2, the last patch does not apply cleanly. I'm >> attaching another version to address the documentation issues. > > I have bumped into this thread, a

Re: Add primary keys to system catalogs

2021-02-02 Thread Peter Eisentraut
On 2021-01-22 16:42, Tom Lane wrote: pg_depend pg_shdepend Yeah, this is noted in the patch's own regression tests. Wouldn't it be possible to add primary keys to these two as well? Neither of the existing indexes is suitable, not being unique. We could imagine adding a unique index across t

Re: Add primary keys to system catalogs

2021-02-02 Thread Peter Eisentraut
On 2021-02-01 15:24, Tom Lane wrote: Peter Eisentraut writes: On 2021-01-30 22:56, Tom Lane wrote: Hmm, shouldn't there have been a catversion bump in there? I suppose yes on the grounds that it introduces something new in a freshly initdb-ed database. But I thought it wasn't necessary bec

Improve new hash partition bound check error messages

2021-02-02 Thread Peter Eisentraut
I had a bit of trouble parsing the error message "every hash partition modulus must be a factor of the next larger modulus", so I went into the code, added some comments and added errdetail messages for each case. I think it's a bit clearer now. From e7f392e2f8950236a22f007cc3aed36729da22e1 Mon

Re: Single transaction in the tablesync worker?

2021-02-02 Thread Ajin Cherian
On Tue, Feb 2, 2021 at 7:40 PM Amit Kapila wrote: > > On Tue, Feb 2, 2021 at 10:34 AM Ajin Cherian wrote: > > > > On Mon, Feb 1, 2021 at 11:26 PM Amit Kapila wrote: > > > I have updated the patch to display WARNING for each of the tablesync > > > slots during DropSubscription. As discussed, I ha

Re: Single transaction in the tablesync worker?

2021-02-02 Thread Peter Smith
After seeing Ajin's test [ac0202] which did a DROP TABLE, I have also tried a simple test where I do a DROP TABLE with very bad timing for the tablesync worker. It seems that doing this can cause the sync worker's MyLogicalRepWorker->relid to become invalid. In my test this caused a stack trace wi

Re: Two patches to speed up pg_rewind.

2021-02-02 Thread Paul Guo
On Jan 28, 2021, at 3:31 PM, Michael Paquier mailto:mich...@paquier.xyz>> wrote: On Wed, Jan 27, 2021 at 09:18:48AM +, Paul Guo wrote: Second one is use copy_file_range() for the local rewind case to replace read()+write(). This introduces copy_file_range() check and HAVE_COPY_FILE_RANGE s

Re: memory leak in auto_explain

2021-02-02 Thread japin
On Tue, 02 Feb 2021 at 07:12, Jeff Janes wrote: > On Mon, Feb 1, 2021 at 6:09 PM Jeff Janes wrote: > >> >> >> create or replace function gibberish(int) returns text language SQL as $_$ >> select left(string_agg(md5(random()::text),),$1) from >> generate_series(0,$1/32) $_$; >> >> create tabl

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

2021-02-02 Thread tsunakawa.ta...@fujitsu.com
From: Andrey Lepikhov > Of course, you can rebase it. Thank you. I might modify the basic part to incorporate my past proposal about improving the layering or modularity related to ri_useMultiInsert. (But I may end up giving up due to lack of energy.) Also, I might defer working on the exten

join plan with unexpected var clauses

2021-02-02 Thread Luc Vlaming
Hi, At a customer we came across a curious plan (see attached testcase). Given the testcase we see that the outer semi join tries to join the outer with the inner table id columns, even though the middle table id column is also there. Is this expected behavior? The reason i'm asking is two-f

Re: proposal: schema variables

2021-02-02 Thread Pavel Stehule
Hi rebase and set PK for pg_variable table Regards Pavel schema-variables-20210202.patch.gz Description: application/gzip

Re: Single transaction in the tablesync worker?

2021-02-02 Thread Amit Kapila
On Tue, Feb 2, 2021 at 10:34 AM Ajin Cherian wrote: > > On Mon, Feb 1, 2021 at 11:26 PM Amit Kapila wrote: > > I have updated the patch to display WARNING for each of the tablesync > > slots during DropSubscription. As discussed, I have moved the drop > > slot related code towards the end in Alte

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

2021-02-02 Thread Andrey Lepikhov
On 2/2/21 11:57, tsunakawa.ta...@fujitsu.com wrote: Hello, Andrey-san, From: Tang, Haiying Sometimes before i suggested additional optimization [1] which can additionally speed up COPY by 2-4 times. Maybe you can perform the benchmark for this solution too? ... But the patch no longer appli

RE: Parallel INSERT (INTO ... SELECT ...)

2021-02-02 Thread Hou, Zhijie
> > I've had a further look at this, and this walker function is doing a lot > of work recursing the parse tree, and I'm not sure that it reliably retrieves > the information that we;re looking for, for all cases of different SQL > queries. Unless it can be made much more efficient and specific to

Re: Transactions involving multiple postgres foreign servers, take 2

2021-02-02 Thread Fujii Masao
On 2021/01/27 14:08, Masahiko Sawada wrote: On Wed, Jan 27, 2021 at 10:29 AM Fujii Masao wrote: You fixed some issues. But maybe you forgot to attach the latest patches? Yes, I've attached the updated patches. Thanks for updating the patch! I tried to review 0001 and 0002 as the self-

Re: [PATCH] Doc: improve documentation of oid columns that can be zero. (correct version)

2021-02-02 Thread Joel Jacobson
Hi Euler, I've tried to login to the CF interface a couple of times now, but seems to have lost my password. I've tried to use the "Password reset" form [1], but I don't get any email. The email is correct, because when I try to re-register it says it's taken. Not sure who I should ask for help.

Re: Parallel INSERT (INTO ... SELECT ...)

2021-02-02 Thread Greg Nancarrow
On Mon, Feb 1, 2021 at 8:19 PM Hou, Zhijie wrote: > > Hi, > > When developing the reloption patch, I noticed some issues in the patch. > > 1). > > - Reduce Insert parallel-safety checks required for some SQL, by noting > > that the subquery must operate on a relation (check for RTE_RELATION in > >