Re: Implementing Incremental View Maintenance

2020-09-04 Thread Thomas Munro
Hi Nagata-san, On Mon, Aug 31, 2020 at 5:32 PM Yugo NAGATA wrote: > https://wiki.postgresql.org/wiki/Incremental_View_Maintenance Thanks for writing this! + /* +* Wait for concurrent transactions which update this materialized view at +* READ COMMITED. This is needed to see changes

Re: Fix for configure error in 9.5/9.6 on macOS 11.0 Big Sur

2020-09-04 Thread Jesse Zhang
On Thu, Sep 3, 2020 at 10:36 AM Tom Lane wrote: > > Jesse Zhang writes: > >> Peter Eisentraut writes: > >>> Where did the -Werror come from? > > > If you noticed the full invocation of clang, you'd notice that Werror is > > nowhere on the command line, even though the error message suggests > >

Re: More tests with USING INDEX replident and dropped indexes

2020-09-04 Thread Michael Paquier
On Wed, Sep 02, 2020 at 03:00:44PM +0900, Michael Paquier wrote: > Yeah, that's true as well. Still, I would like to see first if people > are fine with changing this code path to be transactional. This way, > we will have zero history in the tree where there was a risk for an > inconsistent

Weird corner-case failure mode for VPATH builds

2020-09-04 Thread Tom Lane
I discovered a problem today while trying to do a VPATH build on a machine I don't use that often: $ make ... In file included from /home/tgl/pgsql/src/include/postgres.h:47, from /home/tgl/pgsql/src/common/hashfn.c:24: /home/tgl/pgsql/src/include/utils/elog.h:71:10: fatal error:

Re: WIP: BRIN multi-range indexes

2020-09-04 Thread Michael Paquier
On Fri, Aug 07, 2020 at 06:27:01PM +0200, Tomas Vondra wrote: > Attached is an updated version of the patch series, implementing this. > Adding the extra data types was fairly simple, because both bloom and > minmax-multi indexes already used "struct as varlena" approach, so all > that needed was

Re: Bogus documentation for bogus geometric operators

2020-09-04 Thread Michael Paquier
On Fri, Aug 21, 2020 at 12:00:45PM +0100, Emre Hasegeli wrote: > I prepared a patch to add <<| and |>> operators for points to > deprecate the previous ones. Emre, the CF bot complains that this does not apply anymore, so please provide a rebase. By the way, I am a bit confused to see a patch

Re: Concurrent failure in create_am with buildfarm member conchuela

2020-09-04 Thread Michael Paquier
On Fri, Sep 04, 2020 at 03:38:32PM -0400, Alvaro Herrera wrote: > Fixed in d54f99e4154. Yes, thanks. I bumped into the other thread this morning: https://www.postgresql.org/message-id/839004.1599185...@sss.pgh.pa.us The fix makes sense. -- Michael signature.asc Description: PGP signature

Re: Improving connection scalability: GetSnapshotData()

2020-09-04 Thread Michael Paquier
On Fri, Sep 04, 2020 at 10:35:19AM -0700, Andres Freund wrote: > I think it's best to close the entry. There's substantial further wins > possible, in particular not acquiring ProcArrayLock in GetSnapshotData() > when the cache is valid improves performance substantially. But it's > non-trivial

Re: A micro-optimisation for walkdir()

2020-09-04 Thread Andres Freund
Hi, On 2020-09-05 11:15:07 +1200, Thomas Munro wrote: > On Sat, Sep 5, 2020 at 9:45 AM Andres Freund wrote: > > On 2020-09-02 17:51:27 +0200, Juan José Santamaría Flecha wrote: > > > + attrib = GetFileAttributes(d->ret.d_name); > > > > Is this really an optimization? The benefit of Thomas'

Re: WIP: WAL prefetch (another approach)

2020-09-04 Thread Thomas Munro
On Wed, Sep 2, 2020 at 2:18 AM Tomas Vondra wrote: > On Wed, Sep 02, 2020 at 02:05:10AM +1200, Thomas Munro wrote: > >On Wed, Sep 2, 2020 at 1:14 AM Tomas Vondra > > wrote: > >> from the archive > > > >Ahh, so perhaps that's the key. > > Maybe. For the record, the commands look like this: > >

Re: A micro-optimisation for walkdir()

2020-09-04 Thread Thomas Munro
On Sat, Sep 5, 2020 at 9:45 AM Andres Freund wrote: > On 2020-09-02 17:51:27 +0200, Juan José Santamaría Flecha wrote: > > + attrib = GetFileAttributes(d->ret.d_name); > > Is this really an optimization? The benefit of Thomas' patch is that > that information sometimes already is there. But

Re: A micro-optimisation for walkdir()

2020-09-04 Thread Alvaro Herrera
On 2020-Sep-04, Tom Lane wrote: > I think that it's standard to test for such symbols by seeing > if they're defined as macros ... not least because that's the *only* > way to test their existence in C. I guess since what we're doing is emulating standard readdir(), that makes sense. >

Re: A micro-optimisation for walkdir()

2020-09-04 Thread Andres Freund
Hi, On 2020-09-02 17:51:27 +0200, Juan José Santamaría Flecha wrote: > Win32 could also benefit from this micro-optimisation if we expanded the > dirent port to include d_type. Please find attached a patch that does > so . > } > strcpy(d->ret.d_name, fd.cFileName);/* Both strings

Re: Questionable ping logic in LogicalRepApplyLoop

2020-09-04 Thread Tom Lane
Alvaro Herrera writes: > ... oh look! commit 3f60f690fac1 moved last_recv_timestamp without > realizing that ping_sent had to get the same treatment. Hah, I wondered if something like that had happened, but I didn't get around to excavating in the git history yet. Thanks for doing so. Will

Re: A micro-optimisation for walkdir()

2020-09-04 Thread Tom Lane
Alvaro Herrera writes: > On 2020-Sep-04, Juan José Santamaría Flecha wrote: >> If will fail to detect that the patch makes the optimisation available for >> WIN32: >> >> +#if defined(DT_UNKNOWN) && defined(DT_REG) && defined(DT_DIR) && >> defined(DT_LNK) > Oh, I see. I suggest that it'd be

Re: PATCH: Batch/pipelining support for libpq

2020-09-04 Thread Alvaro Herrera
On 2020-Aug-31, Matthieu Garrigues wrote: > It seems like this patch is nearly finished. I fixed all the remaining > issues. I'm also asking a confirmation of the test scenarios you want > to see in the next version of the patch. Hmm, apparently nobody noticed that this patch is not registered

Re: Range checks of pg_test_fsync --secs-per-test and pg_test_timing --duration

2020-09-04 Thread Peter Eisentraut
On 2020-08-06 08:27, Michael Paquier wrote: As $subject says, pg_test_fsync and pg_test_timing don't really check the range of option values specified. It is possible for example to make pg_test_fsync run an infinite amount of time, and pg_test_timing does not handle overflows with --duration

Re: [PATCH] Redudant initilization

2020-09-04 Thread Ranier Vilela
Em sex., 4 de set. de 2020 às 14:40, Tom Lane escreveu: > Bruce Momjian writes: > > I have to say, I am kind of stumped why compilers do not warn of such > > cases, and why we haven't gotten reports about these cases before. > > I was just experimenting with clang's "scan-build" tool. It finds

Re: BUG #16419: wrong parsing BC year in to_date() function

2020-09-04 Thread Peter Eisentraut
On 2020-09-04 21:45, David G. Johnston wrote: On Thu, Sep 3, 2020 at 6:21 PM Bruce Momjian > wrote: On Wed, Jul 15, 2020 at 09:26:53AM -0700, David G. Johnston wrote: > Whether to actually change the behavior of to_date is up for debate though I >

Re: Any objections to implementing LogicalDecodeMessageCB for pgoutput?

2020-09-04 Thread Cary Huang
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 Hi I have tried the patch and it functions as described.

Re: A micro-optimisation for walkdir()

2020-09-04 Thread Alvaro Herrera
On 2020-Sep-04, Juan José Santamaría Flecha wrote: > If will fail to detect that the patch makes the optimisation available for > WIN32: > > +#if defined(DT_UNKNOWN) && defined(DT_REG) && defined(DT_DIR) && > defined(DT_LNK) Oh, I see. I suggest that it'd be better to change this line instead.

Re: Questionable ping logic in LogicalRepApplyLoop

2020-09-04 Thread Alvaro Herrera
On 2020-Sep-04, Tom Lane wrote: > While playing around with clang's scan-build I noticed this warning: > > worker.c:2281:7: warning: Value stored to 'ping_sent' is never read > ping_sent = true; > ^

Re: Keep elog(ERROR) and ereport(ERROR) calls in the cold path

2020-09-04 Thread Peter Eisentraut
On 2020-08-05 05:00, David Rowley wrote: The 5GB scaled TPC-H test does show some performance gains from the v4 patch and shows an obvious regression from removing the unlikely() calls too. Based, mostly on the TPC-H results where performance did improve close to 2%, I'm starting to think it

Re: A micro-optimisation for walkdir()

2020-09-04 Thread Juan José Santamaría Flecha
On Fri, Sep 4, 2020 at 10:28 PM Alvaro Herrera wrote: > On 2020-Sep-04, Juan José Santamaría Flecha wrote: > > > On Fri, Sep 4, 2020 at 9:37 PM Alvaro Herrera > > wrote: > > > > > On 2020-Sep-04, Thomas Munro wrote: > > > > > > > > > +/* File types for 'd_type'. */ > > > > +enum > > > > + { >

Re: A micro-optimisation for walkdir()

2020-09-04 Thread Alvaro Herrera
On 2020-Sep-04, Juan José Santamaría Flecha wrote: > On Fri, Sep 4, 2020 at 9:37 PM Alvaro Herrera > wrote: > > > On 2020-Sep-04, Thomas Munro wrote: > > > > > > +/* File types for 'd_type'. */ > > > +enum > > > + { > > > + DT_UNKNOWN = 0, > > > +# define DT_UNKNOWN DT_UNKNOWN >

Re: [PATCH] Comments related to " buffer descriptors“ cache line size"

2020-09-04 Thread Thomas Munro
On Sat, Sep 5, 2020 at 5:28 AM Bruce Momjian wrote: > On Fri, Sep 4, 2020 at 11:31:55PM +0800, Kelly Min wrote: > > I found a comment error in buffer descriptors comment. The cache line size > > is > > 64 bytes, not 64 bits > > Thanks, fix applied to all active branches. I find it a bit

Re: BUG #16419: wrong parsing BC year in to_date() function

2020-09-04 Thread Bruce Momjian
On Fri, Sep 4, 2020 at 12:45:36PM -0700, David G. Johnston wrote: > On Thu, Sep 3, 2020 at 6:21 PM Bruce Momjian wrote: > > On Wed, Jul 15, 2020 at 09:26:53AM -0700, David G. Johnston wrote: > > > Whether to actually change the behavior of to_date is up for debate > though I >

Re: [Patch] Add missing libraries to Libs.private of libpq.pc

2020-09-04 Thread Peter Eisentraut
On 2020-07-10 21:47, Peter Eisentraut wrote: On 2020-04-08 11:38, Sandro Mani wrote: The following patch, which we added to build mingw-postgresql on Fedora, adds some missing libraries to Libs.private of libpq.pc, discovered when attempting to statically link with libpq: -lz: is required by

Re: A micro-optimisation for walkdir()

2020-09-04 Thread Juan José Santamaría Flecha
On Fri, Sep 4, 2020 at 9:37 PM Alvaro Herrera wrote: > On 2020-Sep-04, Thomas Munro wrote: > > > @@ -10,6 +10,7 @@ struct dirent > > { > > longd_ino; > > unsigned short d_reclen; > > + unsigned char d_type; > > unsigned short d_namlen; > > char

Re: BUG #16419: wrong parsing BC year in to_date() function

2020-09-04 Thread David G. Johnston
On Thu, Sep 3, 2020 at 6:21 PM Bruce Momjian wrote: > On Wed, Jul 15, 2020 at 09:26:53AM -0700, David G. Johnston wrote: > > > Whether to actually change the behavior of to_date is up for debate > though I > > would presume it would not be back-patched. > > OK, so, looking at this thread, we

Questionable ping logic in LogicalRepApplyLoop

2020-09-04 Thread Tom Lane
While playing around with clang's scan-build I noticed this warning: worker.c:2281:7: warning: Value stored to 'ping_sent' is never read ping_sent = true; ^ At first I thought it was a

Re: Concurrent failure in create_am with buildfarm member conchuela

2020-09-04 Thread Alvaro Herrera
Hello, On 2020-Sep-04, Michael Paquier wrote: > conchuela has just reported the following error: > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=conchuela=2020-09-03%2023%3A00%3A36 Fixed in d54f99e4154. Thanks -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL

Re: A micro-optimisation for walkdir()

2020-09-04 Thread Alvaro Herrera
On 2020-Sep-04, Thomas Munro wrote: > @@ -10,6 +10,7 @@ struct dirent > { > longd_ino; > unsigned short d_reclen; > + unsigned char d_type; > unsigned short d_namlen; > chard_name[MAX_PATH]; > }; > @@ -20,4 +21,26 @@ DIR

Re: Disk-based hash aggregate's cost model

2020-09-04 Thread Jeff Davis
On Fri, 2020-09-04 at 21:01 +0200, Tomas Vondra wrote: > Wouldn't it be enough to just use a slot with smaller tuple > descriptor? > All we'd need to do is creating the descriptor in ExecInitAgg after > calling find_hash_columns, and using it for rslot/wslot, and then > "mapping" the attributes in

Re: Improving connection scalability: GetSnapshotData()

2020-09-04 Thread Andres Freund
On 2020-09-04 11:53:04 -0700, Andres Freund wrote: > There's a seperate benchmark that I found to be quite revealing that's > far less dependent on scheduler behaviour. Run two pgbench instances: > > 1) With a very simply script '\sleep 1s' or such, and many connections >(e.g. 100,1000,5000).

Re: pg_dump bug for extension owned tables

2020-09-04 Thread Fabrízio de Royes Mello
On Fri, Sep 4, 2020 at 3:00 PM Andrew Dunstan < andrew.duns...@2ndquadrant.com> wrote: > > > Thanks, Committed. Further investigation shows this was introduced in > release 12, so that's how far back I went. > Thanks! -- Fabrízio de Royes Mello Timbira - http://www.timbira.com.br/

Re: Disk-based hash aggregate's cost model

2020-09-04 Thread Tomas Vondra
On Fri, Sep 04, 2020 at 11:31:36AM -0700, Jeff Davis wrote: On Fri, 2020-09-04 at 14:56 +0200, Tomas Vondra wrote: Those charts show that the CP_SMALL_TLIST resulted in smaller temp files (per EXPLAIN ANALYZE the difference is ~25%) and also lower query durations (also in the ~25% range). I

Re: report expected contrecord size

2020-09-04 Thread Alvaro Herrera
On 2020-Sep-03, Tom Lane wrote: > Alvaro Herrera writes: > > On 2020-Sep-03, Tom Lane wrote: > >> Uh ... is it really possible for gotlen to be more than total_len? > >> (I've not looked at the surrounding code here, but that seems weird.) > > > Well, as I understand, total_len comes from one

Re: Improving connection scalability: GetSnapshotData()

2020-09-04 Thread Andres Freund
Hi, On 2020-09-04 18:24:12 +0300, Konstantin Knizhnik wrote: > Reported results looks very impressive. > But I tried to reproduce them and didn't observed similar behavior. > So I am wondering what can be the difference and what I am doing wrong. That is odd - I did reproduce it on quite a few

Re: Disk-based hash aggregate's cost model

2020-09-04 Thread Jeff Davis
On Fri, 2020-09-04 at 14:56 +0200, Tomas Vondra wrote: > Those charts show that the CP_SMALL_TLIST resulted in smaller temp > files > (per EXPLAIN ANALYZE the difference is ~25%) and also lower query > durations (also in the ~25% range). I was able to reproduce the problem, thank you. Only two

Re: Global snapshots

2020-09-04 Thread Alexey Kondratov
Hi, On 2020-07-27 09:44, Andrey V. Lepikhov wrote: On 7/27/20 11:22 AM, tsunakawa.ta...@fujitsu.com wrote: US8356007B2 - Distributed transaction management for database systems with multiversioning - Google Patents https://patents.google.com/patent/US8356007 If it is, can we circumvent

Re: pg_dump bug for extension owned tables

2020-09-04 Thread Andrew Dunstan
On Thu, Aug 6, 2020 at 4:12 PM Fabrízio de Royes Mello wrote: > > > On Mon, Jul 13, 2020 at 6:18 PM Fabrízio de Royes Mello > wrote: >> >> >> On Mon, Jul 13, 2020 at 5:05 PM Andrew Dunstan >> wrote: >> > >> > >> > On 7/13/20 2:46 PM, Fabrízio de Royes Mello wrote: >> > > >> > > >> > > > >> >

Re: [PATCH] Redudant initilization

2020-09-04 Thread Tom Lane
Bruce Momjian writes: > I have to say, I am kind of stumped why compilers do not warn of such > cases, and why we haven't gotten reports about these cases before. I was just experimenting with clang's "scan-build" tool. It finds all of the cases you just fixed, and several dozen more beside.

Re: Improving connection scalability: GetSnapshotData()

2020-09-04 Thread Andres Freund
Hi, On 2020-09-03 17:18:29 +0900, Michael Paquier wrote: > On Sun, Aug 16, 2020 at 02:26:57PM -0700, Andres Freund wrote: > > So we get some builfarm results while thinking about this. > > Andres, there is an entry in the CF for this thread: > https://commitfest.postgresql.org/29/2500/ > > A

Re: Change a constraint's index - ALTER TABLE ... ALTER CONSTRAINT ... USING INDEX ...

2020-09-04 Thread Alvaro Herrera
On 2020-Sep-04, Laurenz Albe wrote: > On Fri, 2020-09-04 at 10:41 -0400, Alvaro Herrera wrote: > > > The value I see in this is: > > > - replacing a primary key index > > > - replacing the index behind a constraint targeted by a foreign key > > > > But why is this better than using REINDEX

Re: [PATCH] Comments related to " buffer descriptors“ cache line size"

2020-09-04 Thread Bruce Momjian
On Fri, Sep 4, 2020 at 11:31:55PM +0800, Kelly Min wrote: > hello, hackers. > > > I found a comment error in buffer descriptors comment. The cache line size is > 64 bytes, not 64 bits Thanks, fix applied to all active branches. -- Bruce Momjian https://momjian.us EnterpriseDB

Re: LogwrtResult contended spinlock

2020-09-04 Thread Andres Freund
Hi, On 2020-09-04 10:05:45 -0700, Andres Freund wrote: > On 2020-09-03 14:34:52 -0400, Alvaro Herrera wrote: > > Looking at patterns like this > > > > if (XLogCtl->LogwrtRqst.Write < EndPos) > > XLogCtl->LogwrtRqst.Write = EndPos; > > > > It seems possible to implement with > >

Re: LogwrtResult contended spinlock

2020-09-04 Thread Andres Freund
Hi, On 2020-09-03 14:34:52 -0400, Alvaro Herrera wrote: > Looking at patterns like this > > if (XLogCtl->LogwrtRqst.Write < EndPos) > XLogCtl->LogwrtRqst.Write = EndPos; > > It seems possible to implement with > > do { > XLogRecPtr currwrite; > >

Re: [PATCH] Redudant initilization

2020-09-04 Thread Ranier Vilela
Em sex., 4 de set. de 2020 às 11:01, Bruce Momjian escreveu: > On Fri, Sep 4, 2020 at 09:39:45AM -0300, Ranier Vilela wrote: > > Em qui., 3 de set. de 2020 às 23:57, Bruce Momjian > escreveu: > > > > On Wed, Apr 1, 2020 at 08:57:18AM -0300, Ranier Vilela wrote: > > > Hi, > > > New

Re: Rare deadlock failure in create_am test

2020-09-04 Thread Tom Lane
Alvaro Herrera writes: > On 2020-Sep-03, Tom Lane wrote: >> I'm inclined to think that the best fix is to put >> >> begin; >> lock table [fast_emp4000]; >> ... >> commit; >> >> around the DROP CASCADE. > Yeah, sounds good. Done. regards, tom lane

[PATCH] Comments related to " buffer descriptors“ cache line size"

2020-09-04 Thread Kelly Min
hello, hackers. I found a comment error in buffer descriptors comment. The cache line size is 64 bytes, not 64 bits buffer-descriptor.patch Description: Binary data

Re: On login trigger: take three

2020-09-04 Thread Konstantin Knizhnik
Sorry, attached version of the patch is missing changes in one file. Here is it correct patch. -- Konstantin Knizhnik Postgres Professional: http://www.postgrespro.com The Russian Postgres Company diff --git a/doc/src/sgml/ref/create_trigger.sgml b/doc/src/sgml/ref/create_trigger.sgml index

Re: Add session statistics to pg_stat_database

2020-09-04 Thread Laurenz Albe
On Tue, 2020-08-11 at 13:53 +0200, I wrote: > On Thu, 2020-07-23 at 18:16 +0500, Ahsan Hadi wrote: > > > On Wed, Jul 8, 2020 at 4:17 PM Laurenz Albe > > wrote: > > > Here is a patch that adds the following to pg_stat_database: > > > - number of connections > > > > Is it expected behaviour to

Re: Change a constraint's index - ALTER TABLE ... ALTER CONSTRAINT ... USING INDEX ...

2020-09-04 Thread Laurenz Albe
On Fri, 2020-09-04 at 10:41 -0400, Alvaro Herrera wrote: > > The value I see in this is: > > - replacing a primary key index > > - replacing the index behind a constraint targeted by a foreign key > > But why is this better than using REINDEX CONCURRENTLY? It is not better, but it can be used to

Re: Improving connection scalability: GetSnapshotData()

2020-09-04 Thread Konstantin Knizhnik
On 03.09.2020 11:18, Michael Paquier wrote: On Sun, Aug 16, 2020 at 02:26:57PM -0700, Andres Freund wrote: So we get some builfarm results while thinking about this. Andres, there is an entry in the CF for this thread: https://commitfest.postgresql.org/29/2500/ A lot of work has been

Re: [PATCH]Fix ja.po error

2020-09-04 Thread Alvaro Herrera
On 2020-Aug-19, Lu, Chenyang wrote: > Ping: sorry, did Alvaro and Peter forget this email?( Maybe didn't see this > email~ ), I found that the patch of ja.po has not been applied to the > Translation Repository. Apologies. I have pushed this to all branches of the translation repo now. The

Re: Allow continuations in "pg_hba.conf" files

2020-09-04 Thread Tom Lane
Fabien COELHO writes: > I notice that buf.data is not freed. I guess that the server memory > management will recover it. Yeah, it's in the transient context holding all of the results of reading the file. I considered pfree'ing it at the end of the function, but I concluded there's no point.

Re: Ideas about a better API for postgres_fdw remote estimates

2020-09-04 Thread Tomas Vondra
On Thu, Sep 03, 2020 at 10:14:41AM +0500, Andrey V. Lepikhov wrote: On 8/31/20 6:19 PM, Ashutosh Bapat wrote: On Mon, Aug 31, 2020 at 3:36 PM Andrey V. Lepikhov wrote: Thanks for this helpful feedback. I think the patch has some other problems like it works only for regular tables on

Re: Change a constraint's index - ALTER TABLE ... ALTER CONSTRAINT ... USING INDEX ...

2020-09-04 Thread Alvaro Herrera
On 2020-Sep-04, Laurenz Albe wrote: > The value I see in this is: > - replacing a primary key index > - replacing the index behind a constraint targeted by a foreign key But why is this better than using REINDEX CONCURRENTLY? -- Álvaro Herrerahttps://www.2ndQuadrant.com/

Re: Division in dynahash.c due to HASH_FFACTOR

2020-09-04 Thread Alvaro Herrera
On 2020-Sep-04, Jakub Wartak wrote: > After removing HASH_FFACTOR PostgreSQL still compiles...  Would > removing it break some external API/extensions ? FWIW, HASH_FFACTOR has *never* been used in Postgres core code. https://postgr.es/m/20160418180711.55ac82c0@fujitsu already reported that this

Re: Rare deadlock failure in create_am test

2020-09-04 Thread Alvaro Herrera
On 2020-Sep-03, Tom Lane wrote: > So it's not hard to understand the problem: DROP of an index AM, cascading > to an index, will need to acquire lock on the index and then lock on the > index's table. Any other operation on the table, like say autovacuum, > is going to acquire locks in the other

Re: Report error position in partition bound check

2020-09-04 Thread Ashutosh Bapat
On Fri, 10 Jul 2020 at 23:31, Alexandra Wang wrote: > > > Thank you Daniel. Here's the rebased patch. I also squashed the two > patches into one so it's easier to review. > > Thanks for rebasing patch. It applies cleanly still. Here are some comments @@ -3320,7 +3338,9 @@

Re: Allow continuations in "pg_hba.conf" files

2020-09-04 Thread Fabien COELHO
Hello Tom, Accordingly, I borrowed some code from that thread and present the attached revision. I also added some test coverage, since that was lacking before, and wordsmithed docs and comments slightly. Hearing no comments, pushed that way. Thanks for the fixes and improvements! I

Re: [PATCH] Redudant initilization

2020-09-04 Thread Bruce Momjian
On Fri, Sep 4, 2020 at 09:39:45AM -0300, Ranier Vilela wrote: > Em qui., 3 de set. de 2020 às 23:57, Bruce Momjian > escreveu: > > On Wed, Apr  1, 2020 at 08:57:18AM -0300, Ranier Vilela wrote: > > Hi, > > New patch with yours suggestions. > > Patch applied to head, thanks. >

Re: Rare deadlock failure in create_am test

2020-09-04 Thread Tom Lane
Thomas Munro writes: > On Fri, Sep 4, 2020 at 2:13 PM Tom Lane wrote: >> I'm inclined to think that the best fix is to put >> >> begin; >> lock table tenk2; >> ... >> commit; > Makes sense, except s/tenk2/fast_emp4000/, no? Sorry, thinko ... regards, tom lane

Re: Ideas about a better API for postgres_fdw remote estimates

2020-09-04 Thread Ashutosh Bapat
On Thu, 3 Sep 2020 at 10:44, Andrey V. Lepikhov wrote: > On 8/31/20 6:19 PM, Ashutosh Bapat wrote: > > On Mon, Aug 31, 2020 at 3:36 PM Andrey V. Lepikhov > > wrote: > >> > >> Thanks for this helpful feedback. > > I think the patch has some other problems like it works only for > > regular

Re: Disk-based hash aggregate's cost model

2020-09-04 Thread Tomas Vondra
On Thu, Sep 03, 2020 at 05:53:43PM -0700, Jeff Davis wrote: On Tue, 2020-09-01 at 23:19 +0200, Tomas Vondra wrote: FWIW any thoughts about the different in temp size compared to CP_SMALL_TLIST? Are you referring to results from a while ago? In this thread I don't see what you're referring to.

Re: Get memory contexts of an arbitrary backend process

2020-09-04 Thread Tomas Vondra
On Fri, Sep 04, 2020 at 11:47:30AM +0900, Kasahara Tatsuhito wrote: On Fri, Sep 4, 2020 at 2:40 AM Tom Lane wrote: Kasahara Tatsuhito writes: > Yes, but it's not only for future expansion, but also for the > usability and the stability of this feature. > For example, if you want to read one

Re: [PATCH] Redudant initilization

2020-09-04 Thread Ranier Vilela
Em qui., 3 de set. de 2020 às 23:57, Bruce Momjian escreveu: > On Wed, Apr 1, 2020 at 08:57:18AM -0300, Ranier Vilela wrote: > > Hi, > > New patch with yours suggestions. > > Patch applied to head, thanks. > Thank you Bruce. regards, Ranier Vilela

Re: Fix for configure error in 9.5/9.6 on macOS 11.0 Big Sur

2020-09-04 Thread Peter Eisentraut
On 2020-09-04 07:52, Tom Lane wrote: Peter Eisentraut writes: I suppose backpatching the patch that fixed this would be appropriate. [ confused ... ] Back-patching what patch? Commit 1c0cf52b39ca3a9a79661129cff918dc000a55eb was mentioned at the beginning of the thread. -- Peter

Re: Division in dynahash.c due to HASH_FFACTOR

2020-09-04 Thread Tomas Vondra
On Fri, Sep 04, 2020 at 07:01:41AM +, Jakub Wartak wrote: Greetins hackers, I have mixed feelings if this welcome contribution as the potential gain is relatively small in my tests, but still I would like to point out that HASH_FFACTOR functionality from dynahash.c could be removed or

Re: Change a constraint's index - ALTER TABLE ... ALTER CONSTRAINT ... USING INDEX ...

2020-09-04 Thread Laurenz Albe
On Mon, 2020-08-10 at 09:29 +0300, Anna Akenteva wrote: > On 2020-07-07 01:08, Tom Lane wrote: > > > Alvaro Herrera writes: > > > On 2020-Jul-05, Anna Akenteva wrote: > > > > -- Swapping primary key's index for an equivalent index, > > > > -- but with INCLUDE-d attributes. > > > > CREATE UNIQUE

Re: Creating foreign key on partitioned table is too slow

2020-09-04 Thread Ashutosh Bapat
On Fri, Sep 4, 2020 at 12:05 AM Tom Lane wrote: > > Amit Langote writes: > >> Fwiw, I am fine with applying the memory-leak fix in all branches down > >> to v12 if we are satisfied with the implementation. > > > I have revised the above patch slightly to introduce a variable for > > the

Re: autovac issue with large number of tables

2020-09-04 Thread Kasahara Tatsuhito
Hi, On Wed, Sep 2, 2020 at 2:10 AM Kasahara Tatsuhito wrote: > > I wonder if we could have table_recheck_autovac do two probes of the stats > > data. First probe the existing stats data, and if it shows the table to > > be already vacuumed, return immediately. If not, *then* force a stats > >

Re: Rare deadlock failure in create_am test

2020-09-04 Thread Thomas Munro
On Fri, Sep 4, 2020 at 2:13 PM Tom Lane wrote: > (There might be more such failures, but I only looked back six months, > and these two are all I found in that window.) Right: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=conchuela=2020-09-03%2023:00:36 | HEAD |

Re: INSERT ON CONFLICT and RETURNING

2020-09-04 Thread Konstantin Knizhnik
On 03.09.2020 19:56, Geoff Winkless wrote: On Mon, 31 Aug 2020 at 14:53, Konstantin Knizhnik wrote: If we are doing such query: INSERT INTO jsonb_schemas (schema) VALUES (obj_schema) ON CONFLICT (schema) DO UPDATE schema=jsonb_schemas.schema RETURNING id Then as far as I understand

Re: POC: rational number type (fractions)

2020-09-04 Thread Heikki Linnakangas
The discussion diverged somewhat to PGXN and extensions in general, but the consensus seems to be that this should (continue to) be an extension rather than a core feature. I agree that as an extension this is pretty cool. I'll mark this as rejected in the commitfest app. Looking at the

Division in dynahash.c due to HASH_FFACTOR

2020-09-04 Thread Jakub Wartak
Greetins hackers, I have mixed feelings if this welcome contribution as the potential gain is relatively small in my tests, but still I would like to point out that HASH_FFACTOR functionality from dynahash.c could be removed or optimized (default fill factor is always 1, there's not a single

Re: [PATCH] Detect escape of ErrorContextCallback stack pointers (and from PG_TRY() )

2020-09-04 Thread Craig Ringer
On Fri, 4 Sep 2020 at 14:13, Craig Ringer wrote: > > I actually had a pretty good look around for static analysis options to > see if I could find anything that might help us out before I landed up with > this approach. > Apparently not good enough.

Re: Compatible defaults for LEAD/LAG

2020-09-04 Thread Pavel Stehule
po 31. 8. 2020 v 7:05 odesílatel Pavel Stehule napsal: > > > ne 30. 8. 2020 v 23:59 odesílatel Tom Lane napsal: > >> Pavel Stehule writes: >> > This is nice example of usage of anycompatible type (that is consistent >> > with other things in Postgres), but standard says something else. >> > It

Re: [PATCH] Detect escape of ErrorContextCallback stack pointers (and from PG_TRY() )

2020-09-04 Thread Craig Ringer
On Thu, 3 Sep 2020 at 22:28, Tom Lane wrote: > Craig Ringer writes: > > The attached patch series adds support for detecting coding errors where > a > > stack-allocated ErrorContextCallback is not popped from the > > error_context_stack before the variable leaves scope. > > So my immediate