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

2021-01-04 Thread Bharath Rupireddy
On Sat, Jan 2, 2021 at 11:19 AM Bharath Rupireddy wrote: > I'm sorry for the mess. I missed adding the new files into the v6-0001 > patch. Please ignore the v6 patch set and consder the v7 patch set for > further review. Note that 0002 and 0003 patches have no difference > from v5 patch set. It s

Re: Parallel Inserts in CREATE TABLE AS

2021-01-04 Thread Luc Vlaming
On 04-01-2021 14:53, Bharath Rupireddy wrote: On Mon, Jan 4, 2021 at 5:44 PM Luc Vlaming wrote: On 04-01-2021 12:16, Hou, Zhijie wrote: wrt v18-0002patch: It looks like this introduces a state machine that goes like: - starts at CTAS_PARALLEL_INS_UNDEF - possibly moves to

Re: Moving other hex functions to /common

2021-01-04 Thread Thomas Munro
On Tue, Jan 5, 2021 at 4:47 PM Bruce Momjian wrote: > ... let's see how it likes this version. cfbot ideally processes a new patch fairly quickly but I didn't think of ".diff.gz" when writing the regexp to recognise patch files. I just tweaked the relevant regexp and it's building your patch now

Re: Parallel Inserts in CREATE TABLE AS

2021-01-04 Thread Luc Vlaming
On 05-01-2021 04:59, Bharath Rupireddy wrote: On Mon, Jan 4, 2021 at 7:02 PM Bharath Rupireddy wrote: + if (IS_PARALLEL_CTAS_DEST(gstate->dest) && + ((DR_intorel *) gstate->dest)->into->rel && +

Re: pg_rewind restore_command issue in PG12

2021-01-04 Thread Michael Paquier
On Mon, Jan 04, 2021 at 04:12:34PM +0300, Amine Tengilimoglu wrote: >When I read the pg_rewind PG12 doc. It says: > > "... but if the target cluster ran for a long time after the divergence, > the old WAL files might no longer be present. In that case, they can be > manually copied from the W

Re: Parallel Inserts in CREATE TABLE AS

2021-01-04 Thread Luc Vlaming
On 04-01-2021 14:32, Bharath Rupireddy wrote: On Mon, Jan 4, 2021 at 4:22 PM Luc Vlaming > wrote: > Sorry it took so long to get back to reviewing this. Thanks for the comments. > wrt v18-0001patch: > > +               /* > +                * If the worker is f

Re: Track replica origin progress for Rollback Prepared

2021-01-04 Thread Michael Paquier
On Tue, Jan 05, 2021 at 09:35:21AM +0530, Amit Kapila wrote: > As noted in [1], without this the subscriber might again ask for > rollback prepared lsn after restart. > > Attached patch addresses this problem. Is it possible to add some tests in test_decoding? /* dump transaction origin info

Re: Moving other hex functions to /common

2021-01-04 Thread Michael Paquier
On Mon, Jan 04, 2021 at 10:47:39PM -0500, Bruce Momjian wrote: > I can see the value of passing the destination length to the hex > functions, and I think you have to pass the src length to pg_hex_encode > since the input can be binary. I assume the pg_hex_decode doesn't need > the source length b

Re: Deadlock between backend and recovery may not be detected

2021-01-04 Thread Fujii Masao
On 2020/12/25 13:16, Kyotaro Horiguchi wrote: At Wed, 23 Dec 2020 21:42:47 +0900, Fujii Masao wrote in you. Attached is the updated of the patch. What about this version? The patch contains a hunk in the following structure. + if (got_standby_lock_timeout) + goto clea

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

2021-01-04 Thread Amit Kapila
On Tue, Dec 29, 2020 at 3:15 PM Ajin Cherian wrote: > > Hi Sawada-san, > > I think Amit has a plan to commit this patch-set in phases. I will > leave it to him to decide because I think he has a plan. > I took time to refactor the test_decoding isolation test for > consistent snapshot so that it u

Re: [PATCH] LWLock self-deadlock detection

2021-01-04 Thread Craig Ringer
On Wed, 30 Dec 2020 at 10:11, Andres Freund wrote: > Hi, > > On 2020-11-27 20:22:41 +0200, Heikki Linnakangas wrote: > > On 26/11/2020 04:50, Tom Lane wrote: > > > Craig Ringer writes: > > > > On Wed, Nov 25, 2020 at 9:23 PM Ashutosh Bapat < > ashutosh.bapat@gmail.com> > > > > wrote: > > > >

RE: [PATCH] Feature improvement for CLOSE, FETCH, MOVE tab completion

2021-01-04 Thread Shinya11.Kato
Thank you for your review! I fixed some codes and attach a new patch. >When I applied the patch, I got the following whitespace warnings: > >$ git apply ~/patches/fix_tab_complete_close_fetch_move.patch >/home/masahiko/patches/fix_tab_complete_close_fetch_move.patch:40: >indent with spaces. >

Re: Reducing WaitEventSet syscall churn

2021-01-04 Thread Thomas Munro
On Fri, Jul 31, 2020 at 9:42 AM Thomas Munro wrote: > On Thu, Jul 30, 2020 at 5:50 PM Thomas Munro wrote: > > I pushed those three patches, but will wait for more discussion on the rest. > > And here's a rebase, to make cfbot happy. And again. To restate the two goals of the remaining patches:

Re: Parallel Inserts in CREATE TABLE AS

2021-01-04 Thread vignesh C
On Mon, Jan 4, 2021 at 3:07 PM Bharath Rupireddy wrote: > > On Wed, Dec 30, 2020 at 5:28 PM vignesh C wrote: > > Few comments: > > - /* > > -* To allow parallel inserts, we need to ensure that they are safe > > to be > > -* performed in workers. We have the infrastructure t

Re: Added missing copy related data structures to typedefs.list

2021-01-04 Thread vignesh C
On Wed, Dec 30, 2020 at 7:10 PM Amit Kapila wrote: > > On Sat, Dec 26, 2020 at 9:16 PM vignesh C wrote: > > > > On Thu, Dec 17, 2020 at 4:28 AM Bruce Momjian wrote: > > > > > > On Mon, Dec 7, 2020 at 01:56:50PM +0530, vignesh C wrote: > > > > Hi, > > > > > > > > Added missing copy related data

Re: list of extended statistics on psql

2021-01-04 Thread Tatsuro Yamada
Hi, I rebased the patch set on the master (7e5e1bba03), and the regression test is good. Therefore, I changed the status of the patch: "needs review". Happy New Year! I rebased my patches on HEAD. Please find attached files. :-D Thanks, Tatsuro Yamada From 9f36a9df0c2803f5554b951e37ba5969c

Re: macOS SIP, next try

2021-01-04 Thread Mark Dilger
> On Dec 2, 2020, at 6:28 AM, Peter Eisentraut > wrote: > > Previous discussions on macOS SIP: > > https://www.postgresql.org/message-id/flat/561E73AB.8060800%40gmx.net > https://www.postgresql.org/message-id/flat/CA%2BTgmoYGi5oR8Rvb2-SY1_WEjd76H5gCqSukxFQ66qR7MewWAQ%40mail.gmail.com > https

Track replica origin progress for Rollback Prepared

2021-01-04 Thread Amit Kapila
While reviewing logical decoding of 2PC xacts work, I noticed that we need $SUBJECT [1]. Commit 1eb6d6527a [2] allowed to track replica origin replay progress for 2PC but it was not complete. It misses to properly track the progress for rollback prepared especially it missed to update the code for

Cirrus CI (Windows help wanted)

2021-01-04 Thread Thomas Munro
Hi, My new favourite CI is Cirrus CI, because it has 4 operating systems, generous enough quotas to handle 250+ branches in a single account, and public build/test log URLs. I flipped cfbot.cputube.org (mostly) over to that and it seems to work well so far -- fingers crossed. I've also been using

Re: macOS SIP, next try

2021-01-04 Thread Tom Lane
Peter Eisentraut writes: > The solution here is to use install_name_tool to edit the shared library > path in the binaries (programs and libraries) after installation into > the temporary prefix. Ah, this indeed seems like a promising direction. > The solution is, I think, correct in principle

Re: Moving other hex functions to /common

2021-01-04 Thread Bruce Momjian
On Sat, Jan 2, 2021 at 02:25:33PM +0900, Michael Paquier wrote: > > Let me get my patch building on the cfbot and then I will address each > > of these. I am trying to do one stage at a time since I am still > > learning the process. Thanks. > > No problem. On my end, this stuff has been itchi

Re: pg_waldump/heapdesc.c and struct field names

2021-01-04 Thread Peter Geoghegan
On Mon, Jan 4, 2021 at 2:06 PM Peter Geoghegan wrote: > Right. Self-consistency matters, as does consistency with the source > code itself. Pushed a commit that standardizes on the name latestRemovedXid within rmgr desc output routines just now. Thanks -- Peter Geoghegan

Re: Proposed patch for key management

2021-01-04 Thread Neil Chen
On Tue, Jan 5, 2021 at 10:18 AM Bruce Momjian wrote: > On Fri, Jan 1, 2021 at 06:26:36PM +, Alastair Turner wrote: > > There is all sorts of flexibility being proposed: > > * scope of keys > * encryption method > * encryption mode > * internal/external > > Some of this is related to wrap

Re: Fix typo in comment

2021-01-04 Thread Amit Kapila
On Tue, Jan 5, 2021 at 5:36 AM Peter Smith wrote: > > PSA a trivial patch to correct a comment typo. > LGTM. Pushed! -- With Regards, Amit Kapila.

Re: fix typo in ReorderBufferProcessTXN

2021-01-04 Thread Amit Kapila
On Tue, Jan 5, 2021 at 7:45 AM Amit Kapila wrote: > > On Tue, Jan 5, 2021 at 7:13 AM Masahiko Sawada wrote: > > > > On Tue, Jan 5, 2021 at 9:54 AM Hou, Zhijie > > wrote: > > > > > in contrast to normal the normal catalog during decoding == >> in > > > contrast to the normal catalog during deco

Re: Single transaction in the tablesync worker?

2021-01-04 Thread Ajin Cherian
On Wed, Dec 30, 2020 at 5:08 PM Peter Smith wrote: > > PSA my v9 WIP patch for the Solution1 which addresses some recent > review comments, and other minor changes. I did some tests using the test suite prepared by Erik Rijkers in [1] during the initial design of tablesync. Back then, they had

Re: Adding new commitfest entry?

2021-01-04 Thread Peter Smith
On Tue, Jan 5, 2021 at 12:46 PM Masahiko Sawada wrote: > > On Tue, Jan 5, 2021 at 9:45 AM Tom Lane wrote: > > > > Peter Smith writes: > > > On Tue, Jan 5, 2021 at 11:36 AM Tom Lane wrote: > > >> Hm, there should be a "New patch" button just below the "Commitfest > > >> 2021-03" title. > > > > >

Re: Context diffs

2021-01-04 Thread Noah Misch
On Tue, Jan 05, 2021 at 11:21:07AM +1300, Thomas Munro wrote: > On Tue, Jan 5, 2021 at 8:07 AM Bruce Momjian wrote: > > * "git apply" and "git am" can't process context diffs (they throw an > >error once a context-like section of the diff is hit; simple > >adding/removing lines in a block

Re: fix typo in ReorderBufferProcessTXN

2021-01-04 Thread Amit Kapila
On Tue, Jan 5, 2021 at 7:13 AM Masahiko Sawada wrote: > > On Tue, Jan 5, 2021 at 9:54 AM Hou, Zhijie wrote: > > > in contrast to normal the normal catalog during decoding == >> in contrast > > to the normal catalog during decoding > > Looks good change to me. > +1. I will push this in some time

RE: Disable WAL logging to speed up data loading

2021-01-04 Thread osumi.takami...@fujitsu.com
Hi, Sawada-San On Monday, December 28, 2020 7:12 PM Masahiko Sawada wrote: > On Mon, Dec 28, 2020 at 4:29 PM osumi.takami...@fujitsu.com > wrote: > > On Monday, December 28, 2020 2:29 PM Masahiko Sawada > wrote: > > > On Thu, Dec 3, 2020 at 12:14 PM osumi.takami...@fujitsu.com > > > wrote: >

Re: Adding new commitfest entry?

2021-01-04 Thread Masahiko Sawada
On Tue, Jan 5, 2021 at 9:45 AM Tom Lane wrote: > > Peter Smith writes: > > On Tue, Jan 5, 2021 at 11:36 AM Tom Lane wrote: > >> Hm, there should be a "New patch" button just below the "Commitfest > >> 2021-03" title. > > > Not for me. I see only 2 buttons - "Search/Filter" and "Shortcuts". > > Y

Re: fix typo in ReorderBufferProcessTXN

2021-01-04 Thread Masahiko Sawada
On Tue, Jan 5, 2021 at 9:54 AM Hou, Zhijie wrote: > > Hi > > > > I found a possible typo in the comment of ReorderBufferProcessTXN(). > > > > * relmapper has no "historic" view, in contrast to normal > > * the normal catalog during decoding. Thus repeated > > > > Is there an extra ‘normal’ in the

Re: New IndexAM API controlling index vacuum strategies

2021-01-04 Thread Masahiko Sawada
On Tue, Dec 29, 2020 at 3:25 PM Masahiko Sawada wrote: > > On Tue, Dec 29, 2020 at 7:06 AM Peter Geoghegan wrote: > > > > On Sun, Dec 27, 2020 at 11:41 PM Peter Geoghegan wrote: > > > I experimented with this today, and I think that it is a good way to > > > do it. I like the idea of choose_vacu

Re: [PATCH] Simple progress reporting for COPY command

2021-01-04 Thread Josef Šimánek
út 5. 1. 2021 v 0:46 odesílatel Tomas Vondra napsal: > > Hi, > > I did take a quick look today, and I have a couple minor comments: Hi! Thanks for your time. > 1) The catalog sgml docs seem to mention bytes_processed twice (one of > that should be bytes_total), and line_processed (should be "lin

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

2021-01-04 Thread Kyotaro Horiguchi
At Wed, 8 Jul 2020 12:56:44 +, Paul Guo wrote in > On 2020/01/15 19:18, Paul Guo wrote: > I further fixed the last test failure (due to a small bug in the test, not in > code). Attached are the new patch series. Let's see the CI pipeline result. > > Thanks for updating the patches! > > I s

Re: language cleanups in code and docs

2021-01-04 Thread Thomas Munro
On Tue, Jan 5, 2021 at 1:44 PM Dagfinn Ilmari Mannsåker wrote: > Thanks! Just after sending that, I thought to grep for "white\W*list" > as well, and found a few more occurrences that were trivially reworded, > per the attached patch. Pushed.

fix typo in ReorderBufferProcessTXN

2021-01-04 Thread Hou, Zhijie
Hi I found a possible typo in the comment of ReorderBufferProcessTXN(). * relmapper has no "historic" view, in contrast to normal * the normal catalog during decoding. Thus repeated Is there an extra ‘normal’ in the comment ? in contrast to normal the normal catalog during decoding == >> in co

Re: PoC/WIP: Extended statistics on expressions

2021-01-04 Thread Tomas Vondra
On 1/4/21 4:34 PM, Dean Rasheed wrote: ... Some other comments: * I'm not sure I understand the need for 0001. Wasn't there an earlier version of this patch that just did it by re-populating the type array, but which still had it as an array rather than turning it into a list? Making it a li

Re: Adding new commitfest entry?

2021-01-04 Thread Tom Lane
Peter Smith writes: > On Tue, Jan 5, 2021 at 11:36 AM Tom Lane wrote: >> Hm, there should be a "New patch" button just below the "Commitfest >> 2021-03" title. > Not for me. I see only 2 buttons - "Search/Filter" and "Shortcuts". You sure you're logged in according to the status in the upper ri

Re: language cleanups in code and docs

2021-01-04 Thread Dagfinn Ilmari Mannsåker
Thomas Munro writes: > On Tue, Jan 5, 2021 at 1:12 PM Dagfinn Ilmari Mannsåker > wrote: >> Magnus Hagander writes: >> > In looking at this I realize we also have exactly one thing referred to as >> > "blacklist" in our codebase, which is the "enum blacklist" (and then a >> > small internal vari

Re: Adding new commitfest entry?

2021-01-04 Thread Peter Smith
On Tue, Jan 5, 2021 at 11:36 AM Tom Lane wrote: > Hm, there should be a "New patch" button just below the "Commitfest > 2021-03" title. Not for me. I see only 2 buttons - "Search/Filter" and "Shortcuts". --- Kind Regards, Peter Smith. Fujitsu Australia.

Re: Adding new commitfest entry?

2021-01-04 Thread Tom Lane
Peter Smith writes: > I wanted to add a new commitfest entry but although I am logged in I > do not see any "Add" button either in the current or future CF. > https://commitfest.postgresql.org/31/ > https://commitfest.postgresql.org/32/ Hm, there should be a "New patch" button just below the "Com

Adding new commitfest entry?

2021-01-04 Thread Peter Smith
Hi. I wanted to add a new commitfest entry but although I am logged in I do not see any "Add" button either in the current or future CF. https://commitfest.postgresql.org/31/ https://commitfest.postgresql.org/32/ How to add? Kind Regards, Peter Smith. Fujitsu Australia.

Re: language cleanups in code and docs

2021-01-04 Thread Thomas Munro
On Tue, Jan 5, 2021 at 1:12 PM Dagfinn Ilmari Mannsåker wrote: > Magnus Hagander writes: > > In looking at this I realize we also have exactly one thing referred to as > > "blacklist" in our codebase, which is the "enum blacklist" (and then a > > small internal variable in pgindent). > > Here's a

Re: language cleanups in code and docs

2021-01-04 Thread Dagfinn Ilmari Mannsåker
Magnus Hagander writes: > In looking at this I realize we also have exactly one thing referred to as > "blacklist" in our codebase, which is the "enum blacklist" (and then a > small internal variable in pgindent). Here's a patch that renames the @whitelist and %blacklist variables in pgindent to

Fix typo in comment

2021-01-04 Thread Peter Smith
PSA a trivial patch to correct a comment typo. Kind Regards, Peter Smith Fujitsu Australia. fix_typo.patch Description: Binary data

Re: [PATCH] Simple progress reporting for COPY command

2021-01-04 Thread Tomas Vondra
Hi, I did take a quick look today, and I have a couple minor comments: 1) The catalog sgml docs seem to mention bytes_processed twice (one of that should be bytes_total), and line_processed (should be "lines_"). 2) I'm not quite sure about not including any info about the command. For examp

Re: language cleanups in code and docs

2021-01-04 Thread Thomas Munro
On Wed, Nov 4, 2020 at 4:10 AM Magnus Hagander wrote: > On Wed, Oct 21, 2020 at 11:23 PM Thomas Munro wrote: > > Hmm, can we find a more descriptive name for this mechanism? What > > about calling it the "uncommitted enum table"? See attached. > > Thanks for picking this one up again! > > Agree

Re: Handing off SLRU fsyncs to the checkpointer

2021-01-04 Thread Thomas Munro
On Mon, Jan 4, 2021 at 3:35 AM Tomas Vondra wrote: > Seems this commit left behind a couple unnecessary prototypes in a bunch > of header files. In particular, it removed these functions > > - ShutdownCLOG(); > - ShutdownCommitTs(); > - ShutdownSUBTRANS(); > - ShutdownMultiXact(); Thanks. Fixed.

Re: Context diffs

2021-01-04 Thread Thomas Munro
On Tue, Jan 5, 2021 at 8:07 AM Bruce Momjian wrote: > * "git apply" and "git am" can't process context diffs (they throw an >error once a context-like section of the diff is hit; simple >adding/removing lines in a block works) > > * the commit-fest doesn't recognized context diff attachm

Re: pg_waldump/heapdesc.c and struct field names

2021-01-04 Thread Peter Geoghegan
On Sun, Jan 3, 2021 at 8:58 PM Masahiko Sawada wrote: > On Mon, Jan 4, 2021 at 12:55 PM Peter Geoghegan wrote: > +1 for changing heapdesc.c on master. It's not only readable but also > consistent with other *desc showing the field named latestRemovedXid. > For instance, nbtdesc.c has: > >

Re: pg_waldump/heapdesc.c and struct field names

2021-01-04 Thread Peter Geoghegan
On Mon, Jan 4, 2021 at 1:12 PM Andres Freund wrote: > I personally mildly prefer remxid - anything that is understandable but > shortens the line length is good for my uses of waldump. I want to use latestRemovedXid here because it is quite recognizable to me as a symbol name. It appears as a sym

Re: pg_waldump/heapdesc.c and struct field names

2021-01-04 Thread Andres Freund
Hi, On 2021-01-03 19:54:38 -0800, Peter Geoghegan wrote: > I notice that heapdesc.c outputs the field latestRemovedXid as > "remxid". But why? What sense is there in changing the name for output > by tools like pg_waldump, which are intrinsically internals focussed? I personally mildly prefer rem

Re: Context diffs

2021-01-04 Thread Peter Geoghegan
On Mon, Jan 4, 2021 at 11:07 AM Bruce Momjian wrote: > * "git apply" and "git am" can't process context diffs (they throw an >error once a context-like section of the diff is hit; simple >adding/removing lines in a block works) I think that this is the big issue for me. I really find it

Re: Context diffs

2021-01-04 Thread Tom Lane
Bruce Momjian writes: > Our developer FAQ mentions context diffs in several places for their > improved readability: > https://wiki.postgresql.org/wiki/Developer_FAQ I think that's kind of out of date; AFAIK the majority of hackers think -u format is more readable. (For myself, I've gotten

Context diffs

2021-01-04 Thread Bruce Momjian
Our developer FAQ mentions context diffs in several places for their improved readability: https://wiki.postgresql.org/wiki/Developer_FAQ I also know git can product context diff as _output_. However, there are several negatives to context vs unified diffs in our workflow: * "git apply

Re: Proposed patch for key management

2021-01-04 Thread Bruce Momjian
On Fri, Jan 1, 2021 at 06:26:36PM +, Alastair Turner wrote: > After the long intro, my question - If using a standard format, > managed by a library, for the internal keystore does not result in a > smaller or simpler patch, is there enough other value for this to be > worth considering? For s

data_checksums enabled by default (was: Move --data-checksums to common options in initdb --help)

2021-01-04 Thread Michael Banck
Heya, (changing the subject as we're moving the goalposts) Am Samstag, den 02.01.2021, 10:47 -0500 schrieb Stephen Frost: > * Michael Paquier (mich...@paquier.xyz) wrote: > > On Fri, Jan 01, 2021 at 08:34:34PM +0100, Michael Banck wrote: > > > I think enough people use data checksums these days t

Re: Bug in numeric_power() if exponent is INT_MIN

2021-01-04 Thread Tom Lane
Dean Rasheed writes: > The issue is in this line from power_var_int(): > sig_digits += (int) log(Abs(exp)) + 8; > because "exp" is a signed int, so Abs(exp) leaves INT_MIN unchanged. > The most straightforward fix is to use fabs() instead, so that "exp" > is cast to double *before* the absolut

Re: [HACKERS] [PATCH] Generic type subscripting

2021-01-04 Thread Pavel Stehule
po 4. 1. 2021 v 14:58 odesílatel Dmitry Dolgov <9erthali...@gmail.com> napsal: > > On Sun, Jan 03, 2021 at 08:41:17PM +0100, Pavel Stehule wrote: > > > > probably some is wrong still > > > > create table foo(a jsonb); > > update foo set a['a'] = '10'; > > update foo set a['b']['c'][1] = '10'; > >

Re: Proposed patch for key management

2021-01-04 Thread Bruce Momjian
On Sat, Jan 2, 2021 at 12:47:19PM +, Alastair Turner wrote: > If keys can have arbitrary scope, then the pg backend won't know what > to ask for. So the API becomes even simpler with no specific request > on stdin and all the relevant keys on stdout. I generally like this > approach as well, a

Re: Proposed patch for key management

2021-01-04 Thread Bruce Momjian
On Sat, Jan 2, 2021 at 10:50:15AM +0100, Fabien COELHO wrote: > > No, this isn't anything like the Kerberos model and there's no case > > where the PG account won't have access to the DEK (data encryption key) > > during normal operation (except with the possibility of off-loading to a > > hardwar

Re: poc - possibility to write window function in PL languages

2021-01-04 Thread Zhihong Yu
Hi, Pavel: Thanks for the update. I don't have other comment. Cheers On Mon, Jan 4, 2021 at 3:15 AM Pavel Stehule wrote: > Hi > > pá 1. 1. 2021 v 18:57 odesílatel Zhihong Yu napsal: > >> Hi, Pavel: >> Happy New Year. >> >> + command with clause WINDOW. The specific feature of >> + this fu

Bug in numeric_power() if exponent is INT_MIN

2021-01-04 Thread Dean Rasheed
(Amusingly I only found this after discovering that Windows Calculator has a similar bug which causes it to crash if you try to raise a number to the power INT_MIN.) On my machine, numeric_power() loses all precision if the exponent is INT_MIN, though the actual failure mode might well be platform

[PATCH]: Allow errors in parameter values to be reported during the BIND phase itself..

2021-01-04 Thread Justin Pryzby
For example: $ python3.5 -c "import pg; db=pg.DB(); q = db.query(\"SET log_parameter_max_length_on_error=-1;\"); db.prepare('p', 'SELECT \$1::smallint'); db.query_prepared('p',6);" 2021-01-03 02:21:04.547 CST [20157] ERROR: value "6" is out of range for type smallint 2021-01-03 02:21:0

Re: set_config() documentation clarification

2021-01-04 Thread David G. Johnston
On Mon, Jan 4, 2021 at 8:26 AM Joel Jacobson wrote: > In the documentation at > https://www.postgresql.org/docs/current/functions-admin.html > this behaviour is not mentioned anywhere as far as I can see: > > https://www.postgresql.org/docs/current/runtime-config-custom.html I do think "Customiz

Re: Deleting older versions in unique indexes to avoid page splits

2021-01-04 Thread Victor Yegorov
чт, 31 дек. 2020 г. в 03:55, Peter Geoghegan : > Attached is v12, which fixed bitrot against the master branch. This > version has significant comment and documentation revisions. It is > functionally equivalent to v11, though. > > I intend to commit the patch in the next couple of weeks. While it

Re: Safety/validity of resetting permissions by updating system tables

2021-01-04 Thread Isaac Morland
On Mon, 4 Jan 2021 at 10:12, Andrew Dunstan wrote: > > On 1/1/21 11:44 AM, Tom Lane wrote: > > Isaac Morland writes: > >> Is it safe and valid to reset to default permissions by doing > >> UPDATE pg_namespace/pg_class/pg_type/pg_proc > >> SET nspacl/relacl/typacl/proacl = NULL WHERE ... to accom

Re: PoC/WIP: Extended statistics on expressions

2021-01-04 Thread Justin Pryzby
On Mon, Jan 04, 2021 at 03:34:08PM +, Dean Rasheed wrote: > * I'm not sure I understand the need for 0001. Wasn't there an earlier > version of this patch that just did it by re-populating the type > array, but which still had it as an array rather than turning it into > a list? Making it a lis

Re: set_config() documentation clarification

2021-01-04 Thread Chapman Flack
On 01/04/21 10:25, Joel Jacobson wrote: > I just learned from a pg friend, it's possible to set your own made up > setting_name using set_config(), > if the setting_name contains at least one dot ".". It works that way so you can set a config variable needed by an extension, if necessary before t

Re: PoC/WIP: Extended statistics on expressions

2021-01-04 Thread Dean Rasheed
On Fri, 11 Dec 2020 at 20:17, Tomas Vondra wrote: > > OK. Attached is an updated version, reworking it this way. Cool. I think this is an exciting development, so I hope it makes it into the next release. I have started looking at it. So far I have only looked at the catalog, parser and client c

set_config() documentation clarification

2021-01-04 Thread Joel Jacobson
I just learned from a pg friend, it's possible to set your own made up setting_name using set_config(), if the setting_name contains at least one dot ".". I didn't know about this and have always thought it's not possible, due to early in my career having run into the error message you get when n

Re: Safety/validity of resetting permissions by updating system tables

2021-01-04 Thread Andrew Dunstan
On 1/1/21 11:44 AM, Tom Lane wrote: > Isaac Morland writes: >> Is it safe and valid to reset to default permissions by doing >> UPDATE pg_namespace/pg_class/pg_type/pg_proc >> SET nspacl/relacl/typacl/proacl = NULL WHERE ... to accomplish this? > Not terribly; the main objection is you'd fail to

Re: VACUUM (DISABLE_PAGE_SKIPPING on)

2021-01-04 Thread Masahiko Sawada
On Tue, Dec 1, 2020 at 10:45 AM Masahiko Sawada wrote: > > On Fri, Nov 20, 2020 at 8:47 PM Simon Riggs wrote: > > > > On Fri, 20 Nov 2020 at 10:15, Simon Riggs wrote: > > > > > > On Fri, 20 Nov 2020 at 01:40, Masahiko Sawada > > > wrote: > > > > > > > > On Thu, Nov 19, 2020 at 8:02 PM Simon Ri

Re: libpq debug log

2021-01-04 Thread Masahiko Sawada
Iwata-san, On Mon, Dec 21, 2020 at 5:20 PM k.jami...@fujitsu.com wrote: > > On Tuesday, December 15, 2020 8:12 PM, Iwata-san wrote: > > > There are some things still to do: > > I worked on some to do. > > Hi Iwata-san, > > Thank you for updating the patch. > I would recommend to register this pat

Re: WIP: System Versioned Temporal Table

2021-01-04 Thread Masahiko Sawada
Hi Surafel, On Tue, Dec 22, 2020 at 3:01 AM Surafel Temesgen wrote: > > Hi Ryan, > > On Fri, Dec 18, 2020 at 10:28 PM Ryan Lambert wrote: >> >> On Thu, Nov 19, 2020 at 11:04 AM Surafel Temesgen >> wrote: >> >> The docs have two instances of "EndtTime" that should be "EndTime". > > > Since my f

Re: [HACKERS] [PATCH] Generic type subscripting

2021-01-04 Thread Dmitry Dolgov
> On Sun, Jan 03, 2021 at 08:41:17PM +0100, Pavel Stehule wrote: > > probably some is wrong still > > create table foo(a jsonb); > update foo set a['a'] = '10'; > update foo set a['b']['c'][1] = '10'; > update foo set a['b']['c'][10] = '10' Thanks for noticing. Indeed, there was a subtle change of

Re: Parallel Inserts in CREATE TABLE AS

2021-01-04 Thread Bharath Rupireddy
On Mon, Jan 4, 2021 at 5:44 PM Luc Vlaming wrote: > On 04-01-2021 12:16, Hou, Zhijie wrote: > >> > >> wrt v18-0002patch: > >> > >> It looks like this introduces a state machine that goes like: > >> - starts at CTAS_PARALLEL_INS_UNDEF > >> - possibly moves to CTAS_PARALLEL_INS_

Re: row filtering for logical replication

2021-01-04 Thread Önder Kalacı
Hi Masahiko, > > You sent in your patch to pgsql-hackers on Dec 17, but you did not > post it to the next CommitFest[1] (I found the old entry of this > patch[2] but it's marked as "Returned with feedback"). If this was > intentional, then you need to take no action. However, if you want > your

[Bug Fix] Logical replication on partition table is very slow and CPU is 99%

2021-01-04 Thread ????
Logical replication on partition table is very slow and CPU is 99%. To reproduce this problem, pg1 for publish pgbench -i -s 1000 create table pgbench_accounts_copy(aid integer, bid integer, abalance integer, filler character(84)) partition by range (aid); create table pgbench_accounts_

Re: Parallel Inserts in CREATE TABLE AS

2021-01-04 Thread Bharath Rupireddy
On Mon, Jan 4, 2021 at 4:22 PM Luc Vlaming wrote: > Sorry it took so long to get back to reviewing this. Thanks for the comments. > wrt v18-0001patch: > > + /* > +* If the worker is for parallel insert in CTAS, then use the proper > +* dest recei

Re: Test harness for regex code (to allow importing Tcl's test suite)

2021-01-04 Thread Joel Jacobson
On Mon, Jan 4, 2021, at 04:49, Tom Lane wrote: >Over the holiday break I've been fooling with some regex performance >improvements. Cool! I've also been fooling with regex performance over the years myself, not in the PostgreSQL code, but in general. More specifically, to first DFA-minimize the

Re: pg_rewind restore_command issue in PG12

2021-01-04 Thread Amine Tengilimoglu
When I read the pg_rewind PG12 doc. It says: "... but if the target cluster ran for a long time after the divergence, the old WAL files might no longer be present. In that case, they can be manually copied from the WAL archive to the pg_wal directory,* or fetched on startup by configuring **pr

Re: pg_rewind restore_command issue in PG12

2021-01-04 Thread Heikki Linnakangas
On 03/01/2021 20:13, Amine Tengilimoglu wrote:      In a situation where pg_rewind gets an error due to a missing wall, I  have set restore_command so that the needed wals can be read from the archive (I don't want to manually copy the wal files), but I see it doesn't work. What am I missing? 

Re: Parallel Inserts in CREATE TABLE AS

2021-01-04 Thread Luc Vlaming
On 04-01-2021 12:16, Hou, Zhijie wrote: Hi wrt v18-0002patch: It looks like this introduces a state machine that goes like: - starts at CTAS_PARALLEL_INS_UNDEF - possibly moves to CTAS_PARALLEL_INS_SELECT - CTAS_PARALLEL_INS_TUP_COST_CAN_IGN can be added - if both were add

Re: Deleting older versions in unique indexes to avoid page splits

2021-01-04 Thread Heikki Linnakangas
On 02/12/2020 00:18, Peter Geoghegan wrote: On Tue, Dec 1, 2020 at 1:50 AM Heikki Linnakangas wrote: On 30/11/2020 21:50, Peter Geoghegan wrote: +} TM_IndexDelete; +} TM_IndexStatus; Is it really significantly faster to have two arrays? If you had just one array, each element would be on

Re: [PATCH] Feature improvement for CLOSE, FETCH, MOVE tab completion

2021-01-04 Thread Masahiko Sawada
On Wed, Dec 9, 2020 at 12:59 PM wrote: > > Hi! > > > > I created a patch for improving CLOSE, FETCH, MOVE tab completion. > > Specifically, I add CLOSE, FETCH, MOVE tab completion for completing a > predefined cursors. > Thank you for the patch! When I applied the patch, I got the following whi

Re: Single transaction in the tablesync worker?

2021-01-04 Thread Amit Kapila
On Mon, Jan 4, 2021 at 2:38 PM Amit Kapila wrote: > > Few other comments: > = > Few more comments on v9: == 1. + /* Drop the tablesync slot. */ + { + char *syncslotname = ReplicationSlotNameForTablesync(subid, relid); + + /* + * If the subscription slotname is

RE: Parallel Inserts in CREATE TABLE AS

2021-01-04 Thread Hou, Zhijie
Hi > > wrt v18-0002patch: > > It looks like this introduces a state machine that goes like: > - starts at CTAS_PARALLEL_INS_UNDEF > - possibly moves to CTAS_PARALLEL_INS_SELECT > - CTAS_PARALLEL_INS_TUP_COST_CAN_IGN can be added > - if both were added at some stage, we can go

Re: poc - possibility to write window function in PL languages

2021-01-04 Thread Pavel Stehule
minsize = PG_GETARG_INT32(2); > > VARLENA_MINSIZE is 32. > > Cheers > > On Fri, Jan 1, 2021 at 3:29 AM Pavel Stehule > wrote: > >> Hi >> >> rebase >> >> Regards >> >> Pavel >> > I am sending updated patch Thank you for comments Regards Pavel plpgsql-window-functions-20210104.patch.gz Description: application/gzip

Re: {CREATE INDEX, REINDEX} CONCURRENTLY improvements

2021-01-04 Thread Masahiko Sawada
On Tue, Dec 8, 2020 at 5:18 PM Hamid Akhtar wrote: > > The following review has been posted through the commitfest application: > make installcheck-world: tested, passed > Implements feature: not tested > Spec compliant: not tested > Documentation:not tested > > The pa

Re: Parallel Inserts in CREATE TABLE AS

2021-01-04 Thread Luc Vlaming
On 30-12-2020 04:55, Bharath Rupireddy wrote: On Wed, Dec 30, 2020 at 5:22 AM Zhihong Yu wrote: w.r.t. v17-0004-Enable-CTAS-Parallel-Inserts-For-Append.patch + * Push the dest receiver to Gather node when it is either at the top of the + * plan or under top Append node unless it does not have

Re: zstd compression for pg_dump

2021-01-04 Thread Daniil Zakhlystov
Hi! > On Jan 4, 2021, at 11:04 AM, Andrey Borodin wrote: > > Daniil, is levels definition compatible with libpq compression patch? > +typedef struct Compress { > + CompressionAlgorithmalg; > + int level; > + /* Is a nondefault level set ? This is useful since

Re: A failure of standby to follow timeline switch

2021-01-04 Thread Fujii Masao
On 2021/01/04 12:06, Kyotaro Horiguchi wrote: At Sat, 26 Dec 2020 02:15:06 +0900, Fujii Masao wrote in On 2020/12/25 12:03, Kyotaro Horiguchi wrote: Thank you for looking this. At Thu, 24 Dec 2020 15:33:04 +0900, Fujii Masao wrote in When I applied two patches in the master branch and

Re: Parallel Inserts in CREATE TABLE AS

2021-01-04 Thread Bharath Rupireddy
On Wed, Dec 30, 2020 at 5:28 PM vignesh C wrote: > Few comments: > - /* > -* To allow parallel inserts, we need to ensure that they are safe to > be > -* performed in workers. We have the infrastructure to allow parallel > -* inserts in general except for the cases w

Re: Parallel Inserts in CREATE TABLE AS

2021-01-04 Thread Bharath Rupireddy
On Wed, Dec 30, 2020 at 5:26 PM vignesh C wrote: > > On Wed, Dec 30, 2020 at 10:47 AM Bharath Rupireddy > wrote: > > > > On Wed, Dec 30, 2020 at 10:32 AM Dilip Kumar wrote: > > > I have completed reviewing 0001, I don't have more comments, just one > > > question. Soon I will review the remaini

Re: Single transaction in the tablesync worker?

2021-01-04 Thread Peter Smith
On Mon, Jan 4, 2021 at 8:06 PM Amit Kapila wrote: > Few other comments: > = > 1. > + elog(LOG, "!!>> DropSubscription: dropping the tablesync slot > \"%s\".", syncslotname); > + ReplicationSlotDropAtPubNode(wrconn, syncslotname); > + elog(LOG, "!!>> DropSubscription: dropped the ta

Re: Single transaction in the tablesync worker?

2021-01-04 Thread Peter Smith
Hi Amit. PSA my v10 patch for the Solution1. v10 is essentially the same as v9, except now all the temporary "!!>>" logging has been isolated to a separate (optional) patch 0002. Features: * tablesync slot is now permanent instead of temporary. The tablesync slot name is no longer tied to

Re: Single transaction in the tablesync worker?

2021-01-04 Thread Amit Kapila
On Wed, Dec 30, 2020 at 11:51 AM Peter Smith wrote: > > On Wed, Dec 23, 2020 at 8:43 PM Amit Kapila wrote: > > > > 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 slot could fail

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

2021-01-04 Thread Amit Kapila
On Thu, Dec 31, 2020 at 12:31 PM Ajin Cherian wrote: > > On Thu, Dec 31, 2020 at 4:16 PM Amit Kapila wrote: > > > 3. Merged the doc changes patch after some changes mostly cosmetic. > Some minor comments here: > > v35-0001 - logicaldecoding.sgml > > In the example section: > Change "The following

  1   2   >