Re: PATCH: psql tab completion for SELECT

2021-10-08 Thread David Fetter
On Sat, Sep 22, 2018 at 06:53:55PM +1200, Edmund Horner wrote: > Hi all, > > Here are some rebased versions of the last two patches. No changes in > functionality, except a minor case sensitivity fix in the "completion > after commas" patch. > > Edmund I've rebased and updated these to be more

Re: should we allow users with a predefined role to access pg_backend_memory_contexts view and pg_log_backend_memory_contexts function?

2021-10-08 Thread Bharath Rupireddy
On Fri, Oct 8, 2021 at 12:27 AM Bossart, Nathan wrote: > > On 10/7/21, 10:42 AM, "Bharath Rupireddy" > wrote: > > In a typical production environment, the user (not necessarily a > > superuser) sometimes wants to analyze the memory usage via > > pg_backend_memory_contexts view or

Re: More business with $Test::Builder::Level in the TAP tests

2021-10-08 Thread Daniel Gustafsson
> On 7 Oct 2021, at 03:53, Michael Paquier wrote: > > On Wed, Oct 06, 2021 at 07:33:22AM -0400, Andrew Dunstan wrote: >> We should probably state a requirement for this somewhere. Maybe in >> src/test/perl/README. AIUI, the general rule is that any subroutine that >> directly or indirectly calls

Re: Improve the HINT message of the ALTER command for postgres_fdw

2021-10-08 Thread Bharath Rupireddy
On Fri, Oct 8, 2021 at 12:48 PM bt21masumurak wrote: > > Hi > > When 'ALTER FOREIGN DATA WRAPPER OPTIONS' is executed against > postgres_fdw, the HINT message is printed as shown below, even though > there are no valid options in this context. > > =# ALTER FOREIGN DATA WRAPPER postgres_fdw

Re: More business with $Test::Builder::Level in the TAP tests

2021-10-08 Thread Daniel Gustafsson
> On 8 Oct 2021, at 09:51, Michael Paquier wrote: > > On Fri, Oct 08, 2021 at 09:28:04AM +0200, Daniel Gustafsson wrote: >> LGTM. Maybe it should be added that it *must* be called before any >> Test::More >> function is called, it's sort of self-explanatory but not everyone writing >> TAP >>

RE: Skipping logical replication transactions on subscriber side

2021-10-08 Thread osumi.takami...@fujitsu.com
On Thursday, September 30, 2021 2:45 PM Masahiko Sawada wrote: > I've attached updated patches that incorporate all comments I got so far. > Please > review them. Hi Sorry, if I misunderstand something but did someone check what happens when we execute ALTER SUBSCRIPTION ... RESET (streaming)

Re: More business with $Test::Builder::Level in the TAP tests

2021-10-08 Thread Michael Paquier
On Fri, Oct 08, 2021 at 09:28:04AM +0200, Daniel Gustafsson wrote: > LGTM. Maybe it should be added that it *must* be called before any Test::More > function is called, it's sort of self-explanatory but not everyone writing TAP > tests will be deeply familiar with Perl. I think that "must" is

Re: storing an explicit nonce

2021-10-08 Thread Antonin Houska
Stephen Frost wrote: > Greetings, > > * Robert Haas (robertmh...@gmail.com) wrote: > > On Thu, Oct 7, 2021 at 3:38 PM Stephen Frost wrote: > > > While I certainly also appreciate that we want to get this as right as > > > we possibly can from the start, I strongly suspect we'll have one of two

Improve the HINT message of the ALTER command for postgres_fdw

2021-10-08 Thread bt21masumurak
Hi When 'ALTER FOREIGN DATA WRAPPER OPTIONS' is executed against postgres_fdw, the HINT message is printed as shown below, even though there are no valid options in this context. =# ALTER FOREIGN DATA WRAPPER postgres_fdw OPTIONS (format 'csv'); ERROR: invalid option "format" HINT: Valid

Re: Map WAL segment files on PMEM as WAL buffers

2021-10-08 Thread Takashi Menjo
Hello Matthias, Thank you for your comment! > > [ v3-0002-Add-wal_pmem_map-to-GUC.patch ] > > +extern bool wal_pmem_map; > > A lot of the new code in these patches is gated behind this one flag, > but the flag should never be true on !pmem systems. Could you instead > replace it with something

Re: [BUG] Logical replication failure "ERROR: could not map filenode "base/13237/442428" to relation OID" with catalog modifying txns

2021-10-08 Thread Kyotaro Horiguchi
At Thu, 7 Oct 2021 13:20:14 +0900, Masahiko Sawada wrote in > Another idea to fix this problem would be that before calling > SnapBuildCommitTxn() we create transaction entries in ReorderBuffer > for (sub)transactions whose COMMIT record has XACT_XINFO_HAS_INVALS, > and then mark all of them as

Re: Improve the HINT message of the ALTER command for postgres_fdw

2021-10-08 Thread Daniel Gustafsson
> On 8 Oct 2021, at 09:38, Bharath Rupireddy > wrote: > > On Fri, Oct 8, 2021 at 12:48 PM bt21masumurak > wrote: >> >> Hi >> >> When 'ALTER FOREIGN DATA WRAPPER OPTIONS' is executed against >> postgres_fdw, the HINT message is printed as shown below, even though >> there are no valid options

Re: Logical replication timeout problem

2021-10-08 Thread Fabrice Chapuis
Thanks Tang for your script. Our debugging environment will be ready soon. I will test your script and we will try to reproduce the problem by integrating the patch provided by Amit. As soon as I have results I will let you know. Regards Fabrice On Thu, Sep 30, 2021 at 3:15 AM Tang, Haiying/唐

Re: pgsql: Adjust configure to insist on Perl version >= 5.8.3.

2021-10-08 Thread Daniel Gustafsson
> On 8 Oct 2021, at 06:24, Noah Misch wrote: > > On Thu, Oct 07, 2021 at 11:39:11PM -0400, Tom Lane wrote: >> Noah Misch writes: >>> On Thu, Oct 07, 2021 at 03:44:48PM -0400, Tom Lane wrote: > (1) I'm distrustful of the idea that perl 5.8.x will compile > cleanly, or at all, on modern

Re: Add ZSON extension to /contrib/

2021-10-08 Thread Aleksander Alekseev
Hi hackers, Many thanks for all the great feedback! Please see the follow-up thread `RFC: compression dictionaries for JSONB`: https://www.postgresql.org/message-id/CAJ7c6TPx7N-bVw0dZ1ASCDQKZJHhBYkT6w4HV1LzfS%2BUUTUfmA%40mail.gmail.com -- Best regards, Aleksander Alekseev Open-Source

Reword docs of feature "Remove temporary files after backend crash"

2021-10-08 Thread Bharath Rupireddy
Hi, The commit [1] for the feature "Remove temporary files after backend crash" introduced following in the docs: + +When set to on, which is the default, +PostgreSQL will automatically remove +temporary files after a backend crash. If disabled, the files will be +

Re: Capitalization of localized month and day names (to_char() with 'TMmonth', 'TMday', etc.)

2021-10-08 Thread Magnus Holmgren
onsdag 6 oktober 2021 kl. 16:01:49 CEST skrev du: > =?UTF-8?Q?Juan_Jos=C3=A9_Santamar=C3=ADa_Flecha?= writes: > > On Wed, Oct 6, 2021 at 11:09 AM Magnus Holmgren > > > > > wrote: > >> There's just this tiny but seemingly obvious issue that I can't believe I > >> haven't noticed until now:

Re: Added schema level support for publication.

2021-10-08 Thread Amit Kapila
On Thu, Oct 7, 2021 at 5:19 PM Amit Kapila wrote: > > On Wed, Oct 6, 2021 at 11:12 AM vignesh C wrote: > > > > Attached v37 patch has the changes for the same. > > > > Few comments: > == > Few more comments:

RFC: compression dictionaries for JSONB

2021-10-08 Thread Aleksander Alekseev
Hi hackers, == Background == This is a follow-up thread to `Add ZSON extension to /contrib/` [1]. The ZSON extension introduces a new type called ZSON, which is 100% compatible with JSONB but uses a shared dictionary of strings most frequently used by given JSONB documents for compression. See

Re: Time to upgrade buildfarm coverage for some EOL'd OSes?

2021-10-08 Thread Mikael Kjellström
On 2021-10-08 00:15, Thomas Munro wrote: I noticed that for NetBSD we only have one animal, and it's running EOL'd release 7. To give decent visibility of relevant portability problems it'd be nice to have one of the current supported releases[1] in there. CC'ing owner; any interest in

Re: Skipping logical replication transactions on subscriber side

2021-10-08 Thread Greg Nancarrow
On Thu, Sep 30, 2021 at 3:45 PM Masahiko Sawada wrote: > > I've attached updated patches that incorporate all comments I got so > far. Please review them. > Some comments about the v15-0001 patch: (1) patch adds a whitespace error Applying: Add a subscription errors statistics view

Re: psql - add SHOW_ALL_RESULTS option

2021-10-08 Thread Peter Eisentraut
On 02.10.21 16:31, Fabien COELHO wrote: Attached v9 integrates your tests and makes them work. Attached v11 is a rebase. This patch still has a few of the problems reported earlier this year. In [0], it was reported that certain replication commands result in infinite loops because of

Re: Time to upgrade buildfarm coverage for some EOL'd OSes?

2021-10-08 Thread Mikael Kjellström
On 2021-10-08 18:12, Tom Lane wrote: =?UTF-8?Q?Mikael_Kjellstr=c3=b6m?= writes: Yes, it's getting long in the tooth. I will upgrade the NetBSD 7 (sidewinder) to 9.2. And I will also upgrade loach to 12.x if that's the version that is needed the most. I will upgrade conchuela to DragonFlyBSD

Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)

2021-10-08 Thread Andres Freund
Hi, On 2021-10-01 16:05:31 -0400, Melanie Plageman wrote: > From 40c809ad1127322f3462e85be080c10534485f0d Mon Sep 17 00:00:00 2001 > From: Melanie Plageman > Date: Fri, 24 Sep 2021 17:39:12 -0400 > Subject: [PATCH v13 1/4] Allow bootstrap process to beinit > > --- >

RE: Skipping logical replication transactions on subscriber side

2021-10-08 Thread osumi.takami...@fujitsu.com
On Thursday, September 30, 2021 2:45 PM Masahiko Sawada wrote: > I've attached updated patches that incorporate all comments I got so far. > Please > review them. Hello Minor two comments for v15-0001 patch. (1) a typo in pgstat_vacuum_subworker_stat() + /* +*

Re: document the need to analyze partitioned tables

2021-10-08 Thread Justin Pryzby
Cleaned up and attached as a .patch. The patch implementing autoanalyze on partitioned tables should revert relevant portions of this patch. >From cec31df3772ca51bbf14ebee207bcfd22e498073 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Thu, 22 Jul 2021 16:06:18 -0500 Subject: [PATCH]

Re: RFC: compression dictionaries for JSONB

2021-10-08 Thread Matthias van de Meent
On Fri, 8 Oct 2021 at 17:19, Alvaro Herrera wrote: > > On 2021-Oct-08, Matthias van de Meent wrote: > > > On Fri, 8 Oct 2021 at 11:47, Aleksander Alekseev > > wrote: > > > > In order to do this, the SQL syntax should be modified. The proposed > > > syntax is based on Matthias van de Meent's idea

Re: Parallel vacuum workers prevent the oldest xmin from advancing

2021-10-08 Thread Peter Geoghegan
On Fri, Oct 8, 2021 at 8:13 AM Alvaro Herrera wrote: > On 2021-Oct-06, Masahiko Sawada wrote: > > A customer reported that during parallel index vacuum, the oldest xmin > > doesn't advance. Normally, the calculation of oldest xmin > > (ComputeXidHorizons()) ignores xmin/xid of processes having >

Query rewrite(optimization) using constraints

2021-10-08 Thread Lily Liu
Hi, hackers I notice that postgres use constraints to optimize/rewrite queries in limited cases as https://www.postgresql.org/docs/current/runtime-config-query.html#GUC-CONSTRAINT-EXCLUSION . I propose two new types of query rewrites using constraints here 1) Remove DISTINCT A simple example

Re: Query rewrite(optimization) using constraints

2021-10-08 Thread Justin Pryzby
On Fri, Oct 08, 2021 at 10:24:33AM -0700, Lily Liu wrote: > 1) Remove DISTINCT > > A simple example is SELECT DISTINCT(name) FROM R. If there is a unique > constraint on the name column. The DISTINCT keyword can be removed safely. > Query plans without the DISTINCT keyword might be much cheaper

Re: storing an explicit nonce

2021-10-08 Thread Stephen Frost
Greetings, * Antonin Houska (a...@cybertec.at) wrote: > Stephen Frost wrote: > > * Robert Haas (robertmh...@gmail.com) wrote: > > > On Thu, Oct 7, 2021 at 3:38 PM Stephen Frost wrote: > > > > While I certainly also appreciate that we want to get this as right as > > > > we possibly can from the

Re: Query rewrite(optimization) using constraints

2021-10-08 Thread Tom Lane
Lily Liu writes: > I propose two new types of query rewrites using constraints here > 1) Remove DISTINCT > A simple example is SELECT DISTINCT(name) FROM R. If there is a unique > constraint on the name column. The DISTINCT keyword can be removed safely. > Query plans without the DISTINCT

Re: dfmgr additional ABI version fields

2021-10-08 Thread Peter Eisentraut
On 07.10.21 21:15, Tom Lane wrote: Chapman Flack writes: On 10/07/21 12:42, Tom Lane wrote: Can we make the addition be a string not a number, so that we could include something more useful than "1234" in the error message? Just using a string like "EDB v" + something would probably rule

Re: Parallel vacuum workers prevent the oldest xmin from advancing

2021-10-08 Thread Alvaro Herrera
On 2021-Oct-06, Masahiko Sawada wrote: > Hi all, > > A customer reported that during parallel index vacuum, the oldest xmin > doesn't advance. Normally, the calculation of oldest xmin > (ComputeXidHorizons()) ignores xmin/xid of processes having > PROC_IN_VACUUM flag in MyProc->statusFlags. But

Re: pgsql: Adjust configure to insist on Perl version >= 5.8.3.

2021-10-08 Thread Tom Lane
Daniel Gustafsson writes: > On 8 Oct 2021, at 06:24, Noah Misch wrote: >> That's obvious from "cpanm install IPC::Run". Surely if any other non-core >> module were allowed, the recipe would list it in a similar way. > The proposed changes talks about with core modules are allowed to use, I

Re: More business with $Test::Builder::Level in the TAP tests

2021-10-08 Thread Andrew Dunstan
On 10/6/21 9:53 PM, Michael Paquier wrote: > On Wed, Oct 06, 2021 at 07:33:22AM -0400, Andrew Dunstan wrote: >> We should probably state a requirement for this somewhere. Maybe in >> src/test/perl/README. AIUI, the general rule is that any subroutine that >> directly or indirectly calls ok() and

Re: Compressing temporary files

2021-10-08 Thread Bharath Rupireddy
On Sat, Sep 11, 2021, 6:01 PM Andrey Borodin wrote: > > Hi hackers! > > There's a lot of compression discussions nowadays. And that's cool! > Recently Naresh Chainani in private discussion shared with me the idea to > compress temporary files on disk. > And I was thrilled to find no evidence of

Re: RFC: compression dictionaries for JSONB

2021-10-08 Thread Matthias van de Meent
On Fri, 8 Oct 2021 at 11:47, Aleksander Alekseev wrote: > This is a follow-up thread to `Add ZSON extension to /contrib/` [1]. > The ZSON extension introduces a new type called ZSON, which is 100% > compatible with JSONB but uses a shared dictionary of strings most > frequently used by given

Re: RFC: compression dictionaries for JSONB

2021-10-08 Thread Alvaro Herrera
On 2021-Oct-08, Matthias van de Meent wrote: > On Fri, 8 Oct 2021 at 11:47, Aleksander Alekseev > wrote: > > In order to do this, the SQL syntax should be modified. The proposed > > syntax is based on Matthias van de Meent's idea [6]: > > Seems fine > > > ``` > > CREATE TYPE AS

Re: Fix pg_log_backend_memory_contexts() 's delay

2021-10-08 Thread Fujii Masao
On 2021/10/06 17:14, bt21tanigaway wrote: Thanks for your review. Thanks for the patch. Do we also need to do the change in HandleMainLoopInterrupts, HandleCheckpointerInterrupts, HandlePgArchInterrupts, HandleWalWriterInterrupts as we don't call CHECK_FOR_INTERRUPTS() there? Yeah,

Re: pgbench bug candidate: negative "initial connection time"

2021-10-08 Thread Fujii Masao
On 2021/10/01 15:27, Michael Paquier wrote: On Wed, Sep 29, 2021 at 10:11:53PM +0900, Fujii Masao wrote: BTW, when logfile fails to be opened, pgbench gets stuck due to commit aeb57af8e6. So even if we decided not to back-patch those changes, we should improve the handling of logfile open

Re: Time to upgrade buildfarm coverage for some EOL'd OSes?

2021-10-08 Thread Tom Lane
=?UTF-8?Q?Mikael_Kjellstr=c3=b6m?= writes: > Yes, it's getting long in the tooth. I will upgrade the NetBSD 7 > (sidewinder) to 9.2. > And I will also upgrade loach to 12.x if that's the version that is > needed the most. > I will upgrade conchuela to DragonFlyBSD 6.0. > I will remove the 5.9

Re: should we allow users with a predefined role to access pg_backend_memory_contexts view and pg_log_backend_memory_contexts function?

2021-10-08 Thread Bharath Rupireddy
On Sat, Oct 9, 2021 at 12:45 AM Stephen Frost wrote: > > Greetings, > > * Bossart, Nathan (bossa...@amazon.com) wrote: > > On 10/8/21, 12:01 AM, "Bharath Rupireddy" > > wrote: > > > I think we can remove the below revoke statements from > > > system_views.sql and place the checks shown at (2)

Re: Role Self-Administration

2021-10-08 Thread Mark Dilger
> On Oct 7, 2021, at 7:44 PM, Stephen Frost wrote: > > I don't actually think REVOKE ROLE CASCADE must not fail, nor do I see > that as explicit in anything you quote above. I don't see that myself, but I thought that you would, given your other statements about how we shouldn't take a spec

logical decoding/replication: new functions pg_ls_logicaldir and pg_ls_replslotdir

2021-10-08 Thread Bharath Rupireddy
Hi, At times, users want to know what are the files (snapshot and mapping files) that are available under pg_logical directory and also the spill files that are under pg_replslot directory and how much space they occupy. This will help to better know the storage usage pattern of these

Re: Running tests under valgrind is getting slower at an alarming pace

2021-10-08 Thread Andres Freund
On 2021-10-08 15:41:09 -0400, Andrew Dunstan wrote: > see > Thanks!

Re: should we allow users with a predefined role to access pg_backend_memory_contexts view and pg_log_backend_memory_contexts function?

2021-10-08 Thread Stephen Frost
Greetings, * Bossart, Nathan (bossa...@amazon.com) wrote: > On 10/8/21, 12:01 AM, "Bharath Rupireddy" > wrote: > > I think we can remove the below revoke statements from > > system_views.sql and place the checks shown at (2) in the underlying > > functions pg_get_shmem_allocations,

Re: Running tests under valgrind is getting slower at an alarming pace

2021-10-08 Thread Andrew Dunstan
On 10/6/21 10:03 PM, Andres Freund wrote: > Hi, > > On 2021-10-06 09:47:54 -0700, Andres Freund wrote: >> I'll also try to figure out print a bit more detail about timing for each tap >> test, looks like I need to figure out how to pass PROVE_TEST='--timer' >> through >> the buildfarm.

Re: Time to upgrade buildfarm coverage for some EOL'd OSes?

2021-10-08 Thread Thomas Munro
On Sat, Oct 9, 2021 at 5:55 AM Mikael Kjellström wrote: > On 2021-10-08 18:12, Tom Lane wrote: > > =?UTF-8?Q?Mikael_Kjellstr=c3=b6m?= writes: > >> Yes, it's getting long in the tooth. I will upgrade the NetBSD 7 > >> (sidewinder) to 9.2. > >> And I will also upgrade loach to 12.x if that's the

Re: RFC: compression dictionaries for JSONB

2021-10-08 Thread Alvaro Herrera
On 2021-Oct-08, Matthias van de Meent wrote: > That's a good point, but if we're extending this syntax to allow the > ability of including other types, then I'd instead extend the syntax > that of below, so that the type of the dictionary entries is required > in the syntax: > > CREATE TYPE name