Re: [PATCH] Implement motd for PostgreSQL

2021-04-03 Thread Joel Jacobson
On Sat, Apr 3, 2021, at 17:50, Fabien COELHO wrote: > > Perhaps the configuration-file parser has been fixed since to support > > embedded newlines? If so, then maybe it would actually be an idea to > > support newlines by escaping them? > > Dunno. > > If such a feature gets considered, I'm

Re: Crash in BRIN minmax-multi indexes

2021-04-03 Thread Jaime Casanova
On Thu, Apr 01, 2021 at 03:22:59PM +0200, Tomas Vondra wrote: > On 4/1/21 3:09 PM, Zhihong Yu wrote: > > Hi, > > Can you try this patch ? > > > > Thanks > > > > diff --git a/src/backend/access/brin/brin_minmax_multi.c > > b/src/backend/access/brin/brin_minmax_multi.c > > index

Re: TRUNCATE on foreign table

2021-04-03 Thread Kohei KaiGai
2021年4月4日(日) 13:07 Bharath Rupireddy : > > On Sat, Apr 3, 2021 at 8:31 PM Zhihong Yu wrote: > > w.r.t. Bharath's question on using hash table, I think the reason is that > > the search would be more efficient: > > Generally, sequential search would be slower if there are many entries > in a

Re: Unused variable found in AttrDefaultFetch

2021-04-03 Thread Tom Lane
Michael Paquier writes: > On Sun, Apr 04, 2021 at 10:13:26AM +0530, Bharath Rupireddy wrote: >> +1 to remove it and the patch LGTM. > Indeed, there is no point to keep that around. I'll go clean up that > as you propose. What Andrew was suggesting in the other thread might well result in

Re: Unused variable found in AttrDefaultFetch

2021-04-03 Thread Michael Paquier
On Sun, Apr 04, 2021 at 10:13:26AM +0530, Bharath Rupireddy wrote: > +1 to remove it and the patch LGTM. Indeed, there is no point to keep that around. I'll go clean up that as you propose. -- Michael signature.asc Description: PGP signature

Re: Unused variable found in AttrDefaultFetch

2021-04-03 Thread Bharath Rupireddy
On Sun, Apr 4, 2021 at 8:14 AM Zhihong Yu wrote: > > Hi, > I was looking at AttrDefaultFetch and saw that the variable found is never > read. > > I think it can be removed. See attached patch. +1 to remove it and the patch LGTM. For reference, below is the commit that removed last usage of

Re: TRUNCATE on foreign table

2021-04-03 Thread Bharath Rupireddy
On Sat, Apr 3, 2021 at 8:31 PM Zhihong Yu wrote: > w.r.t. Bharath's question on using hash table, I think the reason is that the > search would be more efficient: Generally, sequential search would be slower if there are many entries in a list. Here, the use case is to store all the foreign

RE: Stronger safeguard for archive recovery not to miss data

2021-04-03 Thread osumi.takami...@fujitsu.com
On Friday, April 2, 2021 11:49 PM Laurenz Albe wrote: > On Thu, 2021-04-01 at 17:25 +0900, Fujii Masao wrote: > > Thanks for updating the patch! > > > > +errhint("Use a backup taken after > setting wal_level to higher than minimal " > > +

RE: Stronger safeguard for archive recovery not to miss data

2021-04-03 Thread osumi.takami...@fujitsu.com
On Thursday, April 1, 2021 5:25 PM Fujii Masao wrote: > On 2021/04/01 12:45, osumi.takami...@fujitsu.com wrote: > > Thank you for sharing your ideas about the hint. Absolutely need to change > the message. > > In my opinion, combining the basic idea of yours and Fujii-san's would be > the best.

Unused variable found in AttrDefaultFetch

2021-04-03 Thread Zhihong Yu
Hi, I was looking at AttrDefaultFetch and saw that the variable found is never read. I think it can be removed. See attached patch. Cheers def-fetch-found.patch Description: Binary data

Re: ALTER TABLE ADD COLUMN fast default

2021-04-03 Thread Tom Lane
Andrew Gierth writes: > I just got through diagnosing a SEGV crash with someone on IRC, and the > cause turned out to be exactly this - a table had (for some reason we > could not determine within the available resources) lost its pg_attrdef > record for the one column it had with a default

Re: Lowering the ever-growing heap->pd_lower

2021-04-03 Thread Peter Geoghegan
On Wed, Mar 31, 2021 at 2:49 AM Matthias van de Meent wrote: > I had implemented it locally, but was waiting for some more feedback > before posting that and got busy with other stuff since, it's now > attached. > > I've also played around with marking the free space on the page as > undefined

[PATCH] force_parallel_mode and GUC categories

2021-04-03 Thread Justin Pryzby
Forking this thread https://www.postgresql.org/message-id/20210403154336.GG29125%40momjian.us On Sat, Apr 3, 2021 at 08:38:18PM +0530, aditya desai wrote: > > > >> Yes, force_parallel_mode is on. Should we set it off? Bruce Momjian writes: > > > > Yes. I bet someone set it without reading our

Re: ModifyTable overheads in generic plans

2021-04-03 Thread Tom Lane
Amit Langote writes: > On Thu, Apr 1, 2021 at 3:12 AM Tom Lane wrote: >> Amit Langote writes: > [ v14-0002-Initialize-result-relation-information-lazily.patch ] >> Needs YA rebase over 86dc90056. > Done. I spent some time looking this over. There are bits of it we can adopt without too much

Re: ALTER TABLE ADD COLUMN fast default

2021-04-03 Thread Andrew Gierth
[warning, reviving a thread from 2018] > "Andrew" == Andrew Dunstan writes: > On Wed, Feb 21, 2018 at 7:48 PM, Andres Freund wrote: >> Hi, Andrew> Comments interspersed. >>> @@ -4059,10 +4142,6 @@ AttrDefaultFetch(Relation relation) >>> >>> systable_endscan(adscan); >>>

Allowing dsm allocations in single user mode

2021-04-03 Thread Andres Freund
Hi, Right now dsm_create() has the following assertion: /* Unsafe in postmaster (and pointless in a stand-alone backend). */ Assert(IsUnderPostmaster); I agree with the "unsafe in postmaster" bit. But I'm not convinced by the "pointless in a stand-alone backend" part. We're

Re: Confusing behavior of psql's \e

2021-04-03 Thread Tom Lane
Laurenz Albe writes: > Attached is version 6. Pushed with some mostly-cosmetic fiddling. One thing I changed that wasn't cosmetic is that as you had it, the behavior of "\e file" varied depending on whether the query buffer had been empty, which surely seems like a bad idea. I made it do

Re: insensitive collations

2021-04-03 Thread Daniel Verite
Jim Finnerty wrote: > SET client_encoding = WIN1252; > [...] > postgres=# SELECT * FROM locations WHERE location LIKE 'Franche-Comt__'; -- > the wildcard is applied byte by byte instead of character by character, so > the 2-byte accented character is matched only by 2 '_'s >location

Re: SP-GiST confusion: indexed column's type vs. index column type

2021-04-03 Thread Tom Lane
Here's a patch that, in addition to what I mentioned upthread, rescinds the limitation that user-defined SPGIST opclasses can't set the STORAGE parameter, and cleans up some residual confusion about whether values are of the indexed type (attType) or the storage type (leafType). Once I'd wrapped

Re: MultiXact\SLRU buffers configuration

2021-04-03 Thread Andrey Borodin
> 1 апр. 2021 г., в 06:40, Thomas Munro написал(а): > > 2. Remove the cap of 128 buffers for xact_buffers as agreed. We > still need a cap though, to avoid a couple of kinds of overflow inside > slru.c, both when computing the default value and accepting a > user-provided number. I

Re: Autovacuum on partitioned table (autoanalyze)

2021-04-03 Thread Alvaro Herrera
Thanks for the quick rework. I like this design much better and I think this is pretty close to committable. Here's a rebased copy with some small cleanups (most notably, avoid calling pgstat_propagate_changes when the partition doesn't have a tabstat entry; also, free the lists that are

Re: [PATCH] Implement motd for PostgreSQL

2021-04-03 Thread Alvaro Herrera
On 2021-Apr-03, Joel Jacobson wrote: > I'm actually using it myself in production for something, to display > instructions to users when they login. Yeah, such as "If your CREATE sentences don't work, please run CREATE SCHEMA AUTHORIZATION CURRENT_USER" for systems where the PUBLIC schema has

Re: Making wait events a bit more efficient

2021-04-03 Thread Andres Freund
On 2021-04-02 19:55:16 -0700, Andres Freund wrote: > On 2021-04-02 12:44:58 -0700, Andres Freund wrote: > > If we went for the my_wait_event_info approach there is one further > > advantage, after my change to move the wait event code into a separate > > file: wait_event.h does not need to include

Re: Additional Chapter for Tutorial - arch-dev.sgml

2021-04-03 Thread Alvaro Herrera
On 2021-Apr-03, Jürgen Purtz wrote: > On 03.04.21 15:39, Alvaro Herrera wrote: > > Yes, there is. AFAICS Heikki committed a small wordsmithing patch -- > > not the large patch with the additional chapter. > > What can i do to move the matter forward? Please post a version that applies to the

Re: [PATCH] Implement motd for PostgreSQL

2021-04-03 Thread Chapman Flack
On 04/03/21 14:24, Joel Jacobson wrote: > Thanks for noticing. > I've updated the ascii art now using the version from swisspug.org, > does it look correct now to you? > > $ psql -U brad -h pit.org motd > > NOTICE: > __ ___ > /)/ \/ \ > ( / ___\) > \(/ o)

Re: [PATCH] Implement motd for PostgreSQL

2021-04-03 Thread Joel Jacobson
On Sat, Apr 3, 2021, at 15:43, Chapman Flack wrote: > Now there's some kind of Max Headroom thing going on with the second row, > and this time I'm not sure how to explain it. (I knew the backslashes were > because they weren't doubled.) > > I have done 'view source' in my mail client to make

Re: multi-install PostgresNode fails with older postgres versions

2021-04-03 Thread Andrew Dunstan
On 3/31/21 10:28 PM, Mark Dilger wrote: > >> On Mar 31, 2021, at 1:07 PM, Mark Dilger >> wrote: >> >> >> >>> On Mar 31, 2021, at 1:05 PM, Andrew Dunstan wrote: >>> >>> >>> On 3/31/21 3:48 PM, Alvaro Herrera wrote: On 2021-Mar-31, Mark Dilger wrote: > PostgresNode::start()

Re: Additional Chapter for Tutorial - arch-dev.sgml

2021-04-03 Thread Jürgen Purtz
On 03.04.21 15:39, Alvaro Herrera wrote: Yes, there is. AFAICS Heikki committed a small wordsmithing patch -- not the large patch with the additional chapter. What can i do to move the matter forward? -- J. Purtz

Re: Replication slot stats misgivings

2021-04-03 Thread vignesh C
On Fri, Apr 2, 2021 at 11:28 AM Bharath Rupireddy wrote: > > On Fri, Apr 2, 2021 at 9:57 AM vignesh C wrote: > > Thanks for the comments, I will fix the comments and provide a patch > > for this soon. > Thanks for the comments. > Here are some comments: > 1) How about something like below > +

Re: Replication slot stats misgivings

2021-04-03 Thread vignesh C
On Fri, Apr 2, 2021 at 9:29 AM Masahiko Sawada wrote: > > On Fri, Apr 2, 2021 at 1:55 AM vignesh C wrote: > > > > On Thu, Apr 1, 2021 at 5:58 PM Amit Kapila wrote: > > > > > > On Thu, Apr 1, 2021 at 3:43 PM vignesh C wrote: > > > > > > > > On Wed, Mar 31, 2021 at 11:32 AM vignesh C wrote: > >

Re: SP-GiST confusion: indexed column's type vs. index column type

2021-04-03 Thread Tom Lane
I wrote: > I still want to make an opclass in which those types are different, > if only for testing purposes, but I'm having a hard time coming up > with a plan that's not totally lame. Best idea I can think of is > to wrap the input in a bytea, which just begs the question "why > would you do

Re: CLUSTER on partitioned index

2021-04-03 Thread Zhihong Yu
Hi, For v10-0002-Implement-CLUSTER-of-partitioned-table.patch : or that an partitioned index was previously set clustered. 'an partitioned index' -> a partitioned index + * Return a List of tables and associated index, where each index is a associated index -> associated indices For

Re: [PATCH] Implement motd for PostgreSQL

2021-04-03 Thread Fabien COELHO
Perhaps the configuration-file parser has been fixed since to support embedded newlines? If so, then maybe it would actually be an idea to support newlines by escaping them? Dunno. If such a feature gets considered, I'm not sure I'd like to actually edit pg configuration file to change

Re: TRUNCATE on foreign table

2021-04-03 Thread Zhihong Yu
Continuing previous review... + relids_extra = lappend_int(relids_extra, TRUNCATE_REL_CONTEXT__CASCADED); I wonder if TRUNCATE_REL_CONTEXT_CASCADING is better than TRUNCATE_REL_CONTEXT__CASCADED. Note the removal of the extra underscore. In English, we say: truncation cascading to

Re: TRUNCATE on foreign table

2021-04-03 Thread Zhihong Yu
Hi, + TRUNCATE for each foreign server being involved + in one TRUNCATE command (note that invocations The 'being' in above sentence can be omitted. + the context where the foreign-tables are truncated. It is a list of integers and same length with There should be a verb between

Re: TRUNCATE on foreign table

2021-04-03 Thread Bharath Rupireddy
On Sat, Apr 3, 2021 at 7:16 PM Kazutaka Onishi wrote: > > Sorry but I found the v7 patch has typo and it can't be built... > I attached fixed one(v8). Thanks for the patch. Here are some comments on v8 patch: 1) We usually have the struct name after "+typedef struct ForeignTruncateInfo", please

Re: TRUNCATE on foreign table

2021-04-03 Thread Kazutaka Onishi
Sorry but I found the v7 patch has typo and it can't be built... I attached fixed one(v8). 2021年4月3日(土) 9:53 Kazutaka Onishi : > > All, > > Thank you for discussion. > I've updated the patch (v6->v7) according to the conclusion. > > I'll show the modified points: > 1. Comments for

Re: [PATCH] Implement motd for PostgreSQL

2021-04-03 Thread Chapman Flack
On 04/03/21 01:20, Joel Jacobson wrote: > I've deployed the fix to production: > > $ psql -U brad -h pit.org motd > > NOTICE: > __ ___ > /)/ \/ \ > ( / ___\) > \(/ o) ( o) ) >\_ (_ ) \ ) / > \ /\_/\)_/ > \/ //| |\\ >

Re: Additional Chapter for Tutorial - arch-dev.sgml

2021-04-03 Thread Alvaro Herrera
On 2021-Mar-25, David Steele wrote: > On 1/22/21 4:15 AM, Heikki Linnakangas wrote: > > On 21/01/2021 14:38, Jürgen Purtz wrote: > > > This supervisor process is called > > linkend="glossary-postmaster">postmaster and listens at > > > a specified TCP/IP port for incoming connections. Whenever he

Re: Proposal: Save user's original authenticated identity for logging

2021-04-03 Thread Michael Paquier
On Fri, Apr 02, 2021 at 01:45:31PM +0900, Michael Paquier wrote: > As a whole, this is a consolidation of its own, so let's apply this > part first. Slight rebase for this one to take care of the updates with the SSL error messages. -- Michael From 01e836535119dcd5a69ce54e1c86ae51bfba492c Mon Sep

Re: fix old confusing JSON example

2021-04-03 Thread Erik Rijkers
> On 2021.04.03. 14:01 Erik Rijkers wrote: > > Hello, > > Attached is a small but confusing mistake in the json documentation (a @@ > instead of @?) that has been there since version 12. (It took me quite some > time to figure that out while testing with the recent SQL/JSON patches -- >

Re: Issue with point_ops and NaN

2021-04-03 Thread Julien Rouhaud
Le jeu. 1 avr. 2021 à 15:54, Laurenz Albe a écrit : > On Thu, 2021-04-01 at 09:35 +0900, Kyotaro Horiguchi wrote: > > > > > > > > > SELECT point('NaN','NaN') <@ > polygon('(0,0),(1,0),(1,1),(0,0)'); > > > > > > > > > ?column? > > > > > > > > > -- > > > > > > > > >t > > > > > > > > >

Re: Refactoring HMAC in the core code

2021-04-03 Thread Michael Paquier
On Fri, Apr 02, 2021 at 10:10:36AM -0400, Bruce Momjian wrote: > Works for me. Thanks. I got to spend some time on this stuff again today and did a complete review, without noticing any issues except some indentation that was strange so I have applied it. Attached is a small extension I have

Re: [PATCH] Implement motd for PostgreSQL

2021-04-03 Thread Joel Jacobson
On Sat, Apr 3, 2021, at 10:14, Fabien COELHO wrote: > > Hello Joel, > > > This patch is one day late, my apologies for missing the deadline this year. > > > > PostgreSQL has since long been suffering from the lack of a proper UNIX > > style motd (message of the day). > > My 0.02€: apart from

Re: Can we remove extra memset in BloomInitPage, GinInitPage and SpGistInitPage when we have it in PageInit?

2021-04-03 Thread vignesh C
On Mon, Mar 22, 2021 at 10:16 AM Bharath Rupireddy wrote: > > Hi, > > We are memset-ting the special space page that's already set to zeros > by PageInit in BloomInitPage, GinInitPage and SpGistInitPage. We have > already removed the memset after PageInit in gistinitpage (see the > comment

Re: [PATCH] Implement motd for PostgreSQL

2021-04-03 Thread Fabien COELHO
Hello Joel, This patch is one day late, my apologies for missing the deadline this year. PostgreSQL has since long been suffering from the lack of a proper UNIX style motd (message of the day). My 0.02€: apart from the Fool's day joke dimension, I'd admit that I would not mind actually

Re: [PATCH] Implement motd for PostgreSQL

2021-04-03 Thread Charles Clavadetscher
Hi On 2021-04-03 07:16, Joel Jacobson wrote: On Sat, Apr 3, 2021, at 04:47, Michael Paquier wrote: On Fri, Apr 02, 2021 at 10:46:16PM +0200, Joel Jacobson wrote: Ascii elephant in example by Michael Paquier [1], with ANSI colors added by me. [1]

Re: [PATCH] Implement motd for PostgreSQL

2021-04-03 Thread Joel Jacobson
On Fri, Apr 2, 2021, at 23:09, Marko Tiikkaja wrote: > Hi Joel > > On Fri, Apr 2, 2021 at 11:47 PM Joel Jacobson wrote: >> PostgreSQL has since long been suffering from the lack of a proper UNIX >> style motd (message of the day). > > First of all, thanks for your work on this! I think this