Re: CREATE COLLATION - check for duplicate options and error out if found one

2021-07-18 Thread Dean Rasheed
On Fri, 16 Jul 2021 at 12:17, Dean Rasheed wrote: > > On Fri, 16 Jul 2021 at 10:26, Bharath Rupireddy > wrote: > > > > Thanks. The v5 patch LGTM. > > OK, I'll push that in a while. > Pushed, with some additional tidying up. In particular, I decided it was neater to follow the style of the code

Re: CREATE COLLATION - check for duplicate options and error out if found one

2021-07-18 Thread Dean Rasheed
On Sat, 17 Jul 2021 at 05:24, Bharath Rupireddy wrote: > > I also think that if it is specified as CREATE FUNCTION ... STRICT > STRICT, CREATE FUNCTION ... CALLED ON NULL INPUT RETURNS NULL ON NULL > INPUT etc. isn't the syntaxer catching that error while parsing the > SQL text, similar to CREATE

Re: corruption of WAL page header is never reported

2021-07-18 Thread Yugo NAGATA
On Sat, 17 Jul 2021 18:40:02 -0300 Ranier Vilela wrote: > Em sáb., 17 de jul. de 2021 às 16:57, Yugo NAGATA > escreveu: > > > Hello, > > > > I found that any corruption of WAL page header found during recovery is > > never > > reported in log messages. If wal page header is broken, it is detect

Re: Toast compression method options

2021-07-18 Thread Dilip Kumar
On Wed, Jul 14, 2021 at 5:35 PM vignesh C wrote: > > On Thu, May 6, 2021 at 7:24 PM Dilip Kumar wrote > > The patch does not apply on Head anymore, could you rebase and post a > patch. I'm changing the status to "Waiting for Author". Okay, I will rebase and send it by next week. -- Regards, Di

Re: cleaning up PostgresNode.pm

2021-07-18 Thread Andrew Dunstan
On 7/16/21 3:32 PM, Andrew Dunstan wrote: > On 6/28/21 1:02 PM, Andrew Dunstan wrote: >> On 4/24/21 3:14 PM, Alvaro Herrera wrote: >>> On 2021-Apr-24, Andrew Dunstan wrote: >>> I would like to undertake some housekeeping on PostgresNode.pm. 1. OO modules in perl typically don't expo

Re: slab allocator performance issues

2021-07-18 Thread Tomas Vondra
On 7/18/21 3:06 AM, Andres Freund wrote: Hi, On 2021-07-17 16:10:19 -0700, Andres Freund wrote: Instead of populating a linked list with all chunks upon creation of a block - which requires touching a fair bit of memory - keep a per-block pointer (or an offset) into "unused" area of the block.

Re: cleaning up PostgresNode.pm

2021-07-18 Thread Andrew Dunstan
On 7/18/21 11:48 AM, Andrew Dunstan wrote: > On 7/16/21 3:32 PM, Andrew Dunstan wrote: >> On 6/28/21 1:02 PM, Andrew Dunstan wrote: >>> On 4/24/21 3:14 PM, Alvaro Herrera wrote: On 2021-Apr-24, Andrew Dunstan wrote: > I would like to undertake some housekeeping on PostgresNode.pm. >>

Re: unnesting multirange data types

2021-07-18 Thread Alexander Korotkov
On Thu, Jul 15, 2021 at 10:27 PM Jonathan S. Katz wrote: > On 7/15/21 12:26 PM, Alexander Korotkov wrote: > > On Thu, Jul 15, 2021 at 6:47 PM Tom Lane wrote: > >> Yeah, that seems pretty horrid. I still don't like the way the > >> array casts were done, but I'd be okay with pushing the unnest >

Re: [HACKERS] logical decoding of two-phase transactions

2021-07-18 Thread Tom Lane
Amit Kapila writes: > Pushed. Coverity thinks this has security issues, and I agree. /srv/coverity/git/pgsql-git/postgresql/src/backend/replication/logical/proto.c: 144 in logicalrep_read_begin_prepare() 143 /* read gid (copy it into a pre-allocated buffer) */ >>> CID 1487517:

Re: Failure with 004_logrotate in prairiedog

2021-07-18 Thread Michael Paquier
On Sun, Jul 18, 2021 at 01:42:18AM -0400, Tom Lane wrote: > Awhile back we discovered that old macOS versions have non-atomic rename > [1]. I eventually shut down dromedary because that was causing failures > often enough to be annoying. I'd not seen such a failure before on > prairiedog, but it

Re: Failure with 004_logrotate in prairiedog

2021-07-18 Thread Tom Lane
Michael Paquier writes: > On Sun, Jul 18, 2021 at 01:42:18AM -0400, Tom Lane wrote: >> Awhile back we discovered that old macOS versions have non-atomic rename >> [1]. I eventually shut down dromedary because that was causing failures >> often enough to be annoying. I'd not seen such a failure b

Re: [PATCH] Allow multiple recursive self-references

2021-07-18 Thread David Fetter
On Thu, Jul 15, 2021 at 09:18:00AM +0200, Denis Hirn wrote: > > The patch does not apply on Head anymore, could you rebase and post a patch. > > Sure thing. Here's the new patch. > > Best wishes, Thanks for updating this. In the next version of the patch, would you be so kind as to include upda

Re: Remove redundant strlen call in ReplicationSlotValidateName

2021-07-18 Thread Peter Smith
On Sun, Jul 18, 2021 at 11:09 PM Ranier Vilela wrote: > ... > I did the patch, but to my surprise, the results weren't so good. > Despite that claiming a tiny improvement in performance, I didn't expect > any slowdown. > I put a counter in pg_regress.c, summing the results of each test and did >

Re: Implementing Incremental View Maintenance

2021-07-18 Thread Yugo NAGATA
On Wed, 14 Jul 2021 21:22:37 +0530 vignesh C wrote: > On Mon, May 17, 2021 at 10:08 AM Yugo NAGATA wrote: > > > > On Fri, 7 May 2021 14:14:16 +0900 > > Yugo NAGATA wrote: > > > > > On Mon, 26 Apr 2021 16:03:48 +0900 > > > Yugo NAGATA wrote: > > > > > > > On Mon, 26 Apr 2021 15:46:21 +0900 > >

Re: O_DIRECT on macOS

2021-07-18 Thread Thomas Munro
On Tue, Jul 13, 2021 at 1:56 PM Andres Freund wrote: > On 2021-07-13 13:25:50 +1200, Thomas Munro wrote: > > I'm planning to go with that idea (#1), if there are no objections. > > The only other viable approach I see is to completely separate our > internal flag representation from the OS represe

Re: Remove redundant strlen call in ReplicationSlotValidateName

2021-07-18 Thread Ranier Vilela
Em dom., 18 de jul. de 2021 às 21:23, Peter Smith escreveu: > > > On Sun, Jul 18, 2021 at 11:09 PM Ranier Vilela > wrote: > >> ... >> > I did the patch, but to my surprise, the results weren't so good. >> Despite that claiming a tiny improvement in performance, I didn't expect >> any slowdown. >

Re: 回复: Why is XLOG_FPI_FOR_HINT always need backups?

2021-07-18 Thread Kyotaro Horiguchi
At Sat, 17 Jul 2021 00:14:34 +0900, Fujii Masao wrote in > Thanks for updating the patch! It basically looks good to me. > >* Full-page image (FPI) records contain nothing else but a > backup >* block (or multiple backup blocks). Every block reference must >

Re: speed up verifying UTF-8

2021-07-18 Thread John Naylor
I wrote: > On Fri, Jul 16, 2021 at 1:44 AM Vladimir Sitnikov < sitnikov.vladi...@gmail.com> wrote: > > > > Have you considered shift-based DFA for a portable implementation https://gist.github.com/pervognsen/218ea17743e1442e59bb60d29b1aa725 ? > > I did consider some kind of DFA a while back and it

Re: pgbench: using prepared BEGIN statement in a pipeline could cause an error

2021-07-18 Thread Yugo NAGATA
Hello Fabien, On Sat, 17 Jul 2021 07:03:01 +0200 (CEST) Fabien COELHO wrote: > > Hello Yugo-san, > > > [...] One way to avoid these errors is to send Parse messages before > > pipeline mode starts. I attached a patch to fix to prepare commands at > > starting of a script instead of at the fi

Re: RFC: Logging plan of the running query

2021-07-18 Thread torikoshia
On Tue, Jul 13, 2021 at 11:11 PM Masahiro Ikeda wrote: When I tried this feature, I realized two things. So, I share them. Thanks for your review! (1) About output contents > The format of the query plan is the same as when FORMAT > TEXT > and VEBOSE are used in the > EXPLAIN command. > F

Re: [HACKERS] logical decoding of two-phase transactions

2021-07-18 Thread Amit Kapila
On Mon, Jul 19, 2021 at 1:55 AM Tom Lane wrote: > > Amit Kapila writes: > > Pushed. > > I think you'd be way better off making the gid fields be "char *" > and pstrdup'ing the result of pq_getmsgstring. Another possibility > perhaps is to use strlcpy, but I'd only go that way if it's important >

Doc necessity for superuser privileges to execute pg_import_system_collations()

2021-07-18 Thread torikoshia
Hi. It seems that only superusers can execute pg_import_system_collations(), but this is not mentioned in the manual. Since other functions that require superuser privileges describe that in the manual, I think it would be better to do the same for consistency. Thoughts? -- Regards, -- At

RE: Added schema level support for publication.

2021-07-18 Thread tanghy.f...@fujitsu.com
On Friday, July 16, 2021 6:13 PM vignesh C mailto:vignes...@gmail.com>> wrote: > > On Fri, Jul 16, 2021 at 9:25 AM Greg Nancarrow > wrote: > > > > Also, there seems to be an issue with ALTER PUBLICATION ... SET SCHEMA ... > > (PubType is getting set to 'e' instea

Re: Added documentation for cascade and restrict option of drop statistics

2021-07-18 Thread Michael Paquier
On Sun, Jul 18, 2021 at 12:37:48PM +0900, Michael Paquier wrote: > Indeed, good catch. The other commands document that, so let's fix > it. Applied. -- Michael signature.asc Description: PGP signature

Re: [HACKERS] logical decoding of two-phase transactions

2021-07-18 Thread Peter Smith
On Mon, Jul 19, 2021 at 12:43 PM Amit Kapila wrote: > > On Mon, Jul 19, 2021 at 1:55 AM Tom Lane wrote: > > > > Amit Kapila writes: > > > Pushed. > > > > I think you'd be way better off making the gid fields be "char *" > > and pstrdup'ing the result of pq_getmsgstring. Another possibility > >

RE: Added schema level support for publication.

2021-07-18 Thread tanghy.f...@fujitsu.com
On Friday, July 16, 2021 6:10 PM vignesh C > On Wed, Jul 14, 2021 at 6:25 PM houzj.f...@fujitsu.com > wrote: > > > > Wednesday, July 14, 2021 6:17 PM vignesh C wrote: > > > On Tue, Jul 13, 2021 at 12:06 PM tanghy.f...@fujitsu.com > > > wrote: > > > > > > > > On Monday, July 12, 2021 5:36 PM vig

Re: Doc necessity for superuser privileges to execute pg_import_system_collations()

2021-07-18 Thread Fujii Masao
On 2021/07/19 11:45, torikoshia wrote: Hi. It seems that only superusers can execute pg_import_system_collations(), but this is not mentioned in the manual. Since other functions that require superuser privileges describe that in the manual, I think it would be better to do the same for co

Re: O_DIRECT on macOS

2021-07-18 Thread Tom Lane
Thomas Munro writes: > Agreed. Pushed! prairiedog thinks that Assert is too optimistic about whether all those flags exist. regards, tom lane

Re: O_DIRECT on macOS

2021-07-18 Thread Thomas Munro
On Mon, Jul 19, 2021 at 4:42 PM Tom Lane wrote: > prairiedog thinks that Assert is too optimistic about whether all > those flags exist. Fixed. (Huh, I received no -committers email for 2dbe8905.)

Re: Skipping logical replication transactions on subscriber side

2021-07-18 Thread Amit Kapila
On Fri, Jul 16, 2021 at 8:33 PM Masahiko Sawada wrote: > > On Wed, Jul 14, 2021 at 5:14 PM Masahiko Sawada wrote: > > > > Sounds good. I'll incorporate this in the next version patch that I'm > > planning to submit this week. > > Sorry, I could not make it this week. I'll submit them early next w

Re: speed up verifying UTF-8

2021-07-18 Thread Amit Khandekar
On Sat, 17 Jul 2021 at 04:48, John Naylor wrote: > v17-0001 is the same as v14. 0002 is a stripped-down implementation of Amit's > chunk idea for multibyte, and it's pretty good on x86. On Power8, not so > much. 0003 and 0004 are shot-in-the-dark guesses to improve it on Power8, > with some succes

Re: logical replication empty transactions

2021-07-18 Thread Peter Smith
Hi Ajin, I have reviewed the v7 patch and given my feedback comments below. Apply OK Build OK make check OK TAP (subscriptions) make check OK Build PG Docs (html) OK Although I made lots of review comments below, the important point is that none of them are functional - they are only minore re-w

Re: [HACKERS] logical decoding of two-phase transactions

2021-07-18 Thread Greg Nancarrow
On Wed, Jul 14, 2021 at 6:33 PM Peter Smith wrote: > > Please find attached the latest patch set v97* > I couldn't spot spot any significant issues in the v97-0001 patch, but do have the following trivial feedback comments: (1) doc/src/sgml/protocol.sgml Suggestion: BEFORE: + contains a Strea

Re: [PATCH] Use optimized single-datum tuplesort in ExecSort

2021-07-18 Thread Ronan Dunklau
Le samedi 17 juillet 2021, 10:36:09 CEST David Rowley a écrit : > On Sat, 17 Jul 2021 at 01:14, James Coleman wrote: > > The only remaining question I have is whether or not costing needs to > > change, given the very significant speedup for datum sort. > > I'm looking at cost_tuplesort and the

Re: RFC: Logging plan of the running query

2021-07-18 Thread Fujii Masao
On 2021/07/19 11:28, torikoshia wrote: Agreed. Updated the patch. Thanks for updating the patch! +bool +SendProcSignalForLogInfo(pid_t pid, ProcSignalReason reason) I don't think that procsignal.c is proper place to check the permission and check whether the specified PID indicates a Postg

Re: corruption of WAL page header is never reported

2021-07-18 Thread Kyotaro Horiguchi
Hello. At Sun, 18 Jul 2021 04:55:05 +0900, Yugo NAGATA wrote in > Hello, > > I found that any corruption of WAL page header found during recovery is never > reported in log messages. If wal page header is broken, it is detected in > XLogReaderValidatePageHeader called from XLogPageRead, but th

Re: [PoC] Improve dead tuple storage for lazy vacuum

2021-07-18 Thread Masahiko Sawada
Sorry for the late reply. On Sat, Jul 10, 2021 at 11:55 AM Andres Freund wrote: > > Hi, > > On 2021-07-09 10:17:49 -0700, Andres Freund wrote: > > On 2021-07-07 20:46:38 +0900, Masahiko Sawada wrote: > > > Currently, the TIDs of dead tuples are stored in an array that is > > > collectively alloca

Re: Replace remaining castNode(…, lfirst(…)) and friends calls with l*_node()

2021-07-18 Thread Peter Eisentraut
On 15.07.21 13:12, Dagfinn Ilmari Mannsåker wrote: ilm...@ilmari.org (Dagfinn Ilmari Mannsåker) writes: Hi hackers, We've had node-casting versions of the list extraction macros since 2017, but several cases of the written-out version have been added since then (even by Tom, who added the l*_n

Re: Add proper planner support for ORDER BY / DISTINCT aggregates

2021-07-18 Thread Ronan Dunklau
> Looks like I did a sloppy job of that. I messed up the condition in > standard_qp_callback() that sets the ORDER BY aggregate pathkeys so > that it accidentally set them when there was an unsortable GROUP BY > clause, as highlighted by the postgres_fdw tests failing. I've now > added a comment

Re: Skipping logical replication transactions on subscriber side

2021-07-18 Thread Masahiko Sawada
On Mon, Jul 19, 2021 at 2:22 PM Amit Kapila wrote: > > On Fri, Jul 16, 2021 at 8:33 PM Masahiko Sawada wrote: > > > > On Wed, Jul 14, 2021 at 5:14 PM Masahiko Sawada > > wrote: > > > > > > Sounds good. I'll incorporate this in the next version patch that I'm > > > planning to submit this week.

Re: Skipping logical replication transactions on subscriber side

2021-07-18 Thread Masahiko Sawada
On Sat, Jul 17, 2021 at 12:02 AM Masahiko Sawada wrote: > > On Wed, Jul 14, 2021 at 5:14 PM Masahiko Sawada wrote: > > > > On Mon, Jul 12, 2021 at 8:52 PM Amit Kapila wrote: > > > > > > On Mon, Jul 12, 2021 at 11:13 AM Masahiko Sawada > > > wrote: > > > > > > > > On Mon, Jul 12, 2021 at 1:15 P

Re: [HACKERS] logical decoding of two-phase transactions

2021-07-18 Thread Amit Kapila
On Mon, Jul 19, 2021 at 9:19 AM Peter Smith wrote: > > On Mon, Jul 19, 2021 at 12:43 PM Amit Kapila wrote: > > > > On Mon, Jul 19, 2021 at 1:55 AM Tom Lane wrote: > > > > > > Amit Kapila writes: > > > > Pushed. > > > > > > I think you'd be way better off making the gid fields be "char *" > > >

Re: automatically generating node support functions

2021-07-18 Thread Peter Eisentraut
On 07.06.21 22:27, Peter Eisentraut wrote: I wrote a script to automatically generate the node support functions (copy, equal, out, and read, as well as the node tags enum) from the struct definitions. The first eight patches are to clean up various inconsistencies to make parsing or generati