Proposal: remove string "contains errors; unaffected changes were applied"

2020-05-31 Thread Антон Пацев
Hello! When parameter cannot be changed without restarting the server postgresql write: "LOG: configuration file "/var/lib/postgresql/data/postgresql.auto.conf" contains errors; unaffected changes were applied" May be not write this string to LOG? This string confuses people. If all log send to EL

Re: Internal key management system

2020-05-31 Thread Fabien COELHO
Hello Masahiko-san, I am sharing here a document patch based on top of kms_v10 that was shared awhile back. This document patch aims to cover more design details of the current KMS design and to help people understand KMS better. Please let me know if you have any more comments. A few quest

A wrong index choose issue because of inaccurate statistics

2020-05-31 Thread Andy Fan
This thread is a follow-up of thread [1] where I don't have a good writing to describe the issue and solution in my mind. So I start this thread to fix that and also enrich the topic by taking the advices from Ashutosh, Tomas and Tom. Inaccurate statistics is not avoidable and can cause lots of is

Re: Read access for pg_monitor to pg_replication_origin_status view

2020-05-31 Thread Martín Marqués
Hi Michael, > Wouldn't it be just better to remove this hardcoded superuser check > and replace it with equivalent ACLs by default? The trick is to make > sure that any function calling replorigin_check_prerequisites() has > its execution correctly revoked from public. See for example > e79350fe

Compatible defaults for LEAD/LAG

2020-05-31 Thread Vik Fearing
I noticed that the PostgreSQL entry in a pan-database feature matrix by Modern SQL was not reflecting the reality of our features.[1] It turns out that test case used by the author produced an error which the tool took to mean the feature was not implemented. I don't have the actual test, but her

Re: Proposal: remove string "contains errors; unaffected changes were applied"

2020-05-31 Thread Justin Pryzby
On Sun, May 31, 2020 at 01:43:45PM +0600, Антон Пацев wrote: > Hello! > When parameter cannot be changed without restarting the server postgresql > write: > "LOG: configuration file "/var/lib/postgresql/data/postgresql.auto.conf" > contains errors; unaffected changes were applied" > May be not writ

Re: Compatible defaults for LEAD/LAG

2020-05-31 Thread Tom Lane
Vik Fearing writes: > postgres=# SELECT LAG(n, 1, -99) OVER (ORDER BY n) > postgres-# FROM (VALUES (1.1), (2.2), (3.3)) AS v (n) > postgres-# ORDER BY n; > ERROR: function lag(numeric, integer, integer) does not exist > LINE 1: SELECT LAG(n, 1, -99) OVER (ORDER BY n) >^

Re: Compatible defaults for LEAD/LAG

2020-05-31 Thread Vik Fearing
On 5/31/20 9:53 PM, Tom Lane wrote: > Vik Fearing writes: >> postgres=# SELECT LAG(n, 1, -99) OVER (ORDER BY n) >> postgres-# FROM (VALUES (1.1), (2.2), (3.3)) AS v (n) >> postgres-# ORDER BY n; >> ERROR: function lag(numeric, integer, integer) does not exist >> LINE 1: SELECT LAG(n, 1,

Re: Incorrect comment in be-secure-openssl.c

2020-05-31 Thread Robert Haas
On Sun, May 31, 2020 at 2:54 AM Michael Paquier wrote: > On Fri, May 29, 2020 at 02:38:53PM +0900, Michael Paquier wrote: > > Indeed, looks good to me. I'll go fix, ust let's wait and see first > > if others have any comments. > > Actually, I was reading again the new sentence, and did not like i

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

2020-05-31 Thread Bossart, Nathan
On 5/28/20, 11:42 PM, "matsumura@fujitsu.com" wrote: > I'm preparing a patch that backend inserting segment-crossboundary > WAL record leaves its EndRecPtr and someone flushing it checks > the EndRecPtr and notifies.. Thank you for sharing your thoughts. I will be happy to take a look at yo

Re: Compatible defaults for LEAD/LAG

2020-05-31 Thread Vik Fearing
On 5/31/20 9:53 PM, Tom Lane wrote: > When the anycompatible patch went in, I thought for a little bit about > trying to use it with existing built-in functions, but didn't have the > time to investigate the issue in detail. I'm not in favor of hacking > things one-function-at-a-time here; we shou

Re: Default gucs for EXPLAIN

2020-05-31 Thread David Fetter
On Tue, May 26, 2020 at 02:49:46AM +, Nikolay Samokhvalov wrote: > On Mon, May 25, 2020 at 6:36 PM, Bruce Momjian < br...@momjian.us > wrote: > > I am not excited about this new feature. Why do it only for > > EXPLAIN? That is a log of GUCs. I can see this becoming a feature > > creep disaster.

Re: segmentation fault using currtid and partitioned tables

2020-05-31 Thread Michael Paquier
On Fri, May 29, 2020 at 03:48:40PM +0900, Michael Paquier wrote: > Okay, I have switched the patch to do that. Any comments or > objections? Applied this one then. I also got to check the ODBC driver in more details, and I am indeed not seeing those functions getting used. One extra thing to kno

Re: Compatible defaults for LEAD/LAG

2020-05-31 Thread Tom Lane
Vik Fearing writes: > On 5/31/20 9:53 PM, Tom Lane wrote: >> When the anycompatible patch went in, I thought for a little bit about >> trying to use it with existing built-in functions, but didn't have the >> time to investigate the issue in detail. I'm not in favor of hacking >> things one-funct

Re: segmentation fault using currtid and partitioned tables

2020-05-31 Thread Michael Paquier
On Mon, Jun 01, 2020 at 10:57:29AM +0900, Michael Paquier wrote: > Applied this one then. I also got to check the ODBC driver in more > details, and I am indeed not seeing those functions getting used. > One extra thing to know is that the ODBC driver requires libpq from at > least 9.2, which may

Re: segmentation fault using currtid and partitioned tables

2020-05-31 Thread Tom Lane
Michael Paquier writes: > Woah. This one is old, good catch from -DRELCACHE_FORCE_RELEASE. It > happens that since its introduction in a3519a2 from 2002, > currtid_for_view() in tid.c closes the view and then looks at a RTE > from it. I have reproduced the issue and the patch attached takes > c

Re: Compatible defaults for LEAD/LAG

2020-05-31 Thread Pavel Stehule
po 1. 6. 2020 v 4:07 odesílatel Tom Lane napsal: > Vik Fearing writes: > > On 5/31/20 9:53 PM, Tom Lane wrote: > >> When the anycompatible patch went in, I thought for a little bit about > >> trying to use it with existing built-in functions, but didn't have the > >> time to investigate the issu

Re: segmentation fault using currtid and partitioned tables

2020-05-31 Thread Michael Paquier
On Sun, May 31, 2020 at 10:26:54PM -0400, Tom Lane wrote: > Ugh. Aside from the stale-pointer-deref problem, once we drop the lock > we can't even be sure the table still exists. +1 for back-patch. Thanks. Fixed down to 9.5 then to make prion happier. -- Michael signature.asc Description: PGP

Re: Inlining of couple of functions in pl_exec.c improves performance

2020-05-31 Thread Amit Khandekar
On Sun, 31 May 2020 at 08:04, Michael Paquier wrote: > This stuff is interesting. Do you have some perf profiles to share? > I am wondering what's the effect of the inlining with your test > cases. Below are the perf numbers for asignmany.sql : HEAD : + 16.88% postgres postgres [

Re: Incorrect comment in be-secure-openssl.c

2020-05-31 Thread Michael Paquier
On Sun, May 31, 2020 at 05:47:01PM -0400, Robert Haas wrote: > On Sun, May 31, 2020 at 2:54 AM Michael Paquier wrote: > I don't understand why that change is an improvement. Oops. I have managed to copy-paste an incorrect diff. The existing comment is that: * To prevent problems if the DH para

Re: Inlining of couple of functions in pl_exec.c improves performance

2020-05-31 Thread Amit Khandekar
On Sat, 30 May 2020 at 11:11, Pavel Stehule wrote: > I think so the effect of these patches strongly depends on CPU and compile I quickly tried pi() with gcc 10 as well, and saw more or less the same benefit. I think, we are bound to see some differences in the benefits across architectures, kern

Re: Internal key management system

2020-05-31 Thread Masahiko Sawada
On Sun, 31 May 2020 at 17:13, Fabien COELHO wrote: > > > Hello Masahiko-san, > > >> I am sharing here a document patch based on top of kms_v10 that was > >> shared awhile back. This document patch aims to cover more design > >> details of the current KMS design and to help people understand KMS >

Re: Inlining of couple of functions in pl_exec.c improves performance

2020-05-31 Thread Pavel Stehule
po 1. 6. 2020 v 8:15 odesílatel Amit Khandekar napsal: > On Sat, 30 May 2020 at 11:11, Pavel Stehule > wrote: > > I think so the effect of these patches strongly depends on CPU and > compile > > I quickly tried pi() with gcc 10 as well, and saw more or less the > same benefit. I think, we are bo

Re: Internal key management system

2020-05-31 Thread Masahiko Sawada
On Sat, 30 May 2020 at 04:20, Robert Haas wrote: > > On Fri, May 29, 2020 at 1:50 AM Masahiko Sawada > wrote: > > However, this usage has a downside that user secret can be logged to > > server logs when log_statement = 'all' or an error happens. To deal > > with this issue I've created a PoC pat