Re: pg_stat_statements oddity with track = all

2021-03-06 Thread Julien Rouhaud
On Sat, Mar 06, 2021 at 06:56:49PM +0100, Magnus Hagander wrote: > On Sun, Dec 27, 2020 at 9:39 AM Julien Rouhaud wrote: > > > - * > - * Right now, this structure contains no padding. If you add any, make sure > - * to teach pgss_store() to zero the padding bytes. Otherwise, things will > - * br

Re: pg_stat_statements oddity with track = all

2021-03-06 Thread Julien Rouhaud
On Thu, Jan 21, 2021 at 12:43:22AM +0900, Masahiko Sawada wrote: > On Wed, Jan 20, 2021 at 6:15 PM Julien Rouhaud wrote: > > > > I agree, thanks for the change! > > I've changed the topic accordingly. Thanks Sawada-san! I thought that I took care of that but I somehow missed it.

Re: [HACKERS] Custom compression methods

2021-03-06 Thread Justin Pryzby
On Sun, Mar 07, 2021 at 12:16:41PM +0530, Dilip Kumar wrote: > > If I pg_upgrade from an binary with-lz4 to one without-lz4, it fails > > while restoring the schema, after running check, which is bad: > > | pg_restore: error: could not execute query: ERROR: not built with lz4 > > support > > |CRE

Re: [HACKERS] Custom compression methods

2021-03-06 Thread Dilip Kumar
On Sun, Mar 7, 2021 at 1:27 AM Justin Pryzby wrote: > > On Sat, Mar 06, 2021 at 08:59:16PM +0530, Dilip Kumar wrote: > > - Alter table set compression, will not rewrite the old data, so only > > the new tuple will be compressed with the new compression method. > > - No preserve. > > +1, this simpl

Re: EXPLAIN/EXPLAIN ANALYZE REFRESH MATERIALIZED VIEW

2021-03-06 Thread Japin Li
On Sun, 07 Mar 2021 at 14:25, Bharath Rupireddy wrote: > On Sun, Mar 7, 2021 at 11:49 AM Japin Li wrote: >> >> On Fri, 05 Mar 2021 at 19:48, Bharath Rupireddy >> wrote: >> > Attaching v5 patch set for further review. >> > >> >> The v5 patch looks good to me, if there is no objection, I'll ch

Re: EXPLAIN/EXPLAIN ANALYZE REFRESH MATERIALIZED VIEW

2021-03-06 Thread Bharath Rupireddy
On Sun, Mar 7, 2021 at 11:49 AM Japin Li wrote: > > On Fri, 05 Mar 2021 at 19:48, Bharath Rupireddy > wrote: > > Attaching v5 patch set for further review. > > > > The v5 patch looks good to me, if there is no objection, I'll change the > cf status to "Ready for Committer" in few days. Thanks f

Re: EXPLAIN/EXPLAIN ANALYZE REFRESH MATERIALIZED VIEW

2021-03-06 Thread Japin Li
On Fri, 05 Mar 2021 at 19:48, Bharath Rupireddy wrote: > Attaching v5 patch set for further review. > The v5 patch looks good to me, if there is no objection, I'll change the cf status to "Ready for Committer" in few days. -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.

Re: Inquiries about PostgreSQL's system catalog development——from a student developer of Nanjing University

2021-03-06 Thread Japin Li
On Sat, 06 Mar 2021 at 17:01, 杨逸存 <1057206...@qq.com> wrote: > Dear hacker: >     I am a Nanjing University student, Yang. I have forked a newly > version of PostgreSQL source code to develop for my own use. Her is my > question: I am trying to add a new system catalog to the system backend, ho

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

2021-03-06 Thread Zhihong Yu
For cfffe83ba82021a1819a656e7ec5c28fb3a99152, if a bool was written (true | false), READ_INT_FIELD calls atoi() where atoi("true") returns 0 and atoi("false") returns 0 as well. I am not sure if the new release containing these commits had a higher cat version compared to the previous release. If

Re: CLUSTER on partitioned index

2021-03-06 Thread Justin Pryzby
On Wed, Feb 10, 2021 at 02:04:58PM -0600, Justin Pryzby wrote: > On Sat, Feb 06, 2021 at 08:45:49AM -0600, Justin Pryzby wrote: > > On Mon, Jan 18, 2021 at 12:34:59PM -0600, Justin Pryzby wrote: > > > On Sat, Nov 28, 2020 at 08:03:02PM -0600, Justin Pryzby wrote: > > > > On Sun, Nov 15, 2020 at 07:

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

2021-03-06 Thread Amit Kapila
On Sun, Mar 7, 2021 at 8:24 AM Zhihong Yu wrote: > > I was looking at src/backend/nodes/readfuncs.c > > READ_NODE_FIELD(relationOids); > + READ_NODE_FIELD(partitionOids); > > READ_NODE_FIELD would call nodeRead() for partitionOids. However, such field > may not exist. > Since there is no 'i

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

2021-03-06 Thread Amit Kapila
On Sun, Mar 7, 2021 at 7:35 AM Peter Smith wrote: > > Please find attached the latest patch set v51* > Few more comments on v51-0006-Fix-apply-worker-empty-prepare: == 1. +/* + * A Prepare spoolfile hash entry. We create this entry in the psf_ha

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

2021-03-06 Thread Zhihong Yu
I was looking at src/backend/nodes/readfuncs.c READ_NODE_FIELD(relationOids); + READ_NODE_FIELD(partitionOids); READ_NODE_FIELD would call nodeRead() for partitionOids. However, such field may not exist. Since there is no 'if (strncmp(":partitionOids", token, length) == 0) {' check, I was c

Re: Tablesync early exit

2021-03-06 Thread Amit Kapila
On Sun, Mar 7, 2021 at 7:26 AM Peter Smith wrote: > > Hi hackers. > > I propose a small optimization can be added to the tablesync replication code. > > This proposal (and simple patch) was first discussed here [1]. > It might be better if you attach your proposed patch to this thread. -- With

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

2021-03-06 Thread Amit Kapila
On Sat, Mar 6, 2021 at 9:13 PM Zhihong Yu wrote: > > Hi, > Does CATALOG_VERSION_NO need to be bumped (introduction of partitionOids > field) ? > Good question. I usually update CATALOG_VERSION_NO when the patch changes any of the system catalogs. This is what is also mentioned in catversion.h. S

Tablesync early exit

2021-03-06 Thread Peter Smith
Hi hackers. I propose a small optimization can be added to the tablesync replication code. This proposal (and simple patch) was first discussed here [1]. Basic idea is the tablesync could/should detect if there is anything to do *before* it enters the apply main loop. Calling process_sync_tables

Re: WIP: document the hook system

2021-03-06 Thread Tom Lane
David Fetter writes: > I'm -1 on making a README alone. These are public APIs, and as such, > the fact of their existence shouldn't be a mystery discoverable only > by knowing that there's something to look for in the source tree and > then running an appropriate grep command to find the current o

Re: WIP: document the hook system

2021-03-06 Thread David Fetter
On Fri, Feb 12, 2021 at 08:02:51PM +0300, Anastasia Lubennikova wrote: > On 17.01.2021 16:53, Magnus Hagander wrote: > > On Fri, Jan 15, 2021 at 8:28 AM Peter Eisentraut > > wrote: > > > On 2020-12-31 04:28, David Fetter wrote: > > > > This could probably use a lot of filling in, but having it in

[PATCH] pg_ownerships system view

2021-03-06 Thread Joel Jacobson
Hi, Attached is a suggestion of adding a convenience view, allowing quickly looking up all objects owned by a given user. Example: SELECT * FROM ownerships WHERE rolname = 'joel' LIMIT 5; regclass | obj_desc | rolname --+-

Re: [PATCH] pgbench: Bug fix for the -d option

2021-03-06 Thread Michael Paquier
On Sat, Mar 06, 2021 at 01:19:44PM -0500, Tom Lane wrote: > This item is still open according to the commitfest app --- > should that entry be closed? Thanks. Done. -- Michael signature.asc Description: PGP signature

Re: [Doc Patch] Clarify that CREATEROLE roles can GRANT default roles

2021-03-06 Thread Michael Banck
On Sat, Mar 06, 2021 at 06:12:50PM +0100, Magnus Hagander wrote: > On Tue, Feb 23, 2021 at 7:19 AM Robert Treat wrote: > > On Thu, Dec 31, 2020 at 10:05 AM Michael Banck > > wrote: > > > Am Montag, den 28.12.2020, 20:41 +0900 schrieb Masahiko Sawada: > > > > On Sat, Nov 28, 2020 at 7:50 AM Michae

Re: [patch] bit XOR aggregate functions

2021-03-06 Thread David G. Johnston
On Saturday, March 6, 2021, David Fetter wrote: > > > > SELECT BIT_XOR(b ORDER BY a, c).../* works */ > > > SELECT BIT_XOR(b) OVER (ORDER BY a, c)... /* works */ > > > SELECT BIT_XOR(b) FROM... /* errors out */ > > > > > > Why would such an error be necessary,

Re: [patch] bit XOR aggregate functions

2021-03-06 Thread David Fetter
On Sat, Mar 06, 2021 at 09:03:25PM +0100, Vik Fearing wrote: > On 3/6/21 9:00 PM, David Fetter wrote: > > On Sat, Mar 06, 2021 at 08:57:46PM +0100, Vik Fearing wrote: > >> On 3/6/21 8:55 PM, David Fetter wrote: > >>> On Wed, Mar 03, 2021 at 03:30:15PM +0100, Peter Eisentraut wrote: > On 10.02.

Re: [patch] bit XOR aggregate functions

2021-03-06 Thread Vik Fearing
On 3/6/21 9:00 PM, David Fetter wrote: > On Sat, Mar 06, 2021 at 08:57:46PM +0100, Vik Fearing wrote: >> On 3/6/21 8:55 PM, David Fetter wrote: >>> On Wed, Mar 03, 2021 at 03:30:15PM +0100, Peter Eisentraut wrote: On 10.02.21 06:42, Kyotaro Horiguchi wrote: > We already had CREATE AGGREATE

Re: pg_upgrade test for binary compatibility of core data types

2021-03-06 Thread Tom Lane
Peter Eisentraut writes: > On 2021-01-12 22:44, Andrew Dunstan wrote: >> Cross version pg_upgrade is tested regularly in the buildfarm, but not >> using test.sh. Instead it uses the saved data repository from a previous >> run of the buildfarm client for the source branch, and tries to upgrade >>

Re: [patch] bit XOR aggregate functions

2021-03-06 Thread David Fetter
On Sat, Mar 06, 2021 at 08:57:46PM +0100, Vik Fearing wrote: > On 3/6/21 8:55 PM, David Fetter wrote: > > On Wed, Mar 03, 2021 at 03:30:15PM +0100, Peter Eisentraut wrote: > >> On 10.02.21 06:42, Kyotaro Horiguchi wrote: > >>> We already had CREATE AGGREATE at the time, so BIT_XOR can be > >>> thou

Re: [HACKERS] Custom compression methods

2021-03-06 Thread Justin Pryzby
On Sat, Mar 06, 2021 at 08:59:16PM +0530, Dilip Kumar wrote: > - Alter table set compression, will not rewrite the old data, so only > the new tuple will be compressed with the new compression method. > - No preserve. +1, this simplifies things. If someone *wants* to rewrite the table, they can V

Re: [patch] bit XOR aggregate functions

2021-03-06 Thread Vik Fearing
On 3/6/21 8:55 PM, David Fetter wrote: > On Wed, Mar 03, 2021 at 03:30:15PM +0100, Peter Eisentraut wrote: >> On 10.02.21 06:42, Kyotaro Horiguchi wrote: >>> We already had CREATE AGGREATE at the time, so BIT_XOR can be >>> thought as it falls into the same category with BIT_AND and >>> BIT_OR, tha

Re: [patch] bit XOR aggregate functions

2021-03-06 Thread David Fetter
On Wed, Mar 03, 2021 at 03:30:15PM +0100, Peter Eisentraut wrote: > On 10.02.21 06:42, Kyotaro Horiguchi wrote: > > We already had CREATE AGGREATE at the time, so BIT_XOR can be > > thought as it falls into the same category with BIT_AND and > > BIT_OR, that is, we may have BIT_XOR as an intrinsic

Public APIs

2021-03-06 Thread David Fetter
Hi, While I was looking at the Citus code base for a project at work, I noticed a really ugly thing. It was a UDF called alter_columnar_table_set(). It's clearly there because our current DDL is a few bricks shy of a load, as others have phrased such things, when it comes to accommodating the tabl

[PATCH] pg_permissions

2021-03-06 Thread Joel Jacobson
Hi, It's easy to answer the question... - What permissions are there on this specific object? ...but to answer the question... - What permissions are there for a specific role in the database? you need to manually query all relevant pg_catalog or information_schema.*_privileges views, w

Re: Enhance traceability of wal_level changes for backup management

2021-03-06 Thread Peter Eisentraut
On 28.01.21 01:44, osumi.takami...@fujitsu.com wrote: (1) writing the time or LSN in the control file to indicate when/where wal_level is changed to 'minimal' from upper level to invalidate the old backups or make alerts to users. I attached the first patch which implementes this idea. It was al

Re: Feedback on table expansion hook (including patch)

2021-03-06 Thread David Fetter
On Sat, Mar 06, 2021 at 01:09:10PM -0500, Tom Lane wrote: > Peter Eisentraut writes: > > On 07.05.20 10:11, Erik Nordström wrote: > >> I am looking for feedback on the possibility of adding a table expansion > >> hook to PostgreSQL (see attached patch). > > > Unlike the get_relation_info_hook, y

Re: [patch] bit XOR aggregate functions

2021-03-06 Thread Peter Eisentraut
On 05.03.21 13:42, Alexey Bashtanov wrote: Thanks for your reviews. I've updated my patch to the current master and added a documentation line suggesting using the new function as a checksum. committed

Re: [PATCH] pgbench: Bug fix for the -d option

2021-03-06 Thread Tom Lane
Michael Paquier writes: > On Fri, Mar 05, 2021 at 06:35:47PM +0900, Fujii Masao wrote: >> Understood. Thanks! > Okay, so I have gone through this stuff today, and applied the > simplification. Thanks. This item is still open according to the commitfest app --- should that entry be closed?

Re: Some regular-expression performance hacking

2021-03-06 Thread Noah Misch
On Sat, Feb 13, 2021 at 06:19:34PM +0100, Joel Jacobson wrote: > To test the correctness of the patches, > I thought it would be nice with some real-life regexes, > and just as important, some real-life text strings, > to which the real-life regexes are applied to. > > I therefore patched Chromium

Re: Feedback on table expansion hook (including patch)

2021-03-06 Thread Tom Lane
Peter Eisentraut writes: > On 07.05.20 10:11, Erik Nordström wrote: >> I am looking for feedback on the possibility of adding a table expansion >> hook to PostgreSQL (see attached patch). > Unlike the get_relation_info_hook, your proposed hook would *replace* > expand_inherited_rtentry() rather

Re: pg_stat_statements oddity with track = all

2021-03-06 Thread Magnus Hagander
On Sun, Dec 27, 2020 at 9:39 AM Julien Rouhaud wrote: > > On Fri, Dec 04, 2020 at 06:09:13PM +0800, Julien Rouhaud wrote: > > On Fri, Dec 04, 2020 at 12:06:10PM +0300, Sergei Kornilov wrote: > > > Hello > > > > > > Seems we need also change PGSS_FILE_HEADER. > > > > Indeed, thanks! v2 attached. >

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

2021-03-06 Thread Magnus Hagander
On Fri, Feb 26, 2021 at 8:45 PM Jacob Champion wrote: > > On Thu, 2021-02-11 at 20:32 +, Jacob Champion wrote: > > v2 just updates the patchset to remove the Windows TODO and fill in the > > patch notes; no functional changes. The question about escaping log > > contents remains. > > v3 rebase

Re: [Doc Patch] Clarify that CREATEROLE roles can GRANT default roles

2021-03-06 Thread Magnus Hagander
On Tue, Feb 23, 2021 at 7:19 AM Robert Treat wrote: > > On Thu, Dec 31, 2020 at 10:05 AM Michael Banck > wrote: > > > > Hi, > > > > Am Montag, den 28.12.2020, 20:41 +0900 schrieb Masahiko Sawada: > > > On Sat, Nov 28, 2020 at 7:50 AM Michael Banck > > > wrote: > > > > https://www.postgresql.org

Re: contrib/cube - binary input/output handlers

2021-03-06 Thread Tom Lane
Kohei KaiGai writes: > Ok, the attached v4 sends the raw header as-is, then cube_recv > validates the header. > If num-of-dimension is larger than CUBE_MAX_DIM, it is obviously > unused bits (8-30) > are used or out of the range. Works for me. I noted one additional bug: you have to condition wh

Re: A new function to wait for the backend exit after termination

2021-03-06 Thread Magnus Hagander
On Fri, Dec 4, 2020 at 10:13 AM Bharath Rupireddy wrote: > > On Fri, Dec 4, 2020 at 2:02 PM Hou, Zhijie wrote: > > > > Hi, > > > > When test pg_terminate_backend_and_wait with parallel query. > > I noticed that the function is not defined as parallel safe. > > > > I am not very familiar with the

Re: [patch] [doc] Introduce view updating options more succinctly

2021-03-06 Thread Magnus Hagander
On Mon, Nov 30, 2020 at 9:22 PM Anastasia Lubennikova wrote: > > I wonder, why this patch didn't get a review during the CF. > This minor improvement looks good to me, so I mark it Ready for Committer. Agreed, and how it managed to pass multiple CFs without getting applied :) I've applied it now

Re: PROXY protocol support

2021-03-06 Thread Magnus Hagander
On Sat, Mar 6, 2021 at 4:17 PM Magnus Hagander wrote: > > On Fri, Mar 5, 2021 at 8:11 PM Jacob Champion wrote: > > > > On Fri, 2021-03-05 at 10:22 +0100, Magnus Hagander wrote: > > > On Fri, Mar 5, 2021 at 12:21 AM Jacob Champion > > > wrote: > > > > The original-host logging isn't working for

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

2021-03-06 Thread Zhihong Yu
Hi, Does CATALOG_VERSION_NO need to be bumped (introduction of partitionOids field) ? Cheers On Sat, Mar 6, 2021 at 2:19 AM Amit Kapila wrote: > On Fri, Mar 5, 2021 at 6:34 PM Greg Nancarrow wrote: > > > > For the time being at least, I am posting an updated set of patches, > > as I found that

Re: is cfbot's apply aging intentional?

2021-03-06 Thread Alvaro Herrera
On 2021-Mar-06, e...@xs4all.nl wrote: > Is that the way it's supposed to be? I would have thought there was a > regular schedule (hourly? 3-hourly? daily?) when all patches were taken for > re-apply, and re-build, so that when a patch stops applying/building/whatever > it can be seen on the cf

Re: PROXY protocol support

2021-03-06 Thread Magnus Hagander
On Fri, Mar 5, 2021 at 8:11 PM Jacob Champion wrote: > > On Fri, 2021-03-05 at 10:22 +0100, Magnus Hagander wrote: > > On Fri, Mar 5, 2021 at 12:21 AM Jacob Champion wrote: > > > The original-host logging isn't working for me: > > > > > > [...] > > > > That's interesting -- it works perfectly fin

Re: Inquiries about PostgreSQL's system catalog development????from a student developer of Nanjing University

2021-03-06 Thread Tom Lane
"=?gb18030?B?0e7S3bTm?=" <1057206...@qq.com> writes: >     I am a Nanjing University student, Yang. I have forked a newly > version of PostgreSQL source code to develop for my own use. Her is my > question: I am trying to add a new system catalog to the system backend, how > can I reach it? Is t

Re: Increase value of OUTER_VAR

2021-03-06 Thread Tom Lane
Peter Eisentraut writes: > On 04.03.21 20:01, Tom Lane wrote: >> (2) Does that datatype change need to propagate anywhere besides >> what I touched here? I did not make any effort to search for >> other places. > I think > Var.varnosyn > CurrentOfExpr.cvarno > should also have their type chang

Re: is cfbot's apply aging intentional?

2021-03-06 Thread Julien Rouhaud
On Sat, Mar 06, 2021 at 03:00:46PM +0100, e...@xs4all.nl wrote: > > I was looking at the 'Catalog version access' patch, by Vik Fearing. I saw a > succesful build by the cfbot but I could not build one here. Only then did I > notice that the last apply of the patches by cfbot was on 3769e11 wh

Re: proposal: psql –help reflecting service or URI usage

2021-03-06 Thread Paul Förster
Hi Euler, > On 01. Mar, 2021, at 15:42, Euler Taveira wrote: > > We try to limit it to 80 characters but it is not a hard limit. Long > descriptions should certainly be split into multiple lines. got that, thanks. > The question is: how popular is service and connection URIs? well, we use th

is cfbot's apply aging intentional?

2021-03-06 Thread er
Hi, I was looking at the 'Catalog version access' patch, by Vik Fearing. I saw a succesful build by the cfbot but I could not build one here. Only then did I notice that the last apply of the patches by cfbot was on 3769e11 which is the 3rd march, some 10 commits ago. There have been no new

Re: proposal: psql –help reflecting service or URI usage

2021-03-06 Thread Paul Förster
Hi Mark, sorry for the delay. > On 01. Mar, 2021, at 17:02, Mark Dilger wrote: > > The output from --help should fit in a terminal window with only 80 > characters width. For example, in src/bin/scripts/createuser.c the line > about --interactive is wrapped: I see. > You can find counter-e

Re: [PATCH] pgbench: Bug fix for the -d option

2021-03-06 Thread Michael Paquier
On Fri, Mar 05, 2021 at 06:35:47PM +0900, Fujii Masao wrote: > Understood. Thanks! Okay, so I have gone through this stuff today, and applied the simplification. Thanks. -- Michael signature.asc Description: PGP signature

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

2021-03-06 Thread Amit Kapila
On Sat, Mar 6, 2021 at 7:19 AM Peter Smith wrote: > > Please find attached the latest patch set v50* > Few comments on the latest patch series: = 1. I think we can extract the changes to make streaming optional with 2PC and infact you can start a separate thread fo

Re: How to retain lesser paths at add_path()?

2021-03-06 Thread Kohei KaiGai
2020年11月6日(金) 0:40 Dmitry Dolgov <9erthali...@gmail.com>: > > > On Tue, Jan 14, 2020 at 12:46:02AM +0900, Kohei KaiGai wrote: > > The v2 patch is attached. > > > > This adds two dedicated lists on the RelOptInfo to preserve lesser paths > > if extension required to retain the path-node to be remove

Inquiries about PostgreSQL's system catalog development????from a student developer of Nanjing University

2021-03-06 Thread ??????
Dear hacker:     I am a Nanjing University student, Yang. I have forked a newly version of PostgreSQL source code to develop for my own use. Her is my question: I am trying to add a new system catalog to the system backend, how can I reach it? Is there any code or interface demonstration to show

Re: Increase value of OUTER_VAR

2021-03-06 Thread Peter Eisentraut
On 04.03.21 20:01, Tom Lane wrote: Just as a proof of concept, I tried the attached, and it passes check-world. So if there's anyplace trying to stuff OUTER_VAR and friends into bitmapsets, it's pretty far off the beaten track. The main loose ends that'd have to be settled seem to be: (1) What