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-13 Thread Laurenz Albe
On Tue, 2021-07-13 at 14:26 -0400, Tom Lane wrote: > Did you see my followup? The vast majority of live systems do not do > that, so we are accomplishing nothing of value by insisting it's a > crash-worthy bug. > > I flat out don't agree that "crash on debug builds but it's okay on > production"

Re: row filtering for logical replication

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

Re: [PATCH] document

2021-07-13 Thread Laurenz Albe
On Wed, 2021-07-14 at 14:43 +0900, Ian Lawrence Barwick wrote: > 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 >

Re: [PATCH] psql: \dn+ to show size of each schema..

2021-07-13 Thread Pavel Stehule
st 14. 7. 2021 v 7:42 odesílatel Laurenz Albe napsal: > On Wed, 2021-07-14 at 14:05 +0900, Ian Lawrence Barwick wrote: > > 2021年7月14日(水) 12:07 Justin Pryzby : > > > \db+ and \l+ show sizes of tablespaces and databases, so I was > surprised in the > > > past that \dn+ didn't show sizes of

[PATCH] document

2021-07-13 Thread 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 probably not a burning issue, but it seems not entirely

Re: [PATCH] psql: \dn+ to show size of each schema..

2021-07-13 Thread Laurenz Albe
On Wed, 2021-07-14 at 14:05 +0900, Ian Lawrence Barwick wrote: > 2021年7月14日(水) 12:07 Justin Pryzby : > > \db+ and \l+ show sizes of tablespaces and databases, so I was surprised in > > the > > past that \dn+ didn't show sizes of schemas. I would find that somewhat > > convenient, and I assume

Re: row filtering for logical replication

2021-07-13 Thread Amit Kapila
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 > reasonable to test for this in the code

Re: [PATCH] improve the pg_upgrade error message

2021-07-13 Thread Suraj Kharage
Thanks Jeevan for working on this. Overall patch looks good to me. + pg_fatal("All non-template0 databases must allow connections, i.e. their\n" + "pg_database.datallowconn must be true. Your installation contains\n" + "non-template0 databases with their pg_database.datallowconn set to\n" +

Re: [PATCH] psql: \dn+ to show size of each schema..

2021-07-13 Thread Ian Lawrence Barwick
Hi 2021年7月14日(水) 12:07 Justin Pryzby : > > \db+ and \l+ show sizes of tablespaces and databases, so I was surprised in > the > past that \dn+ didn't show sizes of schemas. I would find that somewhat > convenient, and I assume other people would use it even more useful. It's something which

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

2021-07-13 Thread Pavel Stehule
Hi > You're right- no one followed up on that. Instead, one group continues > to push for 'simple' and to just accept what's been proposed, while > another group counters that we should be looking at the broader design > question and work towards a solution which will work for us down the >

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

2021-07-13 Thread Peter Eisentraut
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, user id, query id and whether it's a top level statement or not"?

Re: Detecting File Damage & Inconsistencies

2021-07-13 Thread Amit Kapila
On Tue, Jul 13, 2021 at 8:29 PM Simon Riggs wrote: > > On Tue, Jul 6, 2021 at 4:21 AM Amit Kapila wrote: > > > > > > > > > If you don't think the sorts of use cases I presented are worth the > > > > trouble that's fair enough. I'm not against adding it on the commit > > > > record. It's just

[PATCH] psql: \dn+ to show size of each schema..

2021-07-13 Thread Justin Pryzby
\db+ and \l+ show sizes of tablespaces and databases, so I was surprised in the past that \dn+ didn't show sizes of schemas. I would find that somewhat convenient, and I assume other people would use it even more useful. \db+ and \l+ seem to walk the filesystem, and this is distinguished from

Re: [Proposal] Global temporary tables

2021-07-13 Thread Ming Li
Hi Wenjing, Some suggestions may help: 1) It seems that no test case covers the below scenario: 2 sessions attach the same gtt, and insert/update/select concurrently. It is better to use the test framework in src/test/isolation like the code changes in https://commitfest.postgresql.org/24/2233/.

Re: Introduce pg_receivewal gzip compression tests

2021-07-13 Thread Michael Paquier
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. -- Michael signature.asc Description: PGP signature

RE: Partition Check not updated when insert into a partition

2021-07-13 Thread houzj.f...@fujitsu.com
On Tuesday, July 13, 2021 2:52 AM Alvaro Herrera wrote: > On 2021-Jun-23, houzj.f...@fujitsu.com wrote: > > > For a multi-level partition, for example: table 'A' is partition of > > table 'B', and 'B' is also partition of table 'C'. After I 'ALTER > > TABLE C DETACH B', I thought partition

Re: Add proper planner support for ORDER BY / DISTINCT aggregates

2021-07-13 Thread Ranier Vilela
Em ter., 13 de jul. de 2021 às 22:15, David Rowley escreveu: > On Tue, 13 Jul 2021 at 23:45, Ranier Vilela wrote: > > The question not answered is if *argno* can '>=' that > pertrans->numTransInputs, > > before entering the loop? > > If *can*, the loop might be useless in that case. > > > >> >

Re: [PATCH] Pull general SASL framework out of SCRAM

2021-07-13 Thread Michael Paquier
On Tue, Jul 13, 2021 at 10:41:01PM +, Jacob Champion wrote: > Just to make sure -- do we want to export the fe-auth-sasl.h header as > opposed to forward-declaring the pg_fe_sasl_mech struct? Installing fe-auth-sasl.h has the advantage to make the internals of the callbacks available to

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

2021-07-13 Thread Kyotaro Horiguchi
Thanks for the discussion. At Tue, 13 Jul 2021 09:28:30 +0900, Michael Paquier wrote in > On Fri, Jul 09, 2021 at 04:50:28PM +0900, Kyotaro Horiguchi wrote: > > At Fri, 9 Jul 2021 10:29:07 +0900, Michael Paquier > > wrote in > >> Er, wait. We've actually allowed negative values for pg_ctl

Re: Add proper planner support for ORDER BY / DISTINCT aggregates

2021-07-13 Thread David Rowley
On Tue, 13 Jul 2021 at 23:45, Ranier Vilela wrote: > The question not answered is if *argno* can '>=' that > pertrans->numTransInputs, > before entering the loop? > If *can*, the loop might be useless in that case. > >> >> >> Note that we're doing argno++ inside the loop. > > Another question

Re: row filtering for logical replication

2021-07-13 Thread Euler Taveira
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 > reasonable to test for this in the code and raise an error if the > expression requires a column

Re: enable_resultcache confusion

2021-07-13 Thread David Rowley
On Tue, 13 Jul 2021 at 12:01, David Rowley wrote: > I plan on pushing the patch to master and PG14 in 24 hours time. If > anyone is still on the fence or wishes to object to the name, please > let it be known before then. Renaming complete. Result Cache is gone. Welcome Memoize. David

Re: Remove repeated calls to PQserverVersion

2021-07-13 Thread Alvaro Herrera
On 2021-Jul-14, Peter Smith wrote: > But I never made any claims about performance; my motivation for this > trivial patch was more like just "code tidy" or "refactor", so > applying performance as the only worthiness criteria for a "code tidy" > patch seemed like a misrepresentation here. > >

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

2021-07-13 Thread Stephen Frost
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 with the flexibility that we have

Re: Remove repeated calls to PQserverVersion

2021-07-13 Thread Peter Smith
On Wed, Jul 14, 2021 at 12:15 AM Tom Lane wrote: > > Michael Paquier writes: > > On Tue, Jul 13, 2021 at 07:02:27PM +1000, Peter Smith wrote: > >> I found a few functions making unnecessary repeated calls to > >> PQserverVersion(conn); instead of just calling once and assigning to a > >> local

Re: [PATCH] Pull general SASL framework out of SCRAM

2021-07-13 Thread Jacob Champion
On Tue, 2021-07-13 at 22:41 +, Jacob Champion wrote: > On Tue, 2021-07-13 at 19:31 +0900, Michael Paquier wrote: > > On Tue, Jul 13, 2021 at 12:41:27PM +0300, Mikhail Kulagin wrote: > > > > > > I think the new fe-auth-sasl.h file should be installed too. > > > Correction proposal in the

Re: [HACKERS] Preserving param location

2021-07-13 Thread Tom Lane
Julien Rouhaud writes: > On Sun, Jun 27, 2021 at 11:31:53AM +0800, Julien Rouhaud wrote: >> On Sat, Mar 11, 2017 at 11:09:32PM +0100, Julien Rouhaud wrote: >>> When a query contains parameters, the original param node contains the token >>> location. However, this information is lost when the

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

2021-07-13 Thread Alvaro Herrera
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 with the flexibility that we have in what we support for object > names, That's fine. If people want

Re: [PATCH] Pull general SASL framework out of SCRAM

2021-07-13 Thread Jacob Champion
On Tue, 2021-07-13 at 19:31 +0900, Michael Paquier wrote: > On Tue, Jul 13, 2021 at 12:41:27PM +0300, Mikhail Kulagin wrote: > > I got an error while building one of the extensions. > > /home/mkulagin/pg-install/postgresql-master/include/internal/libpq-int.h:44:10: > > fatal error:

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

2021-07-13 Thread Stephen Frost
Greetings, * Tomas Vondra (tomas.von...@enterprisedb.com) wrote: > On 7/13/21 10:55 PM, Stephen Frost wrote: > >On Tue, Jul 13, 2021 at 16:44 Daniel Gustafsson >> wrote: > > > > > On 13 Jul 2021, at 18:14, Tomas Vondra > > >

Re: psql - factor out echo code

2021-07-13 Thread Tom Lane
Fabien COELHO writes: > 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. We didn't have anything like that level of detail before, and there has been no field demand

Re: closing heap relation

2021-07-13 Thread Zhihong Yu
Hi, On Tue, Jul 13, 2021 at 3:13 PM Zhihong Yu wrote: > Hi, > I was looking at index_drop() in PG 11 branch. > In if (concurrent)block, the heap and index relations are overwritten > since they were opened a few lines above the concurrent check. > > Shouldn't the two relations be closed first ?

closing heap relation

2021-07-13 Thread Zhihong Yu
Hi, I was looking at index_drop() in PG 11 branch. In if (concurrent)block, the heap and index relations are overwritten since they were opened a few lines above the concurrent check. Shouldn't the two relations be closed first ? thanks diff --git a/src/backend/catalog/index.c

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

2021-07-13 Thread Tomas Vondra
On 7/13/21 10:55 PM, Stephen Frost wrote: Greetings, On Tue, Jul 13, 2021 at 16:44 Daniel Gustafsson > wrote: > On 13 Jul 2021, at 18:14, Tomas Vondra mailto:tomas.von...@enterprisedb.com>> wrote: > FWIW I don't understand why would they need to write

RE: Transactions involving multiple postgres foreign servers, take 2

2021-07-13 Thread r.takahash...@fujitsu.com
Hi, > Wouldn't it be better to explicitly initialize the pointer with NULL? Thank you for your advice. You are correct. Anyway, I fixed it and re-run the performance test, it of course does not affect tps. Regards, Ryohei Takahashi

Re: row filtering for logical replication

2021-07-13 Thread Alvaro Herrera
On 2021-Jul-13, Euler Taveira wrote: > + > + The WHERE clause should contain only columns that are > + part of the primary key or be covered by REPLICA > + IDENTITY otherwise, DELETE operations will > not > + be replicated. That's because old row is used and it only contains primary >

Re: row filtering for logical replication

2021-07-13 Thread Euler Taveira
On Tue, Jul 13, 2021, at 4:07 PM, 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: 8< > >> (c) the columns > >> referred to in the filter should be part of PK or Replica Identity. > > > > Why? > > > > I'm not sure either.

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

2021-07-13 Thread Stephen Frost
Greetings, On Tue, Jul 13, 2021 at 16:44 Daniel Gustafsson wrote: > > On 13 Jul 2021, at 18:14, Tomas Vondra > wrote: > > > FWIW I don't understand why would they need to write parsers. > > It's quite common to write unit tests for VM recipes/playbooks wheen using > tools like Chef etc,

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

2021-07-13 Thread Daniel Gustafsson
> On 13 Jul 2021, at 00:59, Alvaro Herrera wrote: > > On 2021-Jul-13, Tomas Vondra wrote: > >> I'm not going to fight against some sort of versioning, but I think keeping >> the scope as narrow as possible would make it unnecessary. That is, let's >> stick to the original goal to allow passing

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

2021-07-13 Thread Daniel Gustafsson
> On 13 Jul 2021, at 18:14, Tomas Vondra wrote: > FWIW I don't understand why would they need to write parsers. It's quite common to write unit tests for VM recipes/playbooks wheen using tools like Chef etc, parsing and checking the installed/generated files is part of that. This would be one

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

2021-07-13 Thread Tom Lane
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 the new results are desirable; some of these might be breaking

Re: row filtering for logical replication

2021-07-13 Thread Euler Taveira
On Sun, Jul 11, 2021, at 8:09 PM, Tomas Vondra wrote: > I took a look at this patch, which seems to be in CF since 2018. I have > only some basic comments and observations at this point: Tomas, thanks for reviewing this patch again. > 1) alter_publication.sgml > > I think "expression is

Re: row filtering for logical replication

2021-07-13 Thread Euler Taveira
On Tue, Jul 13, 2021, at 12:25 AM, Peter Smith wrote: > I have reviewed the latest v18 patch. Below are some more review > comments and patches. 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

Re: Reducing memory consumption for pending inval messages

2021-07-13 Thread Tom Lane
I wrote: > It turns out that the existing implementation in inval.c is quite > inefficient when a lot of individual commands each register just > a few invalidations --- but a few invalidations per command is > pretty typical. Per the cfbot, here's a rebase over 3788c6678 (actually just undoing

Re: row filtering for logical replication

2021-07-13 Thread Alvaro Herrera
On 2021-Jul-13, Tomas Vondra wrote: > On 7/13/21 5:44 PM, Jeff Davis wrote: > > * Andres also mentioned that the function should not leak memory. > > * One use case for this feature is when sharding a table, so the > > expression should allow things like "hashint8(x) between ...". I'd > > really

Re: row filtering for logical replication

2021-07-13 Thread Tomas Vondra
On 7/13/21 12:57 PM, Amit Kapila wrote: On Tue, Jul 13, 2021 at 10:24 AM Amit Kapila wrote: On Mon, Jul 12, 2021 at 3:01 PM Tomas Vondra wrote: In terms of implementation, I think there are two basic options - either we can define a new "expression" type in gram.y, which would be a subset

Re: row filtering for logical replication

2021-07-13 Thread Tomas Vondra
On 7/13/21 5:44 PM, Jeff Davis wrote: On Tue, 2021-07-13 at 10:24 +0530, Amit Kapila wrote: to do. AFAIU, the main things we want to prohibit in the filter are: (a) it doesn't refer to any relation other than catalog in where clause, Right, because the walsender is using a historical

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-13 Thread Ranier Vilela
Em ter., 13 de jul. de 2021 às 15:26, Tom Lane escreveu: > Ranier Vilela writes: > > Em ter., 13 de jul. de 2021 às 11:29, Tom Lane > escreveu: > >> I think you're missing my main point, which is that it seems certain > that > >> there are corner cases that do this *now*. I'm proposing that

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-13 Thread Tom Lane
Ranier Vilela writes: > Em ter., 13 de jul. de 2021 às 11:29, Tom Lane escreveu: >> I think you're missing my main point, which is that it seems certain that >> there are corner cases that do this *now*. I'm proposing that we redefine >> this as not being a crash case, full stop. > I agree

Re: proposal - psql - use pager for \watch command

2021-07-13 Thread Pavel Stehule
út 13. 7. 2021 v 19:50 odesílatel Tom Lane napsal: > Thomas Munro writes: > > Pushed, after retesting on macOS (with the fixed pspg that has by now > > arrived in MacPorts), FreeBSD and Linux. Thanks! > > After playing with this along the way to fixing the sigwait issues, > I have a

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-13 Thread Ranier Vilela
Em ter., 13 de jul. de 2021 às 11:29, Tom Lane escreveu: > Laurenz Albe writes: > > On Mon, 2021-07-12 at 13:20 -0400, Tom Lane wrote: > >> So my feeling about this is that switching snprintf.c's behavior > >> would produce some net gain in robustness for v12 and up, while > >> not making

Re: More time spending with "delete pending"

2021-07-13 Thread Alexander Lakhin
Hello Michael, 12.07.2021 08:52, Michael Paquier wrote: > On Mon, Jul 12, 2021 at 02:09:41PM +0900, Michael Paquier wrote: >> And fairywren, that uses MinGW, is unhappy: >> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=fairywren=2021-07-12%2004%3A47%3A13 >> Looking at it now. > I am not

Re: proposal - psql - use pager for \watch command

2021-07-13 Thread Tom Lane
Thomas Munro writes: > Pushed, after retesting on macOS (with the fixed pspg that has by now > arrived in MacPorts), FreeBSD and Linux. Thanks! After playing with this along the way to fixing the sigwait issues, I have a gripe/suggestion. If I hit control-C while the thing is waiting between

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

2021-07-13 Thread Ranier Vilela
Em ter., 13 de jul. de 2021 às 14:42, Ranier Vilela escreveu: > Em ter., 13 de jul. de 2021 às 09:44, Ranier Vilela > escreveu: > >> Em ter., 13 de jul. de 2021 às 09:24, David Rowley >> escreveu: >> >>> On Wed, 14 Jul 2021 at 00:06, Ranier Vilela wrote: >>> > >>> > Em ter., 13 de jul. de

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

2021-07-13 Thread Ranier Vilela
Em ter., 13 de jul. de 2021 às 09:44, Ranier Vilela escreveu: > Em ter., 13 de jul. de 2021 às 09:24, David Rowley > escreveu: > >> On Wed, 14 Jul 2021 at 00:06, Ranier Vilela wrote: >> > >> > Em ter., 13 de jul. de 2021 às 04:19, Ronan Dunklau < >> ronan.dunk...@aiven.io> escreveu: >> >> I

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-13 Thread Tom Lane
I wrote: > Now, what we don't have control of is what will happen in pre-v12 > branches on platforms where we use the system's *printf. However, > note what I wrote in the log for 0c62356cc: > Per commit e748e902d, we appear to have little or no coverage in the > buildfarm of machines

Re: Add option --drop-cascade for pg_dump/restore

2021-07-13 Thread Wu Haotian
> 2) I felt pg_dump will include the cascade option for plain format and > pg_restore will include the cascade option from pg_restore for other > formats. If my understanding is correct, should we document this? I may not understand it correctly, are you saying pg_dump will include the cascade

Re: row filtering for logical replication

2021-07-13 Thread Jeff Davis
On Tue, 2021-07-13 at 10:24 +0530, Amit Kapila wrote: > to do. AFAIU, the main things we want to prohibit in the filter are: > (a) it doesn't refer to any relation other than catalog in where > clause, Right, because the walsender is using a historical snapshot. > (b) it doesn't use UDFs in any

Re: DROP relation IF EXISTS Docs and Tests - Bug Fix

2021-07-13 Thread David G. Johnston
On Tue, Jul 13, 2021 at 3:30 AM Ibrar Ahmed wrote: > > > On Tue, Mar 9, 2021 at 9:01 PM David Steele wrote: > >> On 3/9/21 10:08 AM, David G. Johnston wrote: >> > >> > On Tuesday, March 9, 2021, David Steele > > > wrote: >> > >> > Further, I think we should close

Re: PG 14 release notes, first draft

2021-07-13 Thread Simon Riggs
On Fri, Jul 2, 2021 at 12:50 AM Bruce Momjian wrote: > > On Thu, Jul 1, 2021 at 03:13:30PM +0100, Simon Riggs wrote: > > On Wed, Jun 30, 2021 at 11:20 PM Bruce Momjian wrote: > > > > * "row expiration" is a term not currently used in PG docs, so we > > > > should probably look for something

Re: Printing backtrace of postgres processes

2021-07-13 Thread vignesh C
On Wed, May 12, 2021 at 2:27 AM Robert Haas wrote: > > On Thu, May 6, 2021 at 3:31 PM Tom Lane wrote: > > Andres Freund writes: > > > On 2021-05-06 14:56:09 -0400, Tom Lane wrote: > > >> If we think it's worth having a predefined role for, OK. However, > > >> I don't like the future I see us

Re: Bogus HAVE_DECL_FOO entries in msvc/Solution.pm

2021-07-13 Thread Peter Eisentraut
On 13.07.21 09:53, Michael Paquier wrote: I was thinking to just do the easiest move and fix this issue down to 13, not bothering about older branches :p Looking at the commit, a backpatch is not that complicated and it is possible to check the generation of pg_config.h on non-MSVC environments

Re: Detecting File Damage & Inconsistencies

2021-07-13 Thread Simon Riggs
On Tue, Jul 6, 2021 at 4:21 AM Amit Kapila wrote: > > On Fri, Jul 2, 2021 at 8:29 PM Simon Riggs > wrote: > > > > On Fri, Jul 2, 2021 at 5:34 AM Craig Ringer > > wrote: > > > > > > > > If you don't think the sorts of use cases I presented are worth the > > > trouble that's fair enough. I'm

Re: Column Filtering in Logical Replication

2021-07-13 Thread Rahila Syed
Hi Tomas, Thank you for your comments. > > > > > Currently, this capability is not included in the patch. If the table on > > the subscriber > > server has lesser attributes than that on the publisher server, it > > throws an error at the > > time of CREATE SUBSCRIPTION. > > > > That's a bit

Re: Enhanced error message to include hint messages for redundant options error

2021-07-13 Thread vignesh C
On Tue, Jul 13, 2021 at 4:25 PM Dean Rasheed wrote: > > On Mon, 12 Jul 2021 at 17:39, vignesh C wrote: > > > > Thanks for your comments, I have made the changes for the same in the > > V10 patch attached. > > Thoughts? > > > > I'm still not happy about changing so many error messages. > > Some

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-13 Thread Tom Lane
Laurenz Albe writes: > On Mon, 2021-07-12 at 13:20 -0400, Tom Lane wrote: >> So my feeling about this is that switching snprintf.c's behavior >> would produce some net gain in robustness for v12 and up, while >> not making things any worse for the older branches. I still hold >> to the opinion

Re: unnesting multirange data types

2021-07-13 Thread Alvaro Herrera
On 2021-Jul-13, Alexander Korotkov wrote: > > To be clear, do you mean with or without this hunk ? > > > > - oprrest => 'multirangesel', oprjoin => 'scalargtjoinsel' }, > > + oprrest => 'multirangesel', oprjoin => 'scalarltjoinsel' }, > > I mean with this hunk unless I hear objection to it.

Re: Add option --drop-cascade for pg_dump/restore

2021-07-13 Thread vignesh C
On Fri, Jul 2, 2021 at 12:11 PM Haotian Wu wrote: > > Hi, > > I agree that —drop-cascade does not make sense for pg_dumpall, so I removed > them. > > > are we expecting more things to appear after the semi-colon? > > No, I was just trying to “reuse” original statement as much as possible. >

Early Sort/Group resjunk column elimination.

2021-07-13 Thread Ronan Dunklau
Hello, I would like to know if there is any interest in working to reduce the usage and propagation of resjunk columns in the planner. I think this topic is worth investigating, because most of the time when we request a sorted path without ever needing the sort key afterwards, we still carry

Re: Remove repeated calls to PQserverVersion

2021-07-13 Thread Tom Lane
Michael Paquier writes: > On Tue, Jul 13, 2021 at 07:02:27PM +1000, Peter Smith wrote: >> I found a few functions making unnecessary repeated calls to >> PQserverVersion(conn); instead of just calling once and assigning to a >> local variable. > Does it really matter? PQserverVersion() does a

Re: unnesting multirange data types

2021-07-13 Thread Alexander Korotkov
On Tue, Jul 13, 2021 at 5:07 PM Justin Pryzby wrote: > On Tue, Jul 13, 2021 at 03:11:16PM +0300, Alexander Korotkov wrote: > > On Sun, Jul 11, 2021 at 1:20 AM Justin Pryzby wrote: > > > On Sun, Jul 11, 2021 at 01:00:27AM +0300, Alexander Korotkov wrote: > > > > On Sat, Jul 10, 2021 at 7:34 PM

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

2021-07-13 Thread Tomas Vondra
On 7/13/21 3:40 PM, Stephen Frost wrote: Greetings, * Tom Lane (t...@sss.pgh.pa.us) wrote: Alvaro Herrera writes: [1] your proposal of "[+-] OBJTYPE OBJIDENT" plus empty lines allowed plus lines starting with # are comments, seems plenty. Any line not following that format

Re: RFC: Logging plan of the running query

2021-07-13 Thread Masahiro Ikeda
On Tue, Jun 22, 2021 at 8:00 AM torikoshia wrote: Updated the patch. Hi, torikoshi-san Thanks for your great work! I'd like to use this feature in v15. I confirmed that it works with queries I tried and make check-world has no error. When I tried this feature, I realized two things. So, I

Re: unnesting multirange data types

2021-07-13 Thread Justin Pryzby
On Tue, Jul 13, 2021 at 03:11:16PM +0300, Alexander Korotkov wrote: > On Sun, Jul 11, 2021 at 1:20 AM Justin Pryzby wrote: > > On Sun, Jul 11, 2021 at 01:00:27AM +0300, Alexander Korotkov wrote: > > > On Sat, Jul 10, 2021 at 7:34 PM Alvaro Herrera > > > wrote: > > > > On 2021-Jun-27, Alexander

Re: Bogus HAVE_DECL_FOO entries in msvc/Solution.pm

2021-07-13 Thread Tom Lane
Michael Paquier writes: > On Tue, Jul 13, 2021 at 12:25:06AM -0400, Tom Lane wrote: >> That's easy enough in v13 and up, which have 8f4fb4c64 so that >> Solution.pm looks like this. We could make it consistent in older >> branches by manually hacking pg_config.h.win32 ... but I'm wondering >> if

Re: Replace remaining castNode(…, lfirst(…)) and friends calls with l*_node()

2021-07-13 Thread Peter Eisentraut
On 08.07.21 20:17, Alvaro Herrera wrote: diff --git a/src/backend/rewrite/rewriteSearchCycle.c b/src/backend/rewrite/rewriteSearchCycle.c index 599fe8e735..c50ebdba24 100644 --- a/src/backend/rewrite/rewriteSearchCycle.c +++ b/src/backend/rewrite/rewriteSearchCycle.c @@ -307,8 +307,8 @@

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

2021-07-13 Thread Stephen Frost
Greetings, * Tom Lane (t...@sss.pgh.pa.us) wrote: > Alvaro Herrera writes: > > [1] your proposal of "[+-] OBJTYPE OBJIDENT" plus empty lines allowed > > plus lines starting with # are comments, seems plenty. Any line not > > following that format would cause an error to be thrown. > >

Re: [PATCH] improve the pg_upgrade error message

2021-07-13 Thread Jeevan Ladhe
> The admin might fix DB123, restart their upgrade procedure, spend 5 or 15 > minutes with that, only to have it then fail on DB1234. > Agree with this observation. Here is a patch that writes the list of all the databases other than template0 that are having their pg_database.datallowconn to

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

2021-07-13 Thread Ranier Vilela
Em ter., 13 de jul. de 2021 às 09:24, David Rowley escreveu: > On Wed, 14 Jul 2021 at 00:06, Ranier Vilela wrote: > > > > Em ter., 13 de jul. de 2021 às 04:19, Ronan Dunklau < > ronan.dunk...@aiven.io> escreveu: > >> I would be > >> surprised the check adds that much to the whole execution

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

2021-07-13 Thread David Rowley
On Wed, 14 Jul 2021 at 00:06, Ranier Vilela wrote: > > Em ter., 13 de jul. de 2021 às 04:19, Ronan Dunklau > escreveu: >> I would be >> surprised the check adds that much to the whole execution though. > > I think this branch is a misprediction. It could be. I wondered that myself when I saw

Re: unnesting multirange data types

2021-07-13 Thread Alexander Korotkov
On Sun, Jul 11, 2021 at 1:20 AM Justin Pryzby wrote: > On Sun, Jul 11, 2021 at 01:00:27AM +0300, Alexander Korotkov wrote: > > On Sat, Jul 10, 2021 at 7:34 PM Alvaro Herrera > > wrote: > > > On 2021-Jun-27, Alexander Korotkov wrote: > > > > > > > BTW, I found some small inconsistencies in the

Re: a misbehavior of partition row movement (?)

2021-07-13 Thread Amit Langote
Hi Ibrar, Sawada-san, On Tue, Jul 13, 2021 at 20:25 Ibrar Ahmed wrote: > > > On Fri, Apr 2, 2021 at 6:09 PM Amit Langote > wrote: > >> On Thu, Apr 1, 2021 at 10:56 AM Masahiko Sawada >> wrote: >> > On Tue, Mar 23, 2021 at 6:27 PM Amit Langote >> wrote: >> > > Actually, I found a big hole in

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

2021-07-13 Thread Ranier Vilela
Em ter., 13 de jul. de 2021 às 04:19, Ronan Dunklau escreveu: > > I've now pushed that bug fix so it's fine to remove the change to > > > I would be > surprised the check adds that much to the whole execution though. > I think this branch is a misprediction. In most cases is it not datumSort?

Re: psql \copy from sends a lot of packets

2021-07-13 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 patch was marked as the one that needs review and

Re: Add proper planner support for ORDER BY / DISTINCT aggregates

2021-07-13 Thread Ranier Vilela
Em ter., 13 de jul. de 2021 às 01:44, David Rowley escreveu: > Thanks for having a look at this. > > On Tue, 13 Jul 2021 at 11:04, Ranier Vilela wrote: > >> 0001 Adds planner support for ORDER BY aggregates. > > > > /* Normal transition function without ORDER BY / DISTINCT. */ > > Is it

Re: POC: GROUP BY optimization

2021-07-13 Thread Ibrar Ahmed
On Wed, Mar 10, 2021 at 4:05 AM Tomas Vondra wrote: > Hi, > > I take a look at the patch today. Attached is the v12 and a separate > patch with some comment tweaks and review comments. > > > 1) I see the patch results in some plan changes in postgres_fdw. I > assume it's somehow related to the

Re: a misbehavior of partition row movement (?)

2021-07-13 Thread Ibrar Ahmed
On Fri, Apr 2, 2021 at 6:09 PM Amit Langote wrote: > On Thu, Apr 1, 2021 at 10:56 AM Masahiko Sawada > wrote: > > On Tue, Mar 23, 2021 at 6:27 PM Amit Langote > wrote: > > > Actually, I found a big hole in my assumptions around deferrable > > > foreign constraints, invalidating the approach I

Re: Transactions involving multiple postgres foreign servers, take 2

2021-07-13 Thread Ranier Vilela
Em ter., 13 de jul. de 2021 às 01:14, r.takahash...@fujitsu.com < r.takahash...@fujitsu.com> escreveu: > 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

Re: Introduce pg_receivewal gzip compression tests

2021-07-13 Thread gkokolatos
‐‐‐ Original Message ‐‐‐ On Tuesday, July 13th, 2021 at 12:26, Michael Paquier wrote: > On Tue, Jul 13, 2021 at 08:28:44AM +, gkokola...@pm.me wrote: > > Sounds great. Let me cook up v6 for this. > > Thanks. Could you use v5 I posted upthread as a base? There were > some

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

2021-07-13 Thread Ibrar Ahmed
On Wed, Mar 3, 2021 at 1:42 PM Neil Chen wrote: > The following review has been posted through the commitfest application: > make installcheck-world: tested, passed > Implements feature: tested, passed > Spec compliant: not tested > Documentation:tested, passed > >

Re: row filtering for logical replication

2021-07-13 Thread Amit Kapila
On Tue, Jul 13, 2021 at 10:24 AM Amit Kapila wrote: > > On Mon, Jul 12, 2021 at 3:01 PM Tomas Vondra > wrote: > > > In terms of implementation, I think there are two basic options - either > > we can define a new "expression" type in gram.y, which would be a subset > > of a_expr etc. Or we can

Re: Enhanced error message to include hint messages for redundant options error

2021-07-13 Thread Dean Rasheed
On Mon, 12 Jul 2021 at 17:39, vignesh C wrote: > > Thanks for your comments, I have made the changes for the same in the > V10 patch attached. > Thoughts? > I'm still not happy about changing so many error messages. Some of the changes might be OK, but aren't strictly necessary. For example:

Re: Remove repeated calls to PQserverVersion

2021-07-13 Thread Michael Paquier
On Tue, Jul 13, 2021 at 07:02:27PM +1000, Peter Smith wrote: > I found a few functions making unnecessary repeated calls to > PQserverVersion(conn); instead of just calling once and assigning to a > local variable. Does it really matter? PQserverVersion() does a simple lookup at the internals of

Re: [PATCH] Pull general SASL framework out of SCRAM

2021-07-13 Thread Michael Paquier
On Tue, Jul 13, 2021 at 12:41:27PM +0300, Mikhail Kulagin wrote: > I got an error while building one of the extensions. > /home/mkulagin/pg-install/postgresql-master/include/internal/libpq-int.h:44:10: > fatal error: fe-auth-sasl.h: No such file or directory > #include

Re: DROP relation IF EXISTS Docs and Tests - Bug Fix

2021-07-13 Thread Ibrar Ahmed
On Tue, Mar 9, 2021 at 9:01 PM David Steele wrote: > On 3/9/21 10:08 AM, David G. Johnston wrote: > > > > On Tuesday, March 9, 2021, David Steele > > wrote: > > > > Further, I think we should close this entry at the end of the CF if > > it does not attract

Re: Introduce pg_receivewal gzip compression tests

2021-07-13 Thread Michael Paquier
On Tue, Jul 13, 2021 at 08:28:44AM +, gkokola...@pm.me wrote: > Sounds great. Let me cook up v6 for this. Thanks. Could you use v5 I posted upthread as a base? There were some improvements in the variable names, the comments and the test descriptions. -- Michael signature.asc Description:

Re: Parallel scan with SubTransGetTopmostTransaction assert coredump

2021-07-13 Thread Pavel Borisov
> > > So yeah, I think this is due to confusion with two snapshots and > > failing > > to consider both of them when calculating TransactionXmin. > > > > But I think removing one of the snapshots (as the v2 does it) is rather > > strange too. I very much doubt having both the transaction and

Re: Fix comments of heap_prune_chain()

2021-07-13 Thread Masahiro Ikeda
On 2021/07/13 10:22, Kyotaro Horiguchi wrote: > (This is out of topic) > > At Mon, 12 Jul 2021 20:17:55 -0400, Alvaro Herrera > wrote in >> Oh, apologies, I didn't realize there was an attachment. That seems >> specific enough :-) >> >> In my defense, the archives don't show the attachment

Re: Parallel scan with SubTransGetTopmostTransaction assert coredump

2021-07-13 Thread Maxim Orlov
On 2021-07-09 20:36, Tomas Vondra wrote: Hi, I took a quick look on this - I'm no expert in the details of snapshots, so take my comments with a grain of salt. AFAICS both Greg Nancarrow and Pavel Borisov are kinda right. I think Greg is right the v3 patch does not seem like the right (or

Re: Fix comments of heap_prune_chain()

2021-07-13 Thread Masahiro Ikeda
On 2021/07/13 5:57, Matthias van de Meent wrote: > > > On Mon, 12 Jul 2021 at 13:14, > wrote: >> >> Hi, >> >> While I’m reading source codes related to vacuum, I found comments which >> don’t seem to fit the reality. I think the commit[1] just forgot to fix

  1   2   >