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

2021-01-05 Thread Michael Banck
Hi, Am Mittwoch, den 06.01.2021, 10:52 +0900 schrieb Michael Paquier: > On Mon, Jan 04, 2021 at 07:11:43PM +0100, Michael Banck wrote: > > So maybe we should switch on wal_compression if we enable data checksums > > by default. > > I don't agree with this assumption. In some CPU-bounded workload

Re: New Table Access Methods for Multi and Single Inserts

2021-01-05 Thread Luc Vlaming
On 05-01-2021 11:06, Bharath Rupireddy wrote: On Mon, Jan 4, 2021 at 1:29 PM Luc Vlaming > wrote: >  > table AM patch [2] be reviewed further? > As to the patches themselves: > > I think the API is a huge step forward! I assume that we want to have a > single-insert

Re: New Table Access Methods for Multi and Single Inserts

2021-01-05 Thread Luc Vlaming
On 05-01-2021 22:28, Jeff Davis wrote: On Mon, 2021-01-04 at 08:59 +0100, Luc Vlaming wrote: Reason I'm asking is that I quite liked the heap_insert_begin parameter is_multi, which could even be turned into a "expected_rowcount" of the amount of rows expected to be commited in the transaction (e

RE: Parallel Inserts in CREATE TABLE AS

2021-01-05 Thread Hou, Zhijie
> > > > + /* Okay to parallelize inserts, so mark it. */ > > + if (ins_cmd == PARALLEL_INSERT_CMD_CREATE_TABLE_AS) > > + ((DR_intorel *) dest)->is_parallel = true; > > > > + if (ins_cmd == PARALLEL_INSERT_CMD_CREATE_TABLE_AS) > > +

Re: archive status ".ready" files may be created too early

2021-01-05 Thread Andrey Borodin
Hi! Thanks for working on this. > 18 дек. 2020 г., в 10:42, Kyotaro Horiguchi > написал(а): > > I noticed that we can cause the continuation record flushed > immedately. I've took a look into the code and want to share some thoughts. 1. Maybe we could tend to avoid interlacing field protect

Re: Parallel Inserts in CREATE TABLE AS

2021-01-05 Thread Luc Vlaming
On 05-01-2021 13:57, Bharath Rupireddy wrote: On Tue, Jan 5, 2021 at 1:00 PM Luc Vlaming wrote: Reviewing further v20-0001: I would still opt for moving the code for the parallel worker into a separate function, and then setting rStartup of the dest receiver to that function in ExecParallelGet

When (and whether) should we improve the chapter on parallel query to accommodate parallel data updates?

2021-01-05 Thread tsunakawa.ta...@fujitsu.com
Hello, While I'm reviewing patches for parallel operations, it occured to me that we may need to correct the words and enrich content in "15. Parallel Query". I don't have a concrete image of how the content should be yet, and I think the documentation may be improved after the feature freeze

Re: Parallel Inserts in CREATE TABLE AS

2021-01-05 Thread Bharath Rupireddy
On Wed, Jan 6, 2021 at 11:30 AM Hou, Zhijie wrote: > > > > I think it makes sense. > > > > > > And if the check about ' ins_cmd == xxx1 || ins_cmd == xxx2' may be > > > used in some places, How about define a generic function with some comment > > to mention the purpose. > > > > > > An example in

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

2021-01-05 Thread Shinya11.Kato
>+#define Query_for_list_of_cursors \ >+" SELECT name FROM pg_cursors"\ > >This query should be the following? > >" SELECT pg_catalog.quote_ident(name) "\ >" FROM pg_catalog.pg_cursors "\ >" WHERE substring(pg_catalog.quote_ident(name),1,%d)='%s'" > >+/* CLOSE */ >+ else if (Matches("CLOSE"

RE: libpq debug log

2021-01-05 Thread matsumura....@fujitsu.com
Hi Iwata-san I reviewed v10-0001-libpq-trace.patch. (But I don't check recent discussion...) I found some bugs. I'm suggesting some refactoring. @@ -6809,7 +6809,17 @@ PQtrace(PGconn *conn, FILE *debug_port) + if (pqTraceInit(conn)) + { + conn->Pfdebug = debug_port;

Re: Spurious "apparent wraparound" via SimpleLruTruncate() rounding

2021-01-05 Thread Andrey Borodin
> 1 янв. 2021 г., в 23:05, Andrey Borodin написал(а): > > I've found this thread in CF looking for something to review. We discussed patches with Noah offlist. I'm resending summary to list. There are two patches: 1. slru-truncate-modulo-v5.patch 2. slru-truncate-t-insurance-v4.patch It wou

Re: Parallel Inserts in CREATE TABLE AS

2021-01-05 Thread Dilip Kumar
On Wed, Jan 6, 2021 at 11:26 AM Bharath Rupireddy wrote: > > On Wed, Jan 6, 2021 at 10:17 AM Dilip Kumar wrote: > > > > On Wed, Jan 6, 2021 at 9:23 AM Bharath Rupireddy > > wrote: > > > > > > > +/* > > + * List the commands here for which parallel insertions are possible. > > + */ > > +typedef e

RE: Parallel Inserts in CREATE TABLE AS

2021-01-05 Thread Hou, Zhijie
> > I think it makes sense. > > > > And if the check about ' ins_cmd == xxx1 || ins_cmd == xxx2' may be > > used in some places, How about define a generic function with some comment > to mention the purpose. > > > > An example in INSERT INTO SELECT patch: > > +/* > > + * IsModifySupportedInParalle

Re: Parallel Inserts in CREATE TABLE AS

2021-01-05 Thread Bharath Rupireddy
On Wed, Jan 6, 2021 at 10:17 AM Dilip Kumar wrote: > > On Wed, Jan 6, 2021 at 9:23 AM Bharath Rupireddy > wrote: > > > > +/* > + * List the commands here for which parallel insertions are possible. > + */ > +typedef enum ParallelInsertCmdKind > +{ > + PARALLEL_INSERT_CMD_UNDEF = 0, > + PARALLEL_I

Re: Parallel Inserts in CREATE TABLE AS

2021-01-05 Thread Bharath Rupireddy
On Wed, Jan 6, 2021 at 11:06 AM Hou, Zhijie wrote: > > > > For v20-0001-Parallel-Inserts-in-CREATE-TABLE-AS.patch : > > > > > > ParallelInsCmdEstimate : > > > > > > + Assert(pcxt && ins_info && > > > + (ins_cmd == PARALLEL_INSERT_CMD_CREATE_TABLE_AS)); > > > + > > > + if (ins_cmd == P

Re: Parallel Inserts in CREATE TABLE AS

2021-01-05 Thread Bharath Rupireddy
On Wed, Jan 6, 2021 at 10:05 AM Zhihong Yu wrote: > > The plan sounds good. > > Before the second command type is added, can you leave out the 'if (ins_cmd > == PARALLEL_INSERT_CMD_CREATE_TABLE_AS)' and keep the pair of curlies ? > > You can add the if condition back when the second command type

Re: Cirrus CI (Windows help wanted)

2021-01-05 Thread Andrew Dunstan
On 1/5/21 11:19 PM, Thomas Munro wrote: > > Thanks! I hacked on this a bit more and got as far as: > > C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build>call > perl buildsetup.pl > Unable to determine Visual Studio version: The nmake version could not > be determined. at src/too

RE: Parallel Inserts in CREATE TABLE AS

2021-01-05 Thread Hou, Zhijie
> > For v20-0001-Parallel-Inserts-in-CREATE-TABLE-AS.patch : > > > > ParallelInsCmdEstimate : > > > > + Assert(pcxt && ins_info && > > + (ins_cmd == PARALLEL_INSERT_CMD_CREATE_TABLE_AS)); > > + > > + if (ins_cmd == PARALLEL_INSERT_CMD_CREATE_TABLE_AS) > > > > Sinc the if condition is c

Re: Single transaction in the tablesync worker?

2021-01-05 Thread Amit Kapila
On Tue, Jan 5, 2021 at 3:32 PM Peter Smith wrote: > > On Mon, Jan 4, 2021 at 10:48 PM Amit Kapila wrote: > > > > > 5. Is it possible to write a testcase where we fail (say due to pk > > violation or some other error) after the initial copy is done, then > > remove the conflicting row and allow a

Re: Parallel Inserts in CREATE TABLE AS

2021-01-05 Thread Dilip Kumar
On Wed, Jan 6, 2021 at 9:23 AM Bharath Rupireddy wrote: > +/* + * List the commands here for which parallel insertions are possible. + */ +typedef enum ParallelInsertCmdKind +{ + PARALLEL_INSERT_CMD_UNDEF = 0, + PARALLEL_INSERT_CMD_CREATE_TABLE_AS +} ParallelInsertCmdKind; I see there is some co

Re: Parallel Inserts in CREATE TABLE AS

2021-01-05 Thread Zhihong Yu
The plan sounds good. Before the second command type is added, can you leave out the 'if (ins_cmd == PARALLEL_INSERT_CMD_CREATE_TABLE_AS)' and keep the pair of curlies ? You can add the if condition back when the second command type is added. Cheers On Tue, Jan 5, 2021 at 7:53 PM Bharath Rupire

Re: Cirrus CI (Windows help wanted)

2021-01-05 Thread Thomas Munro
On Wed, Jan 6, 2021 at 11:48 AM Andrew Dunstan wrote: > OK, I have dug into this quite a bit. The way cirrus works is in fact > somewhat fragile. Anyway, here are the highlights: Thanks! > However, sadly the vctools package above isn't installed with all its > optional packages, so some crucial

Re: Moving other hex functions to /common

2021-01-05 Thread Michael Paquier
On Tue, Jan 05, 2021 at 12:21:09PM -0500, Bruce Momjian wrote: > Well, if the backend uses /common for hex like I suggested, and like we > do now, it has to match the function signatures of bytea and esc, see > struct pg_encoding. I don't see the point in changing those. Not necessarily with some

Re: Deadlock between backend and recovery may not be detected

2021-01-05 Thread Fujii Masao
On 2021/01/06 11:48, Masahiko Sawada wrote: On Tue, Jan 5, 2021 at 3:26 PM Fujii Masao wrote: 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

Re: Parallel Inserts in CREATE TABLE AS

2021-01-05 Thread Bharath Rupireddy
On Wed, Jan 6, 2021 at 8:19 AM Zhihong Yu wrote: > For v20-0001-Parallel-Inserts-in-CREATE-TABLE-AS.patch : > > ParallelInsCmdEstimate : > > + Assert(pcxt && ins_info && > + (ins_cmd == PARALLEL_INSERT_CMD_CREATE_TABLE_AS)); > + > + if (ins_cmd == PARALLEL_INSERT_CMD_CREATE_TABLE_AS)

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

2021-01-05 Thread Andres Freund
Hi, On 2021-01-04 19:11:43 +0100, Michael Banck wrote: > 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 day

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

2021-01-05 Thread Amit Kapila
On Tue, Dec 22, 2020 at 3:31 PM Amit Kapila wrote: > > On Tue, Dec 22, 2020 at 2:51 PM Ajin Cherian wrote: > > > > > Other than this I've noticed a few typos that are not in the patch but > > in the surrounding code. > > logical.c: 1383: Comment should mention stream_commit_cb not > > stream_abo

RE: Wrong statistics for size of XLOG_SWITCH during pg_waldump.

2021-01-05 Thread movead...@highgo.ca
Thanks for review, and sorry for reply so later. >I reviewed the patch and found some problems. >>+ if(startSegNo != endSegNo) >>+ else if(record->ReadRecPtr / XLOG_BLCKSZ != >>+ if(rmid == RM_XLOG_ID && info == XLOG_SWITCH) >>+ if(ri == RM_XLOG_ID) >>+ if(info == XLOG_SWITCH) >You need to put a

Re: Single transaction in the tablesync worker?

2021-01-05 Thread Amit Kapila
On Wed, Jan 6, 2021 at 4:32 AM Peter Smith wrote: > > On Tue, Jan 5, 2021 at 10:41 PM Amit Kapila wrote: > > > > 1. > > > > + /* Drop the tablesync slot. */ > > > > + { > > > > + char *syncslotname = ReplicationSlotNameForTablesync(subid, relid); > > > > + > > > > + /* > > > > + * If the subscrip

Re: recovery_target_timeline & documentation

2021-01-05 Thread Fujii Masao
On 2021/01/06 3:01, Fujii Masao wrote: On 2021/01/05 20:18, Benoit Lobréau wrote: Hi, It seems like this part of the documentation was not updated after changing the default value of recovery_target_timeline to latest in  v12. "The default behavior of recovery is to recover along the sam

Re: Parallel Inserts in CREATE TABLE AS

2021-01-05 Thread Zhihong Yu
For v20-0001-Parallel-Inserts-in-CREATE-TABLE-AS.patch : ParallelInsCmdEstimate : + Assert(pcxt && ins_info && + (ins_cmd == PARALLEL_INSERT_CMD_CREATE_TABLE_AS)); + + if (ins_cmd == PARALLEL_INSERT_CMD_CREATE_TABLE_AS) Sinc the if condition is covered by the assertion, I wonder why

Re: Deadlock between backend and recovery may not be detected

2021-01-05 Thread Masahiko Sawada
On Tue, Jan 5, 2021 at 3:26 PM Fujii Masao wrote: > > > > 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 followin

Re: logical replication worker accesses catalogs in error context callback

2021-01-05 Thread Masahiko Sawada
On Wed, Jan 6, 2021 at 11:02 AM Andres Freund wrote: > > Hi, > > Due to a debug ereport I just noticed that worker.c's > slot_store_error_callback is doing something quite dangerous: > > static void > slot_store_error_callback(void *arg) > { > SlotErrCallbackArg *errarg = (SlotErrCallbackA

Re: set_config() documentation clarification

2021-01-05 Thread Joel Jacobson
On Tue, Jan 5, 2021, at 20:28, Bruce Momjian wrote: > Oh, I know it is useful. My pg_cryptokey uses it: > https://momjian.us/download/pgcryptokey/ Looks like a nice extension I could use sometimes myself, thanks for sharing. /Joel

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

2021-01-05 Thread Fujii Masao
On 2021/01/06 11:13, Masahiko Sawada wrote: On Tue, Jan 5, 2021 at 6:08 PM Fujii Masao wrote: + COMPLETE_WITH_QUERY(Query_for_list_of_cursors + " UNION SELECT 'ABSOLUTE'" +

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

2021-01-05 Thread Masahiko Sawada
On Tue, Jan 5, 2021 at 6:08 PM Fujii Masao wrote: > > > + COMPLETE_WITH_QUERY(Query_for_list_of_cursors > + " UNION SELECT > 'ABSOLUTE'" > + " UNION SELECT > 'BACKWARD'" > +

logical replication worker accesses catalogs in error context callback

2021-01-05 Thread Andres Freund
Hi, Due to a debug ereport I just noticed that worker.c's slot_store_error_callback is doing something quite dangerous: static void slot_store_error_callback(void *arg) { SlotErrCallbackArg *errarg = (SlotErrCallbackArg *) arg; LogicalRepRelMapEntry *rel; char *remot

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

2021-01-05 Thread Michael Paquier
On Mon, Jan 04, 2021 at 07:11:43PM +0100, Michael Banck wrote: > 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 d

Re: A failure of standby to follow timeline switch

2021-01-05 Thread Kyotaro Horiguchi
At Tue, 05 Jan 2021 17:26:02 +0900 (JST), Kyotaro Horiguchi wrote in > Thanks. The attached is the revised patchset. It is not applicable to PG13 due to wording changes. This is an applicable all-in-one version to PG13. regards. -- Kyotaro Horiguchi NTT Open Source Software Center >From d4b

Re: doc review for v14

2021-01-05 Thread Michael Paquier
On Sun, Jan 03, 2021 at 09:05:09PM +0900, Michael Paquier wrote: > So let's use this version and call it a day for this part. This has been done as of b49154b. -- Michael signature.asc Description: PGP signature

Re: [PATCH] Simple progress reporting for COPY command

2021-01-05 Thread Matthias van de Meent
On Fri, 1 Jan 2021 at 02:25, Josef Šimánek wrote: > > Hello, > > finally I had some time to revisit patch and all comments from > https://www.postgresql.org/message-id/CAFp7QwqMGEi4OyyaLEK9DR0%2BE%2BoK3UtA4bEjDVCa4bNkwUY2PQ%40mail.gmail.com > and I have prepared simple version of COPY command prog

Re: Context diffs

2021-01-05 Thread Bruce Momjian
On Wed, Jan 6, 2021 at 10:21:22AM +1300, Thomas Munro wrote: > On Wed, Jan 6, 2021 at 6:58 AM Bruce Momjian wrote: > > On Tue, Jan 5, 2021 at 11:21:07AM +1300, Thomas Munro wrote: > > > For the record, cfbot just uses plain old GNU patch, because that > > > seems to accept nearly everything that

Re: Deadlock between backend and recovery may not be detected

2021-01-05 Thread Kyotaro Horiguchi
At Tue, 5 Jan 2021 15:26:50 +0900, Fujii Masao wrote in > > > 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 follo

Re: allow to \dtS+ pg_toast.*

2021-01-05 Thread Justin Pryzby
On Tue, Jan 05, 2021 at 06:46:01PM -0500, Tom Lane wrote: > Laurenz Albe writes: > > On Fri, 2020-12-18 at 11:33 -0600, Justin Pryzby wrote: > This makes toast tables a bit less special and easier to inspect. > > Pushed, except for Thank you -- Justin

Re: allow to \dtS+ pg_toast.*

2021-01-05 Thread Tom Lane
Laurenz Albe writes: > On Fri, 2020-12-18 at 11:33 -0600, Justin Pryzby wrote: This makes toast tables a bit less special and easier to inspect. Pushed, except for >>> Another thing that is missing is tab completion for >>> regression=# \dtS pg_toast.pg_ >>> This should work just like for \

Re: [PATCH] Runtime control of CLOBBER_CACHE_ALWAYS

2021-01-05 Thread Craig Ringer
On Tue, 5 Jan 2021, 22:41 Peter Eisentraut, < peter.eisentr...@2ndquadrant.com> wrote: > On 2020-12-03 07:01, Craig Ringer wrote: > > To try it out, apply the patch (git am), build with --enable-cassert, > > then compare: > > > > make -C src/test/regress check > > > > and > > > > PGOPTIONS

Re: Replication protocol pipelining edge case

2021-01-05 Thread Jeff Davis
On Tue, 2021-01-05 at 09:17 -0800, Jeff Davis wrote: > The reason I ask is because it makes clients that do pipelining more > complex. If the server always enters copy mode, then the client can > send a CopyDone and then pipeline more requests behind it. But if the > server may or may not enter cop

Re: Single transaction in the tablesync worker?

2021-01-05 Thread Peter Smith
On Tue, Jan 5, 2021 at 10:41 PM Amit Kapila wrote: > > > 1. > > > + /* Drop the tablesync slot. */ > > > + { > > > + char *syncslotname = ReplicationSlotNameForTablesync(subid, relid); > > > + > > > + /* > > > + * If the subscription slotname is NONE/NULL and the connection to > > > publisher is

Re: Cirrus CI (Windows help wanted)

2021-01-05 Thread Andrew Dunstan
On 1/5/21 7:18 AM, Andrew Dunstan wrote: > On 1/4/21 10:58 PM, Thomas Munro wrote: >> 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.

Re: Context diffs

2021-01-05 Thread Andrew Dunstan
On 1/5/21 12:58 PM, Bruce Momjian wrote: > On Tue, Jan 5, 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;

Re: set_config() documentation clarification

2021-01-05 Thread Chapman Flack
On 01/05/21 16:14, Joel Jacobson wrote: > or maybe even WITH like this: > > WITH > year % 19 AS g , > year / 100 AS c, > (c - c/4 - (8*c + 13)/25 + 19*g + 15) % 30 AS h, > h - (h/28)*(1 - (h/28)*(29/(h + 1))*((21 - g)/11)) AS i, > year + year/4 + i + 2 - c + c/4) % 7 AS j, > i - j AS p

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

2021-01-05 Thread Peter Geoghegan
On Mon, Jan 4, 2021 at 4:08 AM Heikki Linnakangas wrote: > You said above that heap_tid_shellsort() is very performance critical, > and that's why you use the two arrays approach. If it's so performance > critical that swapping 8 bytes vs 12 byte array elements makes a > difference, I would guess

Re: set_config() documentation clarification

2021-01-05 Thread Tom Lane
Bruce Momjian writes: > On Tue, Jan 5, 2021 at 08:23:15PM +0100, Joel Jacobson wrote: >> út 5. 1. 2021 v 18:51 odesílatel Bruce Momjian napsal: >>> I think I tried to make this feature more visible a few years ago and >>> some people said we might remove it someday, so don't do that. If that >>

Re: plpgsql variable assignment with union is broken

2021-01-05 Thread Tom Lane
easter...@verfriemelt.org writes: > i found, that the behaviour of variable assignment in combination with union > is not working anymore: > DO $$ > DECLARE t bool; > begin > t := a FROM ( SELECT true WHERE false ) t(a) UNION SELECT true AS a; > END $$; > is this an intended cha

Re: Libpq support to connect to standby server as priority

2021-01-05 Thread Tom Lane
Greg Nancarrow writes: > Posting an updated set of patches. I've reviewed and pushed most of v20-0001, with the following changes: * I realized that we had more moving parts than necessary for in_hot_standby. We don't really need two static variables, one is sufficient --- and we shouldn't make

Re: New Table Access Methods for Multi and Single Inserts

2021-01-05 Thread Jeff Davis
On Mon, 2021-01-04 at 08:59 +0100, Luc Vlaming wrote: > Reason I'm asking is that I quite liked the heap_insert_begin > parameter > is_multi, which could even be turned into a "expected_rowcount" of > the > amount of rows expected to be commited in the transaction (e.g. > single, > several, thou

Re: Proposed patch for key management

2021-01-05 Thread Alastair Turner
On Mon, 4 Jan 2021 at 17:56, Bruce Momjian wrote: > > On Sat, Jan 2, 2021 at 12:47:19PM +, Alastair Turner wrote: > > > > There is also a further validation task - probably beyond the scope of > > the key management patch and into the encryption patch[es] territory - > > checking that the key

Re: Context diffs

2021-01-05 Thread Thomas Munro
On Wed, Jan 6, 2021 at 6:58 AM Bruce Momjian wrote: > On Tue, Jan 5, 2021 at 11:21:07AM +1300, Thomas Munro wrote: > > For the record, cfbot just uses plain old GNU patch, because that > > seems to accept nearly everything that anyone posts here (after a step > > that tries to unpack tarballs etc

plpgsql variable assignment with union is broken

2021-01-05 Thread easteregg
hi, i updated our ci pipeline to the latest 14-devel build from the postgresql apt repository: PostgreSQL 14devel (Debian 14~~devel~20210105.1140-1~285.gitbc43b7c.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-3) 10.2.1 20201224, 64-bit i found, that the behaviour of var

Re: Proposed patch for key management

2021-01-05 Thread Alastair Turner
Hi Bruce On Mon, 4 Jan 2021 at 18:23, Bruce Momjian wrote: > > 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

Re: set_config() documentation clarification

2021-01-05 Thread Joel Jacobson
On Tue, Jan 5, 2021, at 21:34, Pavel Stehule wrote: > yes, it is supported. More the schema variables supports RESET to default on > transaction end, > and supports access rights for usage in security definer functions. Nice. > Maybe - I don't know what "Statement variables" :). Other databases

Re: set_config() documentation clarification

2021-01-05 Thread Pavel Stehule
út 5. 1. 2021 v 21:34 odesílatel Pavel Stehule napsal: > > > út 5. 1. 2021 v 20:23 odesílatel Joel Jacobson napsal: > >> út 5. 1. 2021 v 18:51 odesílatel Bruce Momjian napsal: >> > I think I tried to make this feature more visible a few years ago and >> > some people said we might remove it som

Re: Online checksums patch - once again

2021-01-05 Thread Justin Pryzby
On Tue, Jan 05, 2021 at 09:29:31PM +0100, Michael Banck wrote: > > @@ -4938,13 +4949,299 @@ GetMockAuthenticationNonce(void) > > /* > > - * Are checksums enabled for data pages? > > + * DataChecksumsNeedWrite > > + * Returns whether data checksums must be written or not > > + * > > + * Are

Re: set_config() documentation clarification

2021-01-05 Thread Pavel Stehule
út 5. 1. 2021 v 20:23 odesílatel Joel Jacobson napsal: > út 5. 1. 2021 v 18:51 odesílatel Bruce Momjian napsal: > > I think I tried to make this feature more visible a few years ago and > > some people said we might remove it someday, so don't do that. If that > > is false, I think we can make

Re: Online checksums patch - once again

2021-01-05 Thread Michael Banck
Hi, On Tue, Jan 05, 2021 at 12:18:07AM +0100, Daniel Gustafsson wrote: > Attached is a rebase of the patch on top of current HEAD. > > cheers ./daniel Some more comments/questions: > diff --git a/src/backend/access/heap/heapam.c > b/src/backend/access/heap/heapam.c > index 53e997cd55..06c001f8

Re: [HACKERS] [PATCH] Generic type subscripting

2021-01-05 Thread Dmitry Dolgov
> On Mon, Jan 04, 2021 at 06:56:17PM +0100, Pavel Stehule wrote: > po 4. 1. 2021 v 14:58 odesílatel Dmitry Dolgov <9erthali...@gmail.com> > napsal: > postgres=# update foo set a['c']['c'][10] = '10'; > postgres=# update foo set a['c'][10][10] = '10'; Yeah, there was one clumsy memory allocation. O

Re: set_config() documentation clarification

2021-01-05 Thread Bruce Momjian
On Tue, Jan 5, 2021 at 08:23:15PM +0100, Joel Jacobson wrote: > út 5. 1. 2021 v 18:51 odesílatel Bruce Momjian napsal: > > I think I tried to make this feature more visible a few years ago and > > some people said we might remove it someday, so don't do that. If that > > is false, I think we can

Re: set_config() documentation clarification

2021-01-05 Thread Joel Jacobson
út 5. 1. 2021 v 18:51 odesílatel Bruce Momjian napsal: > I think I tried to make this feature more visible a few years ago and > some people said we might remove it someday, so don't do that. If that > is false, I think we can make it more prominent. I think it's false. I'll try to give you a r

Re: Types info on binary copy

2021-01-05 Thread Tom Lane
Daniele Varrazzo writes: > Naively, it would seem that once a "COPY ... FROM STDIN" is executed > successfully, the server has a pretty good idea of what data types it > is expecting. I'm wondering: is it absurd to ask for this info to be > returned as RowDescription and to be exposed by the libpq

Re: macOS SIP, next try

2021-01-05 Thread Tom Lane
Mark Dilger writes: > See also > https://www.postgresql.org/message-id/flat/18012hGLG6HJ9pQDkHAMYuwQKg%40sparkpost.com Yeah. As I recall from that thread and prior ones, the bottleneck is really just /bin/sh: something, either the kernel or sh itself, is clearing out DYLD_LIBRARY_PATH when a sh

Re: recovery_target_timeline & documentation

2021-01-05 Thread Fujii Masao
On 2021/01/05 20:18, Benoit Lobréau wrote: Hi, It seems like this part of the documentation was not updated after changing the default value of recovery_target_timeline to latest in  v12. "The default behavior of recovery is to recover along the same timeline that was current when the base

Re: set_config() documentation clarification

2021-01-05 Thread Pavel Stehule
út 5. 1. 2021 v 18:51 odesílatel Bruce Momjian napsal: > On Mon, Jan 4, 2021 at 09:46:32AM -0700, David G. Johnston wrote: > > 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 > > th

Re: Context diffs

2021-01-05 Thread Bruce Momjian
On Tue, Jan 5, 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: Context diffs

2021-01-05 Thread Bruce Momjian
On Mon, Jan 4, 2021 at 02:42:16PM -0500, Tom Lane wrote: > 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

Re: set_config() documentation clarification

2021-01-05 Thread Bruce Momjian
On Mon, Jan 4, 2021 at 09:46:32AM -0700, David G. Johnston wrote: > 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: > > >

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

2021-01-05 Thread Stephen Frost
Greetings, * Tom Lane (t...@sss.pgh.pa.us) wrote: > Andrew Dunstan writes: > > I think there is probably a good case for some sort of "from scratch" > > option on GRANT. > > Maybe my head's not screwed on straight this morning, but it seems > to me that any such action would typically be revokin

Re: Moving other hex functions to /common

2021-01-05 Thread Bruce Momjian
On Tue, Jan 5, 2021 at 08:54:11PM +1300, Thomas Munro wrote: > 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 fil

Re: Moving other hex functions to /common

2021-01-05 Thread Bruce Momjian
On Tue, Jan 5, 2021 at 03:47:59PM +0900, Michael Paquier wrote: > 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

Re: Online checksums patch - once again

2021-01-05 Thread Michael Banck
Hi, On Tue, Jan 05, 2021 at 12:18:07AM +0100, Daniel Gustafsson wrote: > > On 3 Dec 2020, at 10:37, Daniel Gustafsson wrote: > > I've also done some tweaks to the tests to make them more robust as well as > > comment updates and general tidying up here and there. > > Attached is a rebase of the

Replication protocol pipelining edge case

2021-01-05 Thread Jeff Davis
The streaming replication protocol docs[1] say (for START_REPLICATION): "If the client requests streaming at exactly the end of an old timeline, the server responds immediately with CommandComplete without entering COPY mode." Is there a reason we do that? It seems like enough of an edge case tha

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

2021-01-05 Thread Tom Lane
Andrew Dunstan writes: > I think there is probably a good case for some sort of "from scratch" > option on GRANT. Maybe my head's not screwed on straight this morning, but it seems to me that any such action would typically be revoking permissions not adding them, so that it'd be more naturally f

Re: pg_stat_statements and "IN" conditions

2021-01-05 Thread Zhihong Yu
Hi, Dmitry: + int lastExprLenght = 0; Did you mean to name the variable lastExprLenghth ? w.r.t. extracting to helper method, the second and third if (currentExprIdx == pgss_merge_threshold - 1) blocks are similar. It is up to you whether to create the helper method. I am fine with the

Re: PoC/WIP: Extended statistics on expressions

2021-01-05 Thread Tomas Vondra
On 1/5/21 3:10 PM, Dean Rasheed wrote: On Tue, 5 Jan 2021 at 00:45, Tomas Vondra wrote: On 1/4/21 4:34 PM, Dean Rasheed wrote: * In src/bin/psql/describe.c, I think the \d output should also exclude the "expressions" stats kind and just list the other kinds (or have no kinds list at all,

Re: [PATCH] Runtime control of CLOBBER_CACHE_ALWAYS

2021-01-05 Thread Peter Eisentraut
On 2020-12-03 07:01, Craig Ringer wrote: To try it out, apply the patch (git am), build with --enable-cassert, then compare:    make -C src/test/regress check and    PGOPTIONS="-c debug_clobber_cache_depth=1" \    make -C src/test/regress check The speed difference will be obvious if noth

Re: PoC/WIP: Extended statistics on expressions

2021-01-05 Thread Dean Rasheed
On Tue, 5 Jan 2021 at 00:45, Tomas Vondra wrote: > > On 1/4/21 4:34 PM, Dean Rasheed wrote: > > > > * In src/bin/psql/describe.c, I think the \d output should also > > exclude the "expressions" stats kind and just list the other kinds (or > > have no kinds list at all, if there are no other kinds)

Re: Parallel Inserts in CREATE TABLE AS

2021-01-05 Thread Bharath Rupireddy
On Tue, Jan 5, 2021 at 1:00 PM Luc Vlaming wrote: > Reviewing further v20-0001: > > I would still opt for moving the code for the parallel worker into a > separate function, and then setting rStartup of the dest receiver to > that function in ExecParallelGetInsReceiver, as its completely > indepen

Re: pg_stat_statements and "IN" conditions

2021-01-05 Thread Dmitry Dolgov
> On Sat, Dec 26, 2020 at 08:53:28AM -0800, Zhihong Yu wrote: > Hi, > A few comments. > > + foreach(lc, (List *) expr) > + { > + Node * subExpr = (Node *) lfirst(lc); > + > + if (!IsA(subExpr, Const)) > + { > +

Re: Cirrus CI (Windows help wanted)

2021-01-05 Thread Andrew Dunstan
On 1/4/21 10:58 PM, Thomas Munro wrote: > 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

Types info on binary copy

2021-01-05 Thread Daniele Varrazzo
Hello, The PGresult structure returned on COPY ... FROM provides a handful of information (https://www.postgresql.org/docs/13/libpq-copy.html): number of fields expected and whether they are binary or not. However it doesn't provide the types expected. For binary copy the exact type is important:

Re: Context diffs

2021-01-05 Thread Andrew Dunstan
On 1/4/21 5:21 PM, 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 works) >> >> * the com

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

2021-01-05 Thread Andrew Dunstan
On 1/4/21 11:15 AM, Isaac Morland wrote: > 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 permiss

Re: Single transaction in the tablesync worker?

2021-01-05 Thread Amit Kapila
On Tue, Jan 5, 2021 at 3:32 PM Peter Smith wrote: > > On Mon, Jan 4, 2021 at 10:48 PM Amit Kapila wrote: > > > > Few more comments on v9: > > == > > 1. > > + /* Drop the tablesync slot. */ > > + { > > + char *syncslotname = ReplicationSlotNameForTablesync(subid, relid); > > +

Re: Deadlock between backend and recovery may not be detected

2021-01-05 Thread Victor Yegorov
вт, 5 янв. 2021 г. в 07:26, Fujii Masao : > This situation makes me feel that I'm inclined to skip the back-patch to > v9.5. > Because the next minor version release is the final one for v9.5. So if we > unexpectedly introduce the bug to v9.5 by the back-patch, there is no > chance to fix that. OT

recovery_target_timeline & documentation

2021-01-05 Thread Benoit Lobréau
Hi, It seems like this part of the documentation was not updated after changing the default value of recovery_target_timeline to latest in v12. "The default behavior of recovery is to recover along the same timeline that was current when the base backup was taken. If you wish to recover into som

Re: Parallel Inserts in CREATE TABLE AS

2021-01-05 Thread Luc Vlaming
On 05-01-2021 11:32, Dilip Kumar wrote: On Tue, Jan 5, 2021 at 12:43 PM Luc Vlaming wrote: On 04-01-2021 14:32, Bharath Rupireddy wrote: On Mon, Jan 4, 2021 at 4:22 PM Luc Vlaming mailto:l...@swarm64.com>> wrote: > Sorry it took so long to get back to reviewing this. Thanks for the comment

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

2021-01-05 Thread Amit Kapila
On Tue, Jan 5, 2021 at 2:11 PM Ajin Cherian wrote: > > > I've addressed the above comments and the patch is attached. I've > called it v36-0007. > Thanks, I have pushed this after minor wordsmithing. -- With Regards, Amit Kapila.

Re: Track replica origin progress for Rollback Prepared

2021-01-05 Thread Amit Kapila
On Tue, Jan 5, 2021 at 12:32 PM Michael Paquier wrote: > > 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

Re: Parallel Inserts in CREATE TABLE AS

2021-01-05 Thread Dilip Kumar
On Tue, Jan 5, 2021 at 12:43 PM Luc Vlaming wrote: > > 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-0

Re: New Table Access Methods for Multi and Single Inserts

2021-01-05 Thread Bharath Rupireddy
On Mon, Jan 4, 2021 at 1:29 PM Luc Vlaming wrote: > > table AM patch [2] be reviewed further? > As to the patches themselves: > > I think the API is a huge step forward! I assume that we want to have a > single-insert API like heap_insert_v2 so that we can encode the > knowledge that there will j

Re: [PATCH] Simple progress reporting for COPY command

2021-01-05 Thread Josef Šimánek
I'm attaching the whole patch since commitfest failed to ingest the last incremental on CI. út 5. 1. 2021 v 2:32 odesílatel Josef Šimánek napsal: > > ú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: > >

  1   2   >