Re: Side effect of remove_useless_groupby_columns

2021-02-28 Thread David Rowley
On Sun, 28 Feb 2021 at 20:52, Richard Guo wrote: > When looking at [1], I realized we may have a side effect when removing > redundant columns in the GROUP BY clause. Suppose we have a query with > ORDER BY 'b', and meanwhile column 'b' is also a group key. If we decide > that 'b' is redundant due

proposal: psql –help reflecting service or URI usage

2021-02-28 Thread Paul Förster
Hi, I'd like to propose a patch to psql --help output: Currently it is: Usage: psql [OPTION]... [DBNAME [USERNAME]] ... Connection options: -h, --host=HOSTNAME database server host or socket directory (default: "local socket") -p, --port=PORT database server port (default:

Re: regexp_positions()

2021-02-28 Thread Joel Jacobson
I had a bug in the function, and I see I also accidentally renamed it to regexp_ranges(). Attached is a fixed version of the PoC. This function is e.g. useful when we're interested in patterns in meta-data, where we're not actually finding patterns in the data, but in a string where each charact

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

2021-02-28 Thread Mark Dilger
> On Feb 28, 2021, at 1:57 AM, Paul Förster wrote: > > Hi, > > I'd like to propose a patch to psql --help output: > > Currently it is: > > Usage: > psql [OPTION]... [DBNAME [USERNAME]] > > ... > > Connection options: > -h, --host=HOSTNAME database server host or socket directory (d

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

2021-02-28 Thread Paul Förster
Hi Mark, > On 28. Feb, 2021, at 17:54, Mark Dilger wrote: > > "definited" is a typo. yes, definitely a typo, sorry. Thanks for pointing this out. > Should this say "as defined in pg_service.conf"? That's the default, but the > user might have $PGSERVICEFILE set to something else. Perhaps yo

[PATCH] refactor ATExec{En,Dis}ableRowSecurity

2021-02-28 Thread Justin Pryzby
tablecmds.c is 17k lines long, this makes it ~30 lines shorter. >From 2e9500227d45142eb00e9e1ebee001642a834518 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Sat, 27 Feb 2021 20:39:10 -0600 Subject: [PATCH 1/2] Refactor ATExec{En,Dis}ableRowSecurity in the style of ATExecForceNoForceRowSecuri

alter table set TABLE ACCESS METHOD

2021-02-28 Thread Justin Pryzby
I thought this was a good idea, but didn't hear back when I raised it before. I was motivated to finally look into it by Dilip's toast compression patch, which also (can do) a table rewrite when changing a column's toast compression. I called this "set TABLE access method" rather than just "set ac

Re: [PATCH] refactor ATExec{En,Dis}ableRowSecurity

2021-02-28 Thread Zhihong Yu
Hi, For 0002-Further-refactoring.patch, should there be assertion inside ATExecSetRowSecurity() on the values for rls and force_rls ? There could be 3 possible values: -1, 0 and 1. Cheers On Sun, Feb 28, 2021 at 1:19 PM Justin Pryzby wrote: > tablecmds.c is 17k lines long, this makes it ~30 lin

Re: Remove latch.c workaround for Linux < 2.6.27

2021-02-28 Thread Thomas Munro
On Sat, Feb 27, 2021 at 9:30 PM Thomas Munro wrote: > On Sat, Feb 27, 2021 at 9:01 PM Heikki Linnakangas wrote: > > What happens if you try to try to compile or run on such an ancient kernel? > > Does it fall back to something else? Can you still make it work with > > different configure option

Re: Different compression methods for FPI

2021-02-28 Thread Justin Pryzby
On Sat, Feb 27, 2021 at 12:43:52PM +0500, Andrey Borodin wrote: > So I think it worth to propose a patch to make wal_compression_method = > {"pglz", "lz4", "zlib"}. Probably, "zstd" can be added to the list. > Attached is a draft taking CompressionId from "custom compression methods" > patch and

Re: doc review for v14

2021-02-28 Thread Justin Pryzby
On Wed, Feb 24, 2021 at 04:18:51PM +0900, Michael Paquier wrote: > This leaves 0003, 0004, 0005, 0010, 0012, 0018, 0020 and 0021 as these > did not look like improvements after review. It looks like you applied 0010...but I agree that it's not an improvement. It appears that's something I intende

Regex back-reference semantics and performance

2021-02-28 Thread Tom Lane
I noticed that some of the slowest cases in Joel's regex test corpus had issues with back-reference matching, and along the way to fixing that discovered what seems to me to be a bug in the engine's handling of back-references. To wit, what should happen if a back-reference is to a subexpression t

Re: Optimising latch signals

2021-02-28 Thread Thomas Munro
On Sat, Feb 27, 2021 at 12:04 AM Thomas Munro wrote: > I'm planning to commit this soon if there are no objections. Pushed, with the addition of an SFD_CLOEXEC flag for the signalfd. Time to watch the buildfarm to find out if my speculation about illumos is correct...

Re: [PoC] Non-volatile WAL buffer

2021-02-28 Thread Takashi Menjo
Hi Sawada, I am relieved to hear that the performance problem was solved. And I added a tip about PMEM namespace and partitioning in PG wiki[1]. Regards, [1] https://wiki.postgresql.org/wiki/Persistent_Memory_for_WAL#Configure_and_verify_DAX_hugepage_faults -- Takashi Menjo

Re: repeated decoding of prepared transactions

2021-02-28 Thread Ajin Cherian
On Sat, Feb 27, 2021 at 11:06 PM Amit Kapila wrote: > Few comments on 0002 patch: > = > 1. > + > + /* > + * Disable two-phase here, it will be set in the core if it was > + * enabled whole creating the slot. > + */ > + ctx->twophase = false; > > Typo, /whole/while. I think

Re: alter table set TABLE ACCESS METHOD

2021-02-28 Thread Michael Paquier
On Sun, Feb 28, 2021 at 04:25:30PM -0600, Justin Pryzby wrote: > I called this "set TABLE access method" rather than just "set access method" > for the reasons given on the LIKE thread: > https://www.postgresql.org/message-id/20210119210331.gn8...@telsasoft.com ALTER TABLE applies to a table (or p

Re: [BUG] segfault during delete

2021-02-28 Thread Amit Langote
On Sun, Feb 28, 2021 at 6:14 AM Álvaro Herrera wrote: > Thanks Amit for working on this fix! It seems correct to me, so I pushed it > with trivial changes. Thanks Bertrand for reporting the problem. Thanks Alvaro. > In addition to backpatching the code fix to pg12, I backpatched the test case

Re: [PATCH] pgbench: Remove ecnt, a member variable of CState

2021-02-28 Thread miyake_kouta
2021-02-28 08:06, Michael Paquier wrote: On Fri, Feb 26, 2021 at 04:36:41PM -0300, Alvaro Herrera wrote: +1 Thanks, done. -- Michael Thanks for reviewing and committing this patch! Regards -- Kota Miyake

Re: alter table set TABLE ACCESS METHOD

2021-02-28 Thread Justin Pryzby
On Mon, Mar 01, 2021 at 11:16:36AM +0900, Michael Paquier wrote: > On Sun, Feb 28, 2021 at 04:25:30PM -0600, Justin Pryzby wrote: > > I called this "set TABLE access method" rather than just "set access method" > > for the reasons given on the LIKE thread: > > https://www.postgresql.org/message-id/

Re: locking [user] catalog tables vs 2pc vs logical rep

2021-02-28 Thread Amit Kapila
On Tue, Feb 23, 2021 at 12:00 PM Amit Kapila wrote: > > On Tue, Feb 23, 2021 at 9:33 AM Andres Freund wrote: > > > > On 2021-02-23 09:24:18 +0530, Amit Kapila wrote: > > > Okay, so is it sufficient to add comments in code, or do we want to > > > add something in docs? I am not completely sure if

Re: Reducing WaitEventSet syscall churn

2021-02-28 Thread Thomas Munro
On Sat, Feb 27, 2021 at 2:48 PM Thomas Munro wrote: > Here's the alternative patch set, with no change to existing error > message behaviour. I'm going to commit this version and close this CF > item soon if there are no objections. Pushed. That leaves just walreceiver and postgres_fdw in need

Re: Update docs of logical replication for commit ce0fdbfe97.

2021-02-28 Thread Amit Kapila
On Fri, Feb 26, 2021 at 8:29 AM Amit Kapila wrote: > > We forgot to update the logical replication configuration settings > page in commit ce0fdbfe97. After commit ce0fdbfe97, table > synchronization workers also started using replication origins to > track the progress and the same should be refl

Re: 64-bit XIDs in deleted nbtree pages

2021-02-28 Thread Masahiko Sawada
On Fri, Feb 26, 2021 at 9:58 AM Peter Geoghegan wrote: > > If we don't want btvacuumcleanup() to collect index statistics, we can > > remove vacuum_cleanup_index_scale_factor (at least from btree > > perspectives), as you mentioned. One thing that may be worth > > mentioning is that the difference

Re: doc review for v14

2021-02-28 Thread Michael Paquier
On Sun, Feb 28, 2021 at 06:46:47PM -0600, Justin Pryzby wrote: > It looks like you applied 0010...but I agree that it's not an improvement. It > appears that's something I intended to go back and revisit myself. > The rest of the patch looks right, to me. Oops. This was not intended. > I'm sugg

Re: doc review for v14

2021-02-28 Thread Justin Pryzby
On Mon, Mar 01, 2021 at 01:11:10PM +0900, Michael Paquier wrote: > On Sun, Feb 28, 2021 at 06:46:47PM -0600, Justin Pryzby wrote: > > It looks like you applied 0010...but I agree that it's not an improvement. > > It > > appears that's something I intended to go back and revisit myself. > > The re

Re: Fix DROP TABLESPACE on Windows with ProcSignalBarrier?

2021-02-28 Thread Thomas Munro
On Sat, Feb 27, 2021 at 4:14 PM Thomas Munro wrote: > Here's a new version. The condition variable patch 0001 fixes a bug: > CleanupProcSignalState() also needs to broadcast. The hunk that > allows the interrupt handlers to use CVs while you're already waiting > on a CV is now in a separate patc

Re: Different compression methods for FPI

2021-02-28 Thread Michael Paquier
On Sun, Feb 28, 2021 at 05:08:17PM -0600, Justin Pryzby wrote: > Does this need to patch ./configure{,.ac} and Solution.pm for HAVE_LIBLZ4 ? > I suggest to also include an 0002 patch (not for commit) which changes to use > a > non-default compression, to exercise this on the CIs - linux and bsd >

Re: repeated decoding of prepared transactions

2021-02-28 Thread vignesh C
On Mon, Mar 1, 2021 at 7:23 AM Ajin Cherian wrote: > > On Sat, Feb 27, 2021 at 11:06 PM Amit Kapila wrote: > > > Few comments on 0002 patch: > > = > > 1. > > + > > + /* > > + * Disable two-phase here, it will be set in the core if it was > > + * enabled whole creating the

Re: [HACKERS] Custom compression methods

2021-02-28 Thread Dilip Kumar
On Sun, Feb 28, 2021 at 9:48 AM Justin Pryzby wrote: > > On my PC, this new change is causing a test failure: > > SELECT SUBSTR(f1, 2000, 50) FROM cmdata1; > - substr > - > - 012345678901234567890123456789012345678901234567

Re: Different compression methods for FPI

2021-02-28 Thread Justin Pryzby
On Mon, Mar 01, 2021 at 01:57:12PM +0900, Michael Paquier wrote: > On Sun, Feb 28, 2021 at 05:08:17PM -0600, Justin Pryzby wrote: > > Does this need to patch ./configure{,.ac} and Solution.pm for HAVE_LIBLZ4 ? > > I suggest to also include an 0002 patch (not for commit) which changes to > > use a

Re: Is Recovery actually paused?

2021-02-28 Thread Dilip Kumar
On Fri, Feb 26, 2021 at 1:33 PM Kyotaro Horiguchi wrote: > > At Thu, 25 Feb 2021 13:22:53 +0530, Dilip Kumar wrote > in > > On Thu, Feb 25, 2021 at 12:42 PM Kyotaro Horiguchi > > wrote: > > > The latest version applies (almost) cleanly to the current master and > > > works fine. > > > I don't h

Re: Printing backtrace of postgres processes

2021-02-28 Thread torikoshia
Hi, I also think this feature would be useful when supporting environments that lack debugger or debug symbols. I think such environments are not rare. + for more information. This +will help in identifying where exactly the backend process is currently +executing. W

Re: Speeding up GIST index creation for tsvectors

2021-02-28 Thread Amit Khandekar
I have added this one in the March commitfest. https://commitfest.postgresql.org/32/3023/

Re: Add client connection check during the execution of the query

2021-02-28 Thread Thomas Munro
On Sat, Aug 3, 2019 at 4:40 AM Konstantin Knizhnik wrote: > On 18.07.2019 6:19, Tatsuo Ishii wrote: > > So the performance is about 5% down with the feature enabled in this > > case. For me, 5% down is not subtle. Probably we should warn this in > > the doc. > > I also see some performance degrad

Re: [HACKERS] Custom compression methods

2021-02-28 Thread Justin Pryzby
On Mon, Mar 01, 2021 at 10:32:23AM +0530, Dilip Kumar wrote: > On Sun, Feb 28, 2021 at 9:48 AM Justin Pryzby wrote: > > > > On my PC, this new change is causing a test failure: > > > > SELECT SUBSTR(f1, 2000, 50) FROM cmdata1; > > - substr > > ---

Re: [HACKERS] Custom compression methods

2021-02-28 Thread Dilip Kumar
On Sat, Feb 27, 2021 at 9:35 PM Justin Pryzby wrote: > > > Subject: [PATCH v28 3/4] Add default_toast_compression GUC > > This part isn't working. My first patch worked somewhat better: due to doing > strcmp() with the default GUC, it avoided using the cached AM OID. (But it > would've failed wi

Re: repeated decoding of prepared transactions

2021-02-28 Thread Amit Kapila
On Mon, Mar 1, 2021 at 7:23 AM Ajin Cherian wrote: > Pushed, the first patch in the series. -- With Regards, Amit Kapila.

Re: simplifying foreign key/RI checks

2021-02-28 Thread Corey Huinker
> > > It seems to me 1 (RI_PLAN_CHECK_LOOKUPPK) is still alive. (Yeah, I > > know that doesn't mean the usefulness of the macro but the mechanism > > the macro suggests, but it is confusing.) On the other hand, > > RI_PLAN_CHECK_LOOKUPPK_FROM_PK and RI_PLAN_LAST_ON_PK seem to be no > > longer used.

Re: doc review for v14

2021-02-28 Thread Michael Paquier
On Sun, Feb 28, 2021 at 10:33:55PM -0600, Justin Pryzby wrote: > I still have an issue with the sentence that begins: > "Checksums are normally enabled..." You could say here "Checksums can be enabled", but "normally" does not sound bad to me either as it insists on the fact that it is better to d

Re: [PATCH] refactor ATExec{En,Dis}ableRowSecurity

2021-02-28 Thread Michael Paquier
On Sun, Feb 28, 2021 at 02:27:44PM -0800, Zhihong Yu wrote: > For 0002-Further-refactoring.patch, should there be assertion > inside ATExecSetRowSecurity() on the values for rls and force_rls ? > There could be 3 possible values: -1, 0 and 1. 0001 is a clean simplification and a good catch, so I'l

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

2021-02-28 Thread Amit Langote
On Mon, Mar 1, 2021 at 12:38 PM Greg Nancarrow wrote: > On Fri, Feb 26, 2021 at 5:50 PM Amit Langote wrote: > > > > On Fri, Feb 26, 2021 at 3:35 PM Greg Nancarrow wrote: > > > On Fri, Feb 26, 2021 at 4:07 PM Amit Langote > > > wrote: > > > > The attached patch fixes this, although I am startin

Re: Side effect of remove_useless_groupby_columns

2021-02-28 Thread Richard Guo
Hi, On Sun, Feb 28, 2021 at 5:15 PM David Rowley wrote: > On Sun, 28 Feb 2021 at 20:52, Richard Guo wrote: > > When looking at [1], I realized we may have a side effect when removing > > redundant columns in the GROUP BY clause. Suppose we have a query with > > ORDER BY 'b', and meanwhile colum

Re: macOS SIP, next try

2021-02-28 Thread Peter Eisentraut
So, we haven't gotten anywhere satisfying with these proposed technical solutions. I have since learned that there is a way to disable only the part of SIP that is relevant for us. This seems like a useful compromise, and it appears that a number of other open-source projects are following

[PATCH] postgres-fdw: column option to override foreign types

2021-02-28 Thread Dian M Fay
Full use of a custom data type with postgres_fdw currently requires the type be maintained in both the local and remote databases. `CREATE FOREIGN TABLE` does not check declared types against the remote table, but declaring e.g. a remote enum to be local text works only partway, as seen here. A sim

Re: archive_command / pg_stat_archiver & documentation

2021-02-28 Thread Michael Paquier
On Fri, Feb 26, 2021 at 10:03:05AM +0100, Benoit Lobréau wrote: > Done here : https://commitfest.postgresql.org/32/3012/ Documenting that properly for the archive command, as already done for restore_command, sounds good to me. I am not sure that there is much point in doing a cross-reference to

Re: proposal: schema variables

2021-02-28 Thread Pavel Stehule
út 16. 2. 2021 v 18:46 odesílatel Pavel Stehule napsal: > Hi > > út 2. 2. 2021 v 9:43 odesílatel Pavel Stehule > napsal: > >> Hi >> >> rebase and set PK for pg_variable table >> > > rebase > rebase > Pavel > > >> Regards >> >> Pavel >> > schema-variables-20200301.patch.gz Description: appl

Re: archive_command / pg_stat_archiver & documentation

2021-02-28 Thread Julien Rouhaud
On Mon, Mar 1, 2021 at 3:36 PM Michael Paquier wrote: > > On Fri, Feb 26, 2021 at 10:03:05AM +0100, Benoit Lobréau wrote: > > Done here : https://commitfest.postgresql.org/32/3012/ > > Documenting that properly for the archive command, as already done for > restore_command, sounds good to me. I a