Re: Remove repeated calls to PQserverVersion

2021-07-14 Thread Daniel Gustafsson
> On 14 Jul 2021, at 02:19, Alvaro Herrera wrote: > Personally, I like the simplicity of the function call in those places, +1 -- Daniel Gustafsson https://vmware.com/

Re: [PATCH] document pg_encoding_to_char() and pg_char_to_encoding()

2021-07-14 Thread Ian Lawrence Barwick
2021年7月14日(水) 14:43 Ian Lawrence Barwick : > > Hi > > The description for "pg_database" [1] mentions the function > "pg_encoding_to_char()", but this is not described anywhere in the docs. Given > that that it (and the corresponding "pg_char_to_encoding()") have been around > since 7.0 [2], it's pr

Re: Transactions involving multiple postgres foreign servers, take 2

2021-07-14 Thread Masahiko Sawada
On Tue, Jul 13, 2021 at 1:14 PM r.takahash...@fujitsu.com wrote: > > Hi Sawada-san, > > > Thank you for your reply. > > > Not sure but it might be possible to keep holding an xlogreader for > > reading PREPARE WAL records even after the transaction commit. But I > > wonder how much open() for wal

Re: psql - factor out echo code

2021-07-14 Thread Fabien COELHO
Attached v4 simplifies the format and fixes this one. I think this goes way way overboard in terms of invasiveness. There's no need to identify individual call sites of PSQLexec. [...] ISTM that having the information was useful for the user who actually asked for psql to show hidden queri

Re: Skipping logical replication transactions on subscriber side

2021-07-14 Thread Masahiko Sawada
On Mon, Jul 12, 2021 at 8:52 PM Amit Kapila wrote: > > On Mon, Jul 12, 2021 at 11:13 AM Masahiko Sawada > wrote: > > > > On Mon, Jul 12, 2021 at 1:15 PM Amit Kapila wrote: > > > > > > On Mon, Jul 12, 2021 at 9:37 AM Alexey Lesovsky > > > wrote: > > > > > > > > On Mon, Jul 12, 2021 at 8:36 AM

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

2021-07-14 Thread Peter Smith
On Wed, Jul 14, 2021 at 4:23 PM Amit Kapila wrote: > > On Mon, Jul 12, 2021 at 9:14 AM Peter Smith wrote: > > > > On Sun, Jul 11, 2021 at 8:20 PM Amit Kapila wrote: > > > > > > On Fri, Jul 9, 2021 at 4:43 AM Peter Smith wrote: > > > > > > > > > The patch looks good to me, I don't have any comme

Avoid repeated PQfnumber() in pg_dump

2021-07-14 Thread houzj.f...@fujitsu.com
Hi, When reviewing some pg_dump related code, I found some existsing code (getTableAttrs() and dumpEnumType()) invoke PQfnumber() repeatedly which seems unnecessary. Example - for (int j = 0; j < ntups; j++) { if (j + 1 != atoi(PQgetvalu

Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?

2021-07-14 Thread Magnus Hagander
On Wed, Jul 14, 2021 at 6:36 AM Peter Eisentraut wrote: > > On 13.07.21 10:58, Magnus Hagander wrote: > > Maybe "each distinct database id, each distinct user id, each distinct > > query id, and whether it is a top level statement or not"? > > > > Or maybe "each distinct combination of database id

Re: row filtering for logical replication

2021-07-14 Thread Amit Kapila
On Wed, Jul 14, 2021 at 12:37 AM Tomas Vondra wrote: > > On 7/13/21 5:44 PM, Jeff Davis wrote: > > On Tue, 2021-07-13 at 10:24 +0530, Amit Kapila wrote: > > Also: > > > > * Andres also mentioned that the function should not leak memory. > > * One use case for this feature is when sharding a table,

Re: Support kerberos authentication for postgres_fdw

2021-07-14 Thread Peifeng Qiu
Hi all. I've come up with a proof-of-concept patch using the delegation/proxy approach. Let's say we have two DB, one for FDW and one for the real server. When client connects to FDW server using kerberos authentication, we can obtain a "proxy" credential and store it in the global variable "MyPr

Re: row filtering for logical replication

2021-07-14 Thread Amit Kapila
On Wed, Jul 14, 2021 at 12:45 AM Tomas Vondra wrote: > > On 7/13/21 12:57 PM, Amit Kapila wrote: > > On Tue, Jul 13, 2021 at 10:24 AM Amit Kapila > > wrote: > > > I think the problem described by Petr[1] is also possible today if the > > user drops the publication and there is a corresponding su

Re: [HACKERS] Preserving param location

2021-07-14 Thread Julien Rouhaud
On Tue, Jul 13, 2021 at 07:01:24PM -0400, Tom Lane wrote: > > I thought for a bit about also having evaluate_expr() inject the > exprLocation(expr) into its result Const, but in this example > that would likely result in having the 43 labeled with the offset > of the $1 (given exprLocation's pencha

Re: proposal: possibility to read dumped table's name from file

2021-07-14 Thread Tomas Vondra
On 7/14/21 2:18 AM, Stephen Frost wrote: Greetings, * Alvaro Herrera (alvhe...@2ndquadrant.com) wrote: On 2021-Jul-13, Stephen Frost wrote: The simplest possible format isn't going to work with all the different pg_dump options and it still isn't going to be 'simple' since it needs to work wit

Re: psql \copy from sends a lot of packets

2021-07-14 Thread Heikki Linnakangas
On 13/07/2021 14:52, Aleksander Alekseev wrote: The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, passed The patch w

Re: row filtering for logical replication

2021-07-14 Thread Tomas Vondra
On 7/14/21 7:39 AM, Amit Kapila wrote: On Wed, Jul 14, 2021 at 6:28 AM Euler Taveira wrote: On Tue, Jul 13, 2021, at 6:06 PM, Alvaro Herrera wrote: 1. if you use REPLICA IDENTITY FULL, then the expressions would work even if they use any other column with DELETE. Maybe it would be reasona

Re: Extending amcheck to check toast size and compression

2021-07-14 Thread Heikki Linnakangas
@@ -30,6 +30,9 @@ PG_FUNCTION_INFO_V1(verify_heapam); /* The number of columns in tuples returned by verify_heapam */ #define HEAPCHECK_RELATION_COLS 4 +/* The largest valid toast va_rawsize */ +#define VARLENA_SIZE_LIMIT 0x3FFF + Hmm, a toasted datum cannot be larger than MaxAllocSize,

Re: Added schema level support for publication.

2021-07-14 Thread vignesh C
On Tue, Jul 13, 2021 at 2:22 PM Greg Nancarrow wrote: > > On Mon, Jul 12, 2021 at 7:24 PM vignesh C wrote: > > > > > > Thanks for reporting this issue. I felt this issue is the same as the issue which Hou San had reported. This issue is fixed in the v10 patch attached at [1]. > > [1] - https://ww

Re: ERROR: "ft1" is of the wrong type.

2021-07-14 Thread Michael Paquier
On Fri, Jul 09, 2021 at 09:00:31PM +0900, Kyotaro Horiguchi wrote: > Mmm. Ok, I distributed the mother regression test into each version. Thanks, my apologies for the late reply. It took me some time to analyze the whole. > PG11, 12: > > - ATT_TABLE | ATT_PARTITIONED_INDEX > >This test doe

Re: row filtering for logical replication

2021-07-14 Thread Dilip Kumar
On Wed, Jul 14, 2021 at 3:58 PM Tomas Vondra wrote: > > > > On 7/14/21 7:39 AM, Amit Kapila wrote: > > On Wed, Jul 14, 2021 at 6:28 AM Euler Taveira wrote: > >> > >> On Tue, Jul 13, 2021, at 6:06 PM, Alvaro Herrera wrote: > >> > >> 1. if you use REPLICA IDENTITY FULL, then the expressions would w

Re: alter table set TABLE ACCESS METHOD

2021-07-14 Thread vignesh C
On Thu, Jun 10, 2021 at 1:01 AM Jeff Davis wrote: > > On Wed, 2021-06-09 at 13:47 +0900, Michael Paquier wrote: > > There is a mix of upper and lower-case characters here. It could be > > more consistent. It seems to me that this test should actually check > > that pg_class.relam reflects the ne

Re: Columns correlation and adaptive query optimization

2021-07-14 Thread vignesh C
On Fri, Mar 19, 2021 at 10:28 PM Konstantin Knizhnik wrote: > > > > On 19.03.2021 12:17, Yugo NAGATA wrote: > > On Wed, 10 Mar 2021 03:00:25 +0100 > > Tomas Vondra wrote: > > > >> What is being proposed here - an extension suggesting which statistics > >> to create (and possibly creating them aut

Re: [PATCH] Add extra statistics to explain for Nested Loop

2021-07-14 Thread vignesh C
On Wed, Apr 14, 2021 at 4:57 PM wrote: > > Thank you for working on this issue. Your comments helped me make this > patch more correct. > > > Lines with "colon" format shouldn't use equal signs, and should use two > > spaces > > between fields. > Done. Now extra line looks like "Loop min_rows: %.0

Re: row filtering for logical replication

2021-07-14 Thread Greg Nancarrow
On Wed, Jul 14, 2021 at 6:38 AM Euler Taveira wrote: > > Peter, thanks for quickly check the new patch. I'm attaching a new patch (v19) > that addresses (a) this new review, (b) Tomas' review and (c) Greg's review. I > also included the copy/equal node support for the new node (PublicationTable) >

Re: [PATCH] Automatic HASH and LIST partition creation

2021-07-14 Thread Pavel Borisov
> > - I don't think it's a very good idea to support LIST and HASH but not > RANGE. We need a design that can work for all three partitioning > strategies, even if we don't have support for all of them in the > initial patch. If they CAN all be in the same patch, so much the > better. > > - I am no

Re: partial heap only tuples

2021-07-14 Thread vignesh C
On Tue, Mar 9, 2021 at 12:09 AM Bossart, Nathan wrote: > > On 3/8/21, 10:16 AM, "Ibrar Ahmed" wrote: > > On Wed, Feb 24, 2021 at 3:22 AM Bossart, Nathan wrote: > >> On 2/10/21, 2:43 PM, "Bruce Momjian" wrote: > >>> I wonder if you should create a Postgres wiki page to document all of > >>> this

Re: Write visibility map during CLUSTER/VACUUM FULL

2021-07-14 Thread vignesh C
On Mon, Jun 28, 2021 at 1:52 PM Anna Akenteva wrote: > > On 2019-11-29 05:32, Michael Paquier wrote: > > These comments are unanswered for more than 2 months, so I am marking > > this entry as returned with feedback. > > I'd like to revive this patch. To make further work easier, attaching a > reb

Re: WIP: System Versioned Temporal Table

2021-07-14 Thread vignesh C
On Mon, Mar 8, 2021 at 11:04 PM Ibrar Ahmed wrote: > > > > On Thu, Feb 25, 2021 at 3:28 PM Li Japin wrote: >> >> >> On Jan 27, 2021, at 12:39 AM, Surafel Temesgen wrote: >> >> >> >> On Tue, Jan 26, 2021 at 2:33 PM Vik Fearing wrote: >>> >>> I'm still in the weeds of reviewing this patch, but wh

Re: Enhance traceability of wal_level changes for backup management

2021-07-14 Thread vignesh C
On Thu, Jan 28, 2021 at 6:14 AM osumi.takami...@fujitsu.com wrote: > > Hello > > > On Thursday, January 21, 2021 11:19 PM I wrote: > > If no one disagree with it, I'll proceed with (1) below. > > > > (1) writing the time or LSN in the control file to indicate when/where > > wal_level > > is chang

Re: pg_rewind race condition just after promotion

2021-07-14 Thread Aleksander Alekseev
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, passed The v3 patch LGTM. I wonder if we should explicitly say in pg

Re: Toast compression method options

2021-07-14 Thread vignesh C
On Thu, May 6, 2021 at 7:24 PM Dilip Kumar wrote: > > On Mon, May 3, 2021 at 6:27 PM Dilip Kumar wrote: > > > > We have already pushed the configurable lz4 toast compression code[1]. > > In the custom compression thread, we were already having the patch to > > support the compression method optio

Re: [PATCH] Finally split StdRdOptions into HeapOptions and ToastOptions

2021-07-14 Thread vignesh C
On Sun, Sep 13, 2020 at 9:34 PM Nikolay Shaplov wrote: > > В письме от понедельник, 20 июля 2020 г. 18:36:44 MSK пользователь Georgios > Kokolatos написал: > > Hi! Sorry for really long delay, I was at my summer vacations, and then has > urgent things to finish first. :-( Now I hope we can continu

Re: Polyphase merge is obsolete

2021-07-14 Thread vignesh C
On Sat, Jan 23, 2021 at 3:49 AM Heikki Linnakangas wrote: > > On 22/10/2020 14:48, Heikki Linnakangas wrote: > > On 11/09/2017 13:37, Tomas Vondra wrote: > >> I planned to do some benchmarking on this patch, but apparently the > >> patch no longer applies. Rebase please? > > > > Here's a rebase of

Re: ResourceOwner refactoring

2021-07-14 Thread vignesh C
On Tue, Mar 9, 2021 at 6:10 PM Heikki Linnakangas wrote: > > On 08/03/2021 18:47, Ibrar Ahmed wrote: > > The patchset does not apply successfully, there are some hunk failures. > > > > http://cfbot.cputube.org/patch_32_2834.log > > > > > > v6-0002-Make-

SI messages sent when excuting ROLLBACK PREPARED command

2021-07-14 Thread liuhuail...@fujitsu.com
Hi When reading the code FinishPreparedTransaction, I found that SI messages are sent when executing ROLLBACK PREPARED command. But according to AtEOXact_Inval function, we send the SI messages only when committing the transaction . So, I think we needn't send SI messags when rollbacking the

Re: logical replication empty transactions

2021-07-14 Thread Ajin Cherian
On Thu, May 27, 2021 at 8:58 PM vignesh C wrote: > Thanks for the updated patch, few comments: > 1) I'm not sure if we could add some tests for skip empty > transactions, if possible add a few tests. > Added a few tests for prepared transactions as well as the existing test in 020_messages.pl als

Re: 回复:Re: Cache relation sizes?

2021-07-14 Thread Anastasia Lubennikova
On Wed, Jun 16, 2021 at 9:24 AM Thomas Munro wrote: > No change yet, just posting a rebase to keep cfbot happy. > > Hi, Thomas I think that the proposed feature is pretty cool not only because it fixes some old issues with lseek() performance and reliability, but also because it opens the door t

Re: row filtering for logical replication

2021-07-14 Thread Amit Kapila
On Wed, Jul 14, 2021 at 3:58 PM Tomas Vondra wrote: > > On 7/14/21 7:39 AM, Amit Kapila wrote: > > On Wed, Jul 14, 2021 at 6:28 AM Euler Taveira wrote: > >> > >> On Tue, Jul 13, 2021, at 6:06 PM, Alvaro Herrera wrote: > >> > >> 1. if you use REPLICA IDENTITY FULL, then the expressions would work

RE: Added schema level support for publication.

2021-07-14 Thread houzj.f...@fujitsu.com
Wednesday, July 14, 2021 6:17 PM vignesh C wrote: > On Tue, Jul 13, 2021 at 12:06 PM tanghy.f...@fujitsu.com > wrote: > > > > On Monday, July 12, 2021 5:36 PM vignesh C wrote: > > > > > > Thanks for reporting this issue, this issue is fixed in the v10 > > > patch attached at [1]. > > > [1] - htt

Re: [PATCH] Hooks at XactCommand level

2021-07-14 Thread Gilles Darold
Hi, I have renamed the patch and the title of this proposal registered in the commitfest "Xact/SubXact event callback at command start" to reflect the last changes that do not include new hooks anymore. Here is the new description corresponding to the current patch. This patch allow to ex

Re: [PATCH] Partial foreign key updates in referential integrity triggers

2021-07-14 Thread Peter Eisentraut
On 05.01.21 22:40, Paul Martinez wrote: I've created a patch to better support referential integrity constraints when using composite primary and foreign keys. This patch allows creating a foreign key using the syntax: FOREIGN KEY (tenant_id, fk_id) REFERENCES fktable ON DELETE SET NULL (fk

Re: Toast compression method options

2021-07-14 Thread Dilip Kumar
On Tue, Jun 22, 2021 at 1:37 PM Michael Paquier wrote: > > On Tue, Jun 22, 2021 at 11:05:22AM +0530, Dilip Kumar wrote: > > IMHO there is certainly a use case, basically, if we compress the data > > so that we can avoid storing it externally. Now suppose for some > > data, with default LZ4 compre

Re: row filtering for logical replication

2021-07-14 Thread Alvaro Herrera
On 2021-Jul-14, Dilip Kumar wrote: > I think for insert we are only allowing those rows to replicate which > are matching filter conditions, so if we updating any row then also we > should maintain that sanity right? That means at least on the NEW rows > we should apply the filter, IMHO. Said tha

Re: Unused function parameter in get_qual_from_partbound()

2021-07-14 Thread John Naylor
On Mon, Jul 12, 2021 at 8:46 AM John Naylor wrote: > > On Tue, Jun 8, 2021 at 10:50 PM Michael Paquier wrote: > > > > At first glance, this looked to me like breaking something just for > > sake of breaking it, but removing the rel argument could be helpful > > to simplify any external code calli

Re: ResourceOwner refactoring

2021-07-14 Thread Alvaro Herrera
On 2021-Jul-14, vignesh C wrote: > On Tue, Mar 9, 2021 at 6:10 PM Heikki Linnakangas wrote: > > Here you go. > > The patch does not apply on Head anymore, could you rebase and post a > patch. I'm changing the status to "Waiting for Author". Support for hmac was added by e6bdfd9700eb so the reb

Re: Introduce pg_receivewal gzip compression tests

2021-07-14 Thread gkokolatos
‐‐‐ Original Message ‐‐‐ On Wednesday, July 14th, 2021 at 04:17, Michael Paquier wrote: > On Tue, Jul 13, 2021 at 11:16:06AM +, gkokola...@pm.me wrote: > > Agreed. For the record that is why I said v6 :) > Okay, thanks. Please find v6 attached. Cheers, //Georgios >

Re: row filtering for logical replication

2021-07-14 Thread Tomas Vondra
On 7/14/21 4:01 PM, Alvaro Herrera wrote: On 2021-Jul-14, Dilip Kumar wrote: I think for insert we are only allowing those rows to replicate which are matching filter conditions, so if we updating any row then also we should maintain that sanity right? That means at least on the NEW rows we

Re: row filtering for logical replication

2021-07-14 Thread Tomas Vondra
On 7/14/21 2:50 PM, Amit Kapila wrote: On Wed, Jul 14, 2021 at 3:58 PM Tomas Vondra wrote: On 7/14/21 7:39 AM, Amit Kapila wrote: On Wed, Jul 14, 2021 at 6:28 AM Euler Taveira wrote: On Tue, Jul 13, 2021, at 6:06 PM, Alvaro Herrera wrote: 1. if you use REPLICA IDENTITY FULL, then the expr

Re: ResourceOwner refactoring

2021-07-14 Thread Heikki Linnakangas
On 14/07/2021 17:07, Alvaro Herrera wrote: On 2021-Jul-14, vignesh C wrote: On Tue, Mar 9, 2021 at 6:10 PM Heikki Linnakangas wrote: Here you go. The patch does not apply on Head anymore, could you rebase and post a patch. I'm changing the status to "Waiting for Author". Support for hma

Re: row filtering for logical replication

2021-07-14 Thread Dilip Kumar
On Wed, Jul 14, 2021 at 8:04 PM Tomas Vondra wrote: > > Perhaps the best way forward is to stick to the approach that INSERT > uses new, DELETE uses old and UPDATE works as DELETE+INSERT (probably), > and leave anything fancier (like being able to reference both versions > of the row) for a futur

Re: row filtering for logical replication

2021-07-14 Thread Alvaro Herrera
On 2021-Jul-14, Tomas Vondra wrote: > The way I'm thinking about this is that for INSERT and DELETE it's clear > which row version should be used (because there's just one). And for UPDATE > we could see that as DELETE + INSERT, and apply the same rule to each > action. > > On the other hand, I c

Re: row filtering for logical replication

2021-07-14 Thread Tomas Vondra
On 7/14/21 4:48 PM, Dilip Kumar wrote: On Wed, Jul 14, 2021 at 8:04 PM Tomas Vondra wrote: Perhaps the best way forward is to stick to the approach that INSERT uses new, DELETE uses old and UPDATE works as DELETE+INSERT (probably), and leave anything fancier (like being able to reference

Re: Extending amcheck to check toast size and compression

2021-07-14 Thread Mark Dilger
> On Jul 14, 2021, at 3:33 AM, Heikki Linnakangas wrote: > >> +/* The largest valid toast va_rawsize */ >> +#define VARLENA_SIZE_LIMIT 0x3FFF >> + > > Hmm, a toasted datum cannot be larger than MaxAllocSize, because it's > reconstituted in a palloc'd datum, right? No datum size exceeds

Re: Incorrect usage of strtol, atoi for non-numeric junk inputs

2021-07-14 Thread Alvaro Herrera
On 2021-Jul-14, Kyotaro Horiguchi wrote: > > > pg_log_error("extra_float_digits must be in range > > > -15..3"); > > > exit_nicely(1); > > > > Should we take this occasion to reduce the burden of translators and > > reword that as "%s must be in range %d

Re: Polyphase merge is obsolete

2021-07-14 Thread Heikki Linnakangas
On 14/07/2021 15:12, vignesh C wrote: On Sat, Jan 23, 2021 at 3:49 AM Heikki Linnakangas wrote: Here's an updated version that fixes one bug: The CFBot was reporting a failure on the FreeBSD system [1]. It turned out to be an out-of-memory issue caused by an underflow bug in the calculation of

Re: row filtering for logical replication

2021-07-14 Thread Tomas Vondra
On 7/14/21 4:52 PM, Alvaro Herrera wrote: On 2021-Jul-14, Tomas Vondra wrote: The way I'm thinking about this is that for INSERT and DELETE it's clear which row version should be used (because there's just one). And for UPDATE we could see that as DELETE + INSERT, and apply the same rule to

Re: row filtering for logical replication

2021-07-14 Thread Alvaro Herrera
On 2021-Jul-14, Tomas Vondra wrote: > On 7/14/21 4:52 PM, Alvaro Herrera wrote: > > In any case, it seems to me that the condition expression should be > > scanned to see which columns are used in Vars (pull_varattnos?), and > > verify if those columns are in the REPLICA IDENTITY; and if they are

Re: ResourceOwner refactoring

2021-07-14 Thread Zhihong Yu
On Wed, Jul 14, 2021 at 7:40 AM Heikki Linnakangas wrote: > On 14/07/2021 17:07, Alvaro Herrera wrote: > > On 2021-Jul-14, vignesh C wrote: > > > >> On Tue, Mar 9, 2021 at 6:10 PM Heikki Linnakangas > wrote: > > > >>> Here you go. > >> > >> The patch does not apply on Head anymore, could you reb

Re: Avoid repeated PQfnumber() in pg_dump

2021-07-14 Thread Justin Pryzby
On Wed, Jul 14, 2021 at 08:54:32AM +, houzj.f...@fujitsu.com wrote: > Since PQfnumber() is not a cheap function, I think we'd better invoke > PQfnumber() out of the loop like the attatched patch. +1 Please add to the next CF -- Justin

Re: ResourceOwner refactoring

2021-07-14 Thread Heikki Linnakangas
Thanks for having a look! On 14/07/2021 18:18, Zhihong Yu wrote: For the loop over the hash: +       for (int idx = 0; idx < capacity; idx++)         { -           if (olditemsarr[i] != resarr->invalidval) -               ResourceArrayAdd(resarr, olditemsarr[i]); +           while (owner->hash

Re: ResourceOwner refactoring

2021-07-14 Thread Zhihong Yu
On Wed, Jul 14, 2021 at 8:26 AM Heikki Linnakangas wrote: > Thanks for having a look! > > On 14/07/2021 18:18, Zhihong Yu wrote: > > For the loop over the hash: > > > > + for (int idx = 0; idx < capacity; idx++) > > { > > - if (olditemsarr[i] != resarr->invalidval) > > -

Re: Extending amcheck to check toast size and compression

2021-07-14 Thread Mark Dilger
> On Jul 14, 2021, at 7:57 AM, Mark Dilger wrote: > > so no valid toast pointer should contain a va_rawsize field greater than > MaxAllocSize ... nor should any valid toast pointer contain a va_extinfo field encoding a va_extsize greater than va_rawsize - VARHDRSZ. Violations of either of

Re: libpq compression

2021-07-14 Thread vignesh C
On Wed, Jul 14, 2021 at 6:31 PM Daniil Zakhlystov wrote: > > **sorry for the noise, but I need to re-send the message because one of the > recipients is blocked on the pgsql-hackers for some reason** > > Hi! > > Done, the patch should apply to the current master now. > > Actually, I have an almos

Re: [PATCH] Allow multiple recursive self-references

2021-07-14 Thread vignesh C
On Wed, Mar 31, 2021 at 7:28 PM Denis Hirn wrote: > > Sorry, I didn't append the patch properly. The patch does not apply on Head anymore, could you rebase and post a patch. I'm changing the status to "Waiting for Author". Regards, Vignesh

Re: DROP INDEX CONCURRENTLY on partitioned index

2021-07-14 Thread vignesh C
On Wed, Oct 28, 2020 at 6:14 AM Justin Pryzby wrote: > > Forking this thread, since the existing CFs have been closed. > https://www.postgresql.org/message-id/flat/20200914143102.GX18552%40telsasoft.com#58b1056488451f8594b0f0ba40996afd > > On Mon, Sep 14, 2020 at 09:31:03AM -0500, Justin Pryzby wr

Re: [HACKERS] GSoC 2017: Foreign Key Arrays

2021-07-14 Thread vignesh C
On Tue, Mar 30, 2021 at 2:14 AM Mark Rofail wrote: > > Hey Alvaro > >> Yes, we should do that. > > I have attached v12 with more tests in “ src/test/regress/sql/gin.sql” > > Changelog: > - v12 (compatible with current master 2021/03/29, commit > 6d7a6feac48b1970c4cd127ee65d4c487acbb5e9) > * a

Re: Implementing Incremental View Maintenance

2021-07-14 Thread vignesh C
On Mon, May 17, 2021 at 10:08 AM Yugo NAGATA wrote: > > On Fri, 7 May 2021 14:14:16 +0900 > Yugo NAGATA wrote: > > > On Mon, 26 Apr 2021 16:03:48 +0900 > > Yugo NAGATA wrote: > > > > > On Mon, 26 Apr 2021 15:46:21 +0900 > > > Yugo NAGATA wrote: > > > > > > > On Tue, 20 Apr 2021 09:51:34 +0900 >

Re: Make Append Cost aware of some run time partition prune case

2021-07-14 Thread vignesh C
On Thu, Mar 4, 2021 at 9:51 AM Andy Fan wrote: > > >> >> I have implemented a new one, which only handles 1 level of partitioned >> table, and >> only 1 partition key. and only handle the eq operators like partkey = $1 / >> partkey in ($1, $2) >> / parkey = $1 or partkey = $2; The patch works

Re: Have I found an interval arithmetic bug?

2021-07-14 Thread Zhihong Yu
On Thu, Jul 8, 2021 at 10:22 AM Zhihong Yu wrote: > > > On Wed, Jun 30, 2021 at 9:35 AM Bruce Momjian wrote: > >> On Tue, Jun 29, 2021 at 06:49:45PM +0200, Daniel Gustafsson wrote: >> > > On 29 Jun 2021, at 18:50, Zhihong Yu wrote: >> > >> > > Now that PG 15 is open for commit, do you think the

Re: [PATCH] New default role allowing to change per-role/database settings

2021-07-14 Thread vignesh C
On Wed, Apr 7, 2021 at 5:23 PM Michael Banck wrote: > > Hi, > > Am Dienstag, den 06.04.2021, 15:37 +0200 schrieb Michael Banck: > > Am Montag, den 05.04.2021, 14:33 -0400 schrieb Stephen Frost: > > > Should drop the 'DEFAULT_' to match the others since the rename to > > > 'predefined' roles went i

Re: Reduce the number of special cases to build contrib modules on windows

2021-07-14 Thread vignesh C
On Mon, Apr 19, 2021 at 5:18 PM David Rowley wrote: > > On Wed, 3 Mar 2021 at 22:37, David Rowley wrote: > > I've attached a rebased patch. > > I've rebased this again. > > I also moved away from using hash tables for storing references and > libraries. I was having some problems getting psql to

Re: Release SPI plans for referential integrity with DISCARD ALL

2021-07-14 Thread vignesh C
On Wed, Mar 10, 2021 at 1:49 PM yuzuko wrote: > > Hello, > > I thought about this suggestion again. > > Amit's patch suggested in the thread [1] can eliminate SPI plans from > INSERT/UPDATE triggers, so our memory pressure issue would be solved. > But as far as I can see that thread, Amit's patch

Re: [HACKERS] GSoC 2017: Foreign Key Arrays

2021-07-14 Thread Alvaro Herrera
On 2021-Jul-14, vignesh C wrote: > The patch does not apply on Head anymore, could you rebase and post a > patch. I'm changing the status to "Waiting for Author". BTW I gave a look at this patch in the March commitfest and concluded it still requires some major surgery that I didn't have time for

Re: storing an explicit nonce

2021-07-14 Thread vignesh C
On Sat, Jun 26, 2021 at 2:52 AM Bruce Momjian wrote: > > On Wed, May 26, 2021 at 05:02:01PM -0400, Bruce Momjian wrote: > > For these reasons, if we decide to go in the direction of using a > > non-LSN nonce, I no longer plan to continue working on this feature. I > > would rather work on things t

Re: VACUUM (DISABLE_PAGE_SKIPPING on)

2021-07-14 Thread vignesh C
On Thu, Apr 8, 2021 at 11:40 PM Simon Riggs wrote: > > On Thu, 8 Apr 2021 at 18:15, Alvaro Herrera wrote: > > > > On 2021-Apr-08, Simon Riggs wrote: > > > > > On Thu, 8 Apr 2021 at 16:58, David Steele wrote: > > > > > > It's not clear to me which patch is which, so perhaps move one CF entry > >

Re: printf %s with NULL pointer (was Re: BUG #17098: Assert failed on composing an error message when adding a type to an extension being dropped)

2021-07-14 Thread Tom Lane
Peter Eisentraut writes: > In this particular case, I would for example be quite curious how those > alternative minimal C libraries such as musl-libc handle this. Interesting question, so I took a look: https://git.musl-libc.org/cgit/musl/tree/src/stdio/vfprintf.c#n593 cas

Re: row filtering for logical replication

2021-07-14 Thread Euler Taveira
On Wed, Jul 14, 2021, at 11:48 AM, Dilip Kumar wrote: > On Wed, Jul 14, 2021 at 8:04 PM Tomas Vondra > wrote: > > > > > Perhaps the best way forward is to stick to the approach that INSERT > > uses new, DELETE uses old and UPDATE works as DELETE+INSERT (probably), > > and leave anything fancier (

Re: printf %s with NULL pointer (was Re: BUG #17098: Assert failed on composing an error message when adding a type to an extension being dropped)

2021-07-14 Thread Tom Lane
I wrote: > Interesting question, so I took a look: > https://git.musl-libc.org/cgit/musl/tree/src/stdio/vfprintf.c#n593 > case 's': > a = arg.p ? arg.p : "(null)"; BTW, the adjacent code shows that musl is also supporting glibc's "%m" extension, so I imagi

free C string

2021-07-14 Thread Zhihong Yu
Hi, I was looking at fmgr_internal_validator(). It seems prosrc is only used internally. The patch frees the C string prosrc points to, prior to returning. Please take a look. Thanks free-c-str.patch Description: Binary data

Re: free C string

2021-07-14 Thread Tom Lane
Zhihong Yu writes: > I was looking at fmgr_internal_validator(). > It seems prosrc is only used internally. > The patch frees the C string prosrc points to, prior to returning. There's really very little point in adding such code. Our memory context mechanisms take care of minor leaks like this,

Re: row filtering for logical replication

2021-07-14 Thread Euler Taveira
On Wed, Jul 14, 2021, at 12:08 PM, Tomas Vondra wrote: > Yeah, but AFAIK that's needed only when replicating DELETEs, so perhaps > we could ignore this for subscriptions without DELETE. ... and UPDATE. It seems we have a consensus to use old row in the row filter for UPDATEs. I think you meant pub

Re: SI messages sent when excuting ROLLBACK PREPARED command

2021-07-14 Thread Tom Lane
"liuhuail...@fujitsu.com" writes: > So, I think we needn't send SI messags when rollbacking the two-phase > transaction. > Or Does it has something special because of two-phase transaction? Hmmm, yeah, I think you're right. It probably doesn't make a big difference in the real world --- anyone

Re: [PATCH] Use optimized single-datum tuplesort in ExecSort

2021-07-14 Thread Ranier Vilela
Em qua., 14 de jul. de 2021 às 07:14, David Rowley escreveu: > On Tue, 13 Jul 2021 at 15:15, David Rowley wrote: > > In theory, we likely could get rid of the small regression by having > > two versions of ExecSort() and setting the correct one during > > ExecInitSort() by setting the function p

Re: Replacing pg_depend PIN entries with a fixed range check

2021-07-14 Thread John Naylor
On Thu, May 27, 2021 at 6:53 PM Tom Lane wrote: > Attached is a rebase over a4390abec. Looks good to me overall, I just had a couple questions/comments: isObjectPinned and isSharedObjectPinned are now thin wrappers around IsPinnedObject. Is keeping those functions a matter of future-proofing in

Re: CREATE TABLE .. PARTITION OF fails to preserve tgenabled for inherited row triggers

2021-07-14 Thread Alvaro Herrera
On 2020-Oct-27, Justin Pryzby wrote: > I think either way could be ok - if you assume that the trigger was disabled > with ONLY, then it'd make sense to restore it with ONLY, but I think it's at > least as common to ALTER TABLE [*]. It might look weird to the user if they > used ALTER TABLE ONLY

Re: [HACKERS] Preserving param location

2021-07-14 Thread Tom Lane
Julien Rouhaud writes: > On Tue, Jul 13, 2021 at 07:01:24PM -0400, Tom Lane wrote: >> So I'm not really convinced that there's a fully-baked use case >> here, and would like more detail about how you hope to use the >> location value. > As I said I have no doubt that there are other cases which a

Remove redundant Assert(PgArchPID == 0); in PostmasterStateMachine

2021-07-14 Thread Bharath Rupireddy
Hi, It looks like the commit d75288fb [1] added an unnecessary Assert(PgArchPID == 0); in PostmasterStateMachine as the if block code gets hit only when PgArchPID == 0. PSA small patch. [1] commit d75288fb27b8fe0a926aaab7d75816f091ecdc27 Author: Fujii Masao Date: Mon Mar 15 13:13:14 2021 +0900

Re: PROXY protocol support

2021-07-14 Thread Jacob Champion
On Mon, 2021-07-12 at 18:28 +0200, Magnus Hagander wrote: > Yeah, I have no problem being stricter than necessary, unless that > actually causes any interop problems. It's a lot worse to not be > strict enough.. Agreed. Haven't heard back from the HAProxy mailing list yet, so staying strict seems

Re: free C string

2021-07-14 Thread Zhihong Yu
On Wed, Jul 14, 2021 at 10:17 AM Tom Lane wrote: > Zhihong Yu writes: > > I was looking at fmgr_internal_validator(). > > It seems prosrc is only used internally. > > The patch frees the C string prosrc points to, prior to returning. > > There's really very little point in adding such code. Our

Re: row filtering for logical replication

2021-07-14 Thread Euler Taveira
On Wed, Jul 14, 2021, at 8:21 AM, Greg Nancarrow wrote: > Some minor v19 patch review points you might consider for your next > patch version: Greg, thanks for another review. I agree with all of these changes. It will be in the next patch. -- Euler Taveira EDB https://www.enterprisedb.com/

Re: CREATE TABLE .. PARTITION OF fails to preserve tgenabled for inherited row triggers

2021-07-14 Thread Zhihong Yu
On Wed, Jul 14, 2021 at 11:02 AM Alvaro Herrera wrote: > On 2020-Oct-27, Justin Pryzby wrote: > > > I think either way could be ok - if you assume that the trigger was > disabled > > with ONLY, then it'd make sense to restore it with ONLY, but I think > it's at > > least as common to ALTER TABLE

pg_upgrade does not upgrade pg_stat_statements properly

2021-07-14 Thread Dave Cramer
Upgrading from 10.5 to 13.3 using pg_upgrade -k The following is the result of an upgrade select * from pg_extension ; oid | extname | extowner | extnamespace | extrelocatable | extversion | extconfig | extcondition ---++--+--+

Re: pg_upgrade does not upgrade pg_stat_statements properly

2021-07-14 Thread David G. Johnston
On Wednesday, July 14, 2021, Dave Cramer wrote: > > > Notice the upgraded version is 1.5 and the new version is 1.8 > > I would think somewhere in the upgrade of the schema there should have > been a create extension pg_stat_statements ? > That would be a faulty assumption. Modules do not get u

Re: pg_upgrade does not upgrade pg_stat_statements properly

2021-07-14 Thread Dave Cramer
On Wed, 14 Jul 2021 at 14:47, David G. Johnston wrote: > On Wednesday, July 14, 2021, Dave Cramer wrote: > >> >> >> Notice the upgraded version is 1.5 and the new version is 1.8 >> >> I would think somewhere in the upgrade of the schema there should have >> been a create extension pg_stat_statem

Re: pg_upgrade does not upgrade pg_stat_statements properly

2021-07-14 Thread David G. Johnston
On Wed, Jul 14, 2021 at 11:59 AM Dave Cramer wrote: > > > On Wed, 14 Jul 2021 at 14:47, David G. Johnston < > david.g.johns...@gmail.com> wrote: > >> On Wednesday, July 14, 2021, Dave Cramer wrote: >> >>> >>> >>> Notice the upgraded version is 1.5 and the new version is 1.8 >>> >>> I would think

Re: BUG #16583: merge join on tables with different DB collation behind postgres_fdw fails

2021-07-14 Thread Ibrar Ahmed
On Wed, Jul 14, 2021 at 1:41 AM Tom Lane wrote: > Ibrar Ahmed writes: > > The patch is failing the regression, @Tom Lane can > you > > please take a look at that. > > Seems to just need an update of the expected-file to account for test > cases added recently. (I take no position on whether th

Re: pg_upgrade does not upgrade pg_stat_statements properly

2021-07-14 Thread Dave Cramer
On Wed, 14 Jul 2021 at 15:09, David G. Johnston wrote: > On Wed, Jul 14, 2021 at 11:59 AM Dave Cramer wrote: > >> >> >> On Wed, 14 Jul 2021 at 14:47, David G. Johnston < >> david.g.johns...@gmail.com> wrote: >> >>> On Wednesday, July 14, 2021, Dave Cramer wrote: >>> Notice the up

Re: [PATCH] Hooks at XactCommand level

2021-07-14 Thread Tom Lane
Gilles Darold writes: > I have renamed the patch and the title of this proposal registered in > the commitfest "Xact/SubXact event callback at command start" to reflect > the last changes that do not include new hooks anymore. Hmm, it doesn't seem like this has addressed my concern at all. The

Re: pg_upgrade does not upgrade pg_stat_statements properly

2021-07-14 Thread David G. Johnston
On Wed, Jul 14, 2021 at 12:21 PM Dave Cramer wrote: > > On Wed, 14 Jul 2021 at 15:09, David G. Johnston < > david.g.johns...@gmail.com> wrote: > >> >> Something like, "... because the installed extensions will be copied from >> the old cluster during the upgrade." >> > > This is still rather opaq

Re: Replacing pg_depend PIN entries with a fixed range check

2021-07-14 Thread Tom Lane
John Naylor writes: > On Thu, May 27, 2021 at 6:53 PM Tom Lane wrote: >> Attached is a rebase over a4390abec. > Looks good to me overall, I just had a couple questions/comments: Thanks for looking! > isObjectPinned and isSharedObjectPinned are now thin wrappers around > IsPinnedObject. Is keep

Re: [PATCH] Partial foreign key updates in referential integrity triggers

2021-07-14 Thread Ibrar Ahmed
On Wed, Jul 14, 2021 at 6:51 PM Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote: > > On 05.01.21 22:40, Paul Martinez wrote: > > I've created a patch to better support referential integrity constraints > when > > using composite primary and foreign keys. This patch allows creating a >

  1   2   >