Re: proposal: schema variables

2020-03-17 Thread Pavel Stehule
Hi fresh patch - rebase and fix issue reported by Remi - broken usage CREATE VARIABLE inside PLpgSQL Regards Pavel schema-variables-20200318.patch.gz Description: application/gzip

Re: WIP: WAL prefetch (another approach)

2020-03-17 Thread Thomas Munro
On Wed, Mar 18, 2020 at 2:47 PM Alvaro Herrera wrote: > On 2020-Mar-17, Thomas Munro wrote: > > I didn't want counters that wrap at ~4 billion, but I did want to be > > able to read and write concurrently without tearing. Instructions > > like "lock xadd" would provide more guarantees that I

GSoC applicant proposal, Uday PB

2020-03-17 Thread p.b uday
Hi PostgreSQL team, I am looking forward to participating in the GSoC with PostgreSQL this summer. Below is my draft proposal for your review. Any feedback would be greatly appreciated. *PL/Java online documentation improvements* *Project goal:* The goal of the project is to improve the

Re: control max length of parameter values logged

2020-03-17 Thread keisuke kuroda
Hi, BIND parameter truncation is good to me. Logs could be very hard to read due to the very long parameters recorded. Now, parameter is extracuted from left. e.g. "----" to "--..." Is not necessary from right? e.g. "----" to

Re: [PATCH] Erase the distinctClause if the result is unique by definition

2020-03-17 Thread Andy Fan
Hi David: On Wed, Mar 18, 2020 at 12:13 PM David Rowley wrote: > On Wed, 18 Mar 2020 at 15:57, Andy Fan wrote: > > I'm now writing the code for partition index stuff, which > > is a bit of boring, since every partition may have different unique > index. > > Why is that case so different? > >

Re: Missing errcode() in ereport

2020-03-17 Thread Amit Kapila
On Wed, Mar 18, 2020 at 9:01 AM Amit Kapila wrote: > > On Tue, Mar 17, 2020 at 7:39 PM Tom Lane wrote: > > > > Amit Kapila writes: > > > On Tue, Mar 17, 2020 at 3:28 PM Michael Paquier > > > wrote: > > >> Definitely an oversight. All stable branches down to 9.5 have > > >> mistakes in the

Re: Adding missing object access hook invocations

2020-03-17 Thread Michael Paquier
On Tue, Mar 17, 2020 at 12:39:35PM -0700, Mark Dilger wrote: > I agree that this does not need to be back-patched. I was debating > whether it constitutes a bug for the purpose of putting the fix into > v13 vs. punting the patch forward to the v14 cycle. I don't have a > strong opinion on that.

RE: Multivariate MCV list vs. statistics target

2020-03-17 Thread Shinoda, Noriyoshi (PN Japan A Delivery)
Hello, I found a missing column description in the pg_statistic_ext catalog document for this new feature. The attached patch adds a description of the 'stxstattarget' column to pg_statistic_ext catalog's document. If there is a better explanation, please correct it. Regards, Noriyoshi

Re: Online checksums verification in the backend

2020-03-17 Thread Michael Paquier
On Mon, Mar 16, 2020 at 09:21:22AM +0100, Julien Rouhaud wrote: > On Mon, Mar 16, 2020 at 12:29:28PM +0900, Michael Paquier wrote: >> With a large amount of >> shared buffer eviction you actually increase the risk of torn page >> reads. Instead of a logic relying on partition mapping locks, which

Re: [PATCH] Erase the distinctClause if the result is unique by definition

2020-03-17 Thread David Rowley
On Wed, 18 Mar 2020 at 15:57, Andy Fan wrote: > I'm now writing the code for partition index stuff, which > is a bit of boring, since every partition may have different unique index. Why is that case so different? For a partitioned table to have a valid unique index, a unique index must exist

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-17 Thread Justin Pryzby
On Tue, Mar 17, 2020 at 09:58:53PM -0400, James Coleman wrote: > On Tue, Mar 17, 2020 at 9:03 PM Andres Freund wrote: > > > > On 2020-03-17 20:42:07 +0100, Laurenz Albe wrote: > > > > I think Andres was thinking this would maybe be an optimization > > > > independent of > > > > is_insert_only

Re: Missing errcode() in ereport

2020-03-17 Thread Amit Kapila
On Tue, Mar 17, 2020 at 7:39 PM Tom Lane wrote: > > Amit Kapila writes: > > On Tue, Mar 17, 2020 at 3:28 PM Michael Paquier wrote: > >> Definitely an oversight. All stable branches down to 9.5 have > >> mistakes in the same area, with nothing extra by grepping around. > >> Amit, I guess that

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2020-03-17 Thread Amit Kapila
On Tue, Mar 17, 2020 at 6:32 PM Dilip Kumar wrote: > > Your changes look fine to me. I have also verified all the test and > everything works fine. > I have pushed the first patch. I will push the others in coming days. -- With Regards, Amit Kapila. EnterpriseDB: http://www.enterprisedb.com

Re: adding partitioned tables to publications

2020-03-17 Thread Amit Langote
Hi Peter, On Mon, Mar 16, 2020 at 9:49 PM Peter Eisentraut wrote: > > I was trying to extract some preparatory work from the remaining patches > and came up with the attached. This is part of your patch 0003, but > also relevant for part 0004. The problem was that COPY (SELECT *) is > not

Re: Small docs bugfix: make it clear what can be used in UPDATE FROM and DELETE USING

2020-03-17 Thread Tom Lane
Bruce Momjian writes: > I have implemented the ideas above in the attached patch. I have > synchronized the syntax to match SELECT, and synchronized the paragraphs > describing the item. I think that the DELETE synopsis should look like [ USING from_item [, ...] ] so that there's not any

Re: [PATCH] Erase the distinctClause if the result is unique by definition

2020-03-17 Thread Andy Fan
Hi David: Thanks for your time. On Wed, Mar 18, 2020 at 9:56 AM David Rowley wrote: > On Mon, 16 Mar 2020 at 06:01, Andy Fan wrote: > > > > Hi All: > > > > I have re-implemented the patch based on David's suggestion/code, Looks > it > > works well. The updated patch mainly includes: > > >

Re: ALTER tbl rewrite loses CLUSTER ON index

2020-03-17 Thread Michael Paquier
On Tue, Mar 17, 2020 at 11:20:44AM -0500, Justin Pryzby wrote: > On Tue, Mar 17, 2020 at 02:33:32PM +0900, Michael Paquier wrote: >> Patch 0002 from Justin does that, I would keep this refactoring as >> HEAD-only material though, and I don't spot any other code paths in >> need of patching. >> >>

Re: A bug when use get_bit() function for a long bytea string

2020-03-17 Thread movead...@highgo.ca
Hello thanks for the detailed review, >I think the second argument indicates the bit position, which would be max >bytea length * 8. If max bytea length covers whole int32, the second argument >>needs to be wider i.e. int64. Yes, it makes sence and followed. > Some more comments on the patch

Re: Standby got fatal after the crash recovery

2020-03-17 Thread Michael Paquier
On Wed, Mar 18, 2020 at 11:19:22AM +0900, Ian Barwick wrote: > On 2020/03/17 12:53, Thunder wrote: > > Sorry. > > We are using pg11, and cloned from tag REL_11_BETA2. > > In that case you should upgrade to the current version > in the PostgreSQL 11 series (at the time of writing 11.7).

Re: Standby got fatal after the crash recovery

2020-03-17 Thread Ian Barwick
On 2020/03/17 12:53, Thunder wrote: Sorry. We are using pg11, and cloned from tag REL_11_BETA2. In that case you should upgrade to the current version in the PostgreSQL 11 series (at the time of writing 11.7). Regards Ian Barwick -- Ian Barwick

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-17 Thread James Coleman
On Tue, Mar 17, 2020 at 9:03 PM Andres Freund wrote: > > Hi, > > On 2020-03-17 20:42:07 +0100, Laurenz Albe wrote: > > > I think Andres was thinking this would maybe be an optimization > > > independent of > > > is_insert_only (?) > > > > I wasn't sure. > > I'm not sure myself - but I'm doubtful

Re: Collation versioning

2020-03-17 Thread Michael Paquier
On Tue, Mar 17, 2020 at 06:43:51PM +0100, Julien Rouhaud wrote: > On Tue, Mar 17, 2020 at 05:31:47PM +0100, Christoph Berg wrote: >> Not sure if that's the case there, but reg* typecasts are very handy >> when used interactively in ad-hoc queries. > > +1. I'm obviously biased, but I find it

Re: [PATCH] Erase the distinctClause if the result is unique by definition

2020-03-17 Thread David Rowley
On Mon, 16 Mar 2020 at 06:01, Andy Fan wrote: > > Hi All: > > I have re-implemented the patch based on David's suggestion/code, Looks it > works well. The updated patch mainly includes: > > 1. Maintain the not_null_colno in RelOptInfo, which includes the not null from > catalog and the not

Re: Autovacuum on partitioned table

2020-03-17 Thread Alvaro Herrera
On 2020-Mar-18, yuzuko wrote: > > I think if we analyze partition tree in order from leaf partitions > > to root table, this problem can be fixed. > > What do you think about it? > > Attach the new patch fixes the above problem. Thanks for the new version. I'm confused about some error

Re: WIP: WAL prefetch (another approach)

2020-03-17 Thread Alvaro Herrera
On 2020-Mar-17, Thomas Munro wrote: Hi Thomas > On Sat, Mar 14, 2020 at 10:15 AM Alvaro Herrera > wrote: > > I didn't manage to go over 0005 though, but I agree with Tomas that > > having this be configurable in terms of bytes of WAL is not very > > user-friendly. > > The primary control is

Re: proposal: new polymorphic types - commontype and commontypearray

2020-03-17 Thread Tom Lane
I wrote: > The cfbot will be unhappy at this point, but I need to rebase the > main patch again ... And rebased. Still not quite happy about some of the details in enforce_generic_type_consistency, and I've not looked at the test cases or documentation at all. But this should make the cfbot

Re: Autovacuum on partitioned table

2020-03-17 Thread yuzuko
Hello, > > > > + */ > > > > + if (IsAutoVacuumWorkerProcess() && > > > > + rel->rd_rel->relispartition && > > > > + !(rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)) > > > > > > I'm not sure I understand why we do this only on autovac. Why not all > > >

Re: Auxiliary Processes and MyAuxProc

2020-03-17 Thread Alvaro Herrera
On 2020-Mar-17, Justin Pryzby wrote: > +static PgSubprocess process_types[] = { > + { > + .desc = "checker", > + .entrypoint = CheckerModeMain > + }, > + { > + .desc = "bootstrap", > + .entrypoint = BootstrapModeMain > + }, Maybe

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-17 Thread Andres Freund
Hi, On 2020-03-17 20:42:07 +0100, Laurenz Albe wrote: > > I think Andres was thinking this would maybe be an optimization independent > > of > > is_insert_only (?) > > I wasn't sure. I'm not sure myself - but I'm doubtful that using a 0 min age by default will be ok. I was trying to say (in a

Re: Small docs bugfix: make it clear what can be used in UPDATE FROM and DELETE USING

2020-03-17 Thread Bruce Momjian
On Thu, Feb 13, 2020 at 11:26:45AM -0500, Tom Lane wrote: > I see where you're coming from, but I do not think that repeating the > whole from_item syntax in UPDATE and DELETE is the best way forward. > In the first place, we'd inevitably forget to update those copies, > and in the second, I'm not

Re: PATCH: add support for IN and @> in functional-dependency statistics use

2020-03-17 Thread Tomas Vondra
On Tue, Mar 17, 2020 at 06:05:17PM +0100, Tomas Vondra wrote: On Tue, Mar 17, 2020 at 04:14:26PM +, Dean Rasheed wrote: On Tue, 17 Mar 2020 at 15:37, Tomas Vondra wrote: On Tue, Mar 17, 2020 at 12:42:52PM +, Dean Rasheed wrote: The other thing that I'm still concerned about is the

Re: [PATCH] Opclass parameters

2020-03-17 Thread Nikita Glukhov
Attached new version of reordered patches. Questionable patches for AM-specific per-attribute options were moved to the end, so they can be skipped now. On 16.03.2020 18:22, Alexander Korotkov wrote: Hi! I took a look on this patchset. There is a first set of questions. * Patchset badly

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-17 Thread Andres Freund
Hi, On 2020-03-17 01:14:02 +0100, Laurenz Albe wrote: > lazy_check_needs_freeze() is only called for an aggressive vacuum, which > this isn't. Hm? I mean some of these will be aggressive vacuums, because it's older than vacuum_freeze_table_age? And the lower age limit would make that potentially

Re: proposal: new polymorphic types - commontype and commontypearray

2020-03-17 Thread Tom Lane
I wrote: > Pavel Stehule writes: >> There was a problem just with anyrange type. This last version looks >> perfect. > If you think that "matching polymorphic types" is too vague, I'm > not sure there's much daylight between there and spelling it out > in full as this latest patch does.

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-17 Thread Justin Pryzby
On Mon, Mar 16, 2020 at 07:47:13AM -0500, Justin Pryzby wrote: > Normally, when someone complains about bad plan related to no index-onlyscan, > we tell them to run vacuum, and if that helps, then ALTER TABLE .. SET > (autovacuum_vacuum_scale_factor=0.005). > > If there's two thresholds (4 GUCs

Re: Error on failed COMMIT

2020-03-17 Thread Dave Cramer
On Tue, 17 Mar 2020 at 19:23, Bruce Momjian wrote: > On Tue, Mar 17, 2020 at 07:15:05PM -0400, Dave Cramer wrote: > > On Tue, 17 Mar 2020 at 16:47, Bruce Momjian wrote: > > Third, the idea that individual interfaces, e.g. JDBC, should throw > an > > error in this case while the server

Re: Error on failed COMMIT

2020-03-17 Thread Bruce Momjian
On Tue, Mar 17, 2020 at 07:15:05PM -0400, Dave Cramer wrote: > On Tue, 17 Mar 2020 at 16:47, Bruce Momjian wrote: > Third, the idea that individual interfaces, e.g. JDBC, should throw an > error in this case while the server just changes the COMMIT return tag > to ROLLBACK is

Re: Error on failed COMMIT

2020-03-17 Thread Dave Cramer
On Tue, 17 Mar 2020 at 16:47, Bruce Momjian wrote: > On Fri, Mar 6, 2020 at 01:12:10PM -0500, Robert Haas wrote: > > On Fri, Mar 6, 2020 at 11:55 AM Dave Cramer > wrote: > > > There have been some arguments that the client can fix this easily. > > > > > > Turns out it is not as easy as one

Re: Parallel leader process info in EXPLAIN

2020-03-17 Thread James Coleman
On Thu, Nov 7, 2019 at 9:48 PM Thomas Munro wrote: > > On Thu, Nov 7, 2019 at 11:37 PM Rafia Sabih wrote: > > ... > > Also, I noticed that the worker details are displayed for sort node even > > without verbose, but for scans it is only with verbose. Am I missing > > something or there is

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-17 Thread Laurenz Albe
On Tue, 2020-03-17 at 16:34 -0500, Justin Pryzby wrote: > > > > Now we insert m number tuples (which are live). > > .. but not yet counted in reltuples. Thanks for pointing out my mistake. Here is another patch, no changes except setting the upper limit for autovacuum_vacuum_insert_scale_factor

Re: Auxiliary Processes and MyAuxProc

2020-03-17 Thread Justin Pryzby
On Tue, Mar 17, 2020 at 02:50:19PM -0400, Mike Palmiotto wrote: > The patchset is now split out. I've just noticed that Peter Eisentraut > included some changes for a generic MyBackendType, which I should have > been aware of. I was unable to rebase due to these changes, but can > fold these

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-17 Thread Justin Pryzby
On Tue, Mar 17, 2020 at 10:22:44PM +0100, Laurenz Albe wrote: > On Tue, 2020-03-17 at 16:07 -0500, Justin Pryzby wrote: > > > Assume a scale factor >= 1, for example 2, and n live tuples. > > > The table has just been vacuumed. > > > > > > Now we insert m number tuples (which are live). .. but

Re: Attempt to consolidate reading of XLOG page

2020-03-17 Thread Alvaro Herrera
On 2019-Nov-20, Antonin Houska wrote: > Alvaro Herrera wrote: > > What is logical_read_local_xlog_page all about? Seems useless. Let's > > get rid of it. > > It seems so. Should I post a patch for that? No need .. it was simple enough. Just pushed it. Thanks -- Álvaro Herrera

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-17 Thread Laurenz Albe
On Tue, 2020-03-17 at 16:07 -0500, Justin Pryzby wrote: > > Assume a scale factor >= 1, for example 2, and n live tuples. > > The table has just been vacuumed. > > > > Now we insert m number tuples (which are live). > > > > Then the condition > > > >threshold + scale_factor * live_tuples <

Re: Error on failed COMMIT

2020-03-17 Thread Vladimir Sitnikov
Bruce, thanks for taking the time to summarize. Bruce>Fourth, it is not clear how many applications would break if COMMIT Bruce>started issuing an error rather than return success None. Bruce>applications that issue COMMIT and expect success after a transaction Bruce>block has failed An

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-17 Thread Justin Pryzby
On Tue, Mar 17, 2020 at 10:01:15PM +0100, Laurenz Albe wrote: > On Tue, 2020-03-17 at 14:56 -0500, Justin Pryzby wrote: > > I still suggest scale_factor maximum of 1e10, like > > 4d54543efa5eb074ead4d0fadb2af4161c943044 > > > > Which alows more effectively disabling it than a factor of 100, which

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-17 Thread Laurenz Albe
On Tue, 2020-03-17 at 14:56 -0500, Justin Pryzby wrote: > I still suggest scale_factor maximum of 1e10, like > 4d54543efa5eb074ead4d0fadb2af4161c943044 > > Which alows more effectively disabling it than a factor of 100, which would > progress like: ~1, 1e2, 1e4, 1e6, 1e8, 1e10, .. > > I don't

Re: Error on failed COMMIT

2020-03-17 Thread Bruce Momjian
On Fri, Mar 6, 2020 at 01:12:10PM -0500, Robert Haas wrote: > On Fri, Mar 6, 2020 at 11:55 AM Dave Cramer wrote: > > There have been some arguments that the client can fix this easily. > > > > Turns out it is not as easy as one might think. > > > > If the client (in this case JDBC) uses

Re: pgsql: walreceiver uses a temporary replication slot by default

2020-03-17 Thread Sergei Kornilov
Hello > I have reworked that part, adding more comments about the use of GUC > parameters when establishing the connection to the primary for a WAL > receiver. And also I have added an extra comment to walreceiver.c > about the use of GUcs in general, to avoid this stuff again in the > future.

Re: WAL usage calculation patch

2020-03-17 Thread Julien Rouhaud
On Tue, Mar 17, 2020 at 10:27:05PM +0300, Kirill Bychik wrote: > > > Please feel free to work on any extension of this patch idea. I lack > > > both time and knowledge to do it all by myself. > > > > I'm adding a 3rd patch on top of yours to expose the new WAL counters in > > pg_stat_database, for

Re: allow online change primary_conninfo

2020-03-17 Thread Sergei Kornilov
Hello >>  Well, it seems better to move this patch to next commitfest? > > What? You want to make wal_receiver_create_temp_slot unchangeable and > default to off in pg13, and delay the patch that fixes those things to > pg14? That makes no sense to me. I want to handle similar things in a

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-17 Thread Justin Pryzby
On Tue, Mar 17, 2020 at 08:42:07PM +0100, Laurenz Albe wrote: > Also, since aggressive^H^H^H^H^H^H^H^H^H^Hproactive freezing seems to be a > performance problem in some cases (pages with UPDATEs and DELETEs in otherwise > INSERT-mostly tables), I have done away with the whole freezing thing, >

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-17 Thread Laurenz Albe
On Tue, 2020-03-17 at 10:24 -0500, Justin Pryzby wrote: > > --- a/src/backend/access/heap/vacuumlazy.c > > +++ b/src/backend/access/heap/vacuumlazy.c > > @@ -1388,17 +1388,26 @@ lazy_scan_heap(Relation onerel, VacuumParams > > *params, LVRelStats *vacrelstats, > >else > >

Re: Adding missing object access hook invocations

2020-03-17 Thread Mark Dilger
> On Mar 17, 2020, at 11:49 AM, Andres Freund wrote: > > On 2020-03-16 16:03:51 -0700, Mark Dilger wrote: >> While working on object access hooks, I noticed several locations >> where I would expect the hook to be invoked, but no actual invocation. >> I think this just barely qualifies as a

Re: [PATCH] Btree BackwardScan race condition on Standby during VACUUM

2020-03-17 Thread Peter Geoghegan
On Mon, Mar 16, 2020 at 10:20 PM Andrey M. Borodin wrote: > It seems to me that it's exactly the same check that I was trying to verify > in amcheck patch [0]. > But there it was verified inside amcheck, but here it is verified by index > scan. Maybe we can accept your patch after fixing this

Re: [PATCH] Btree BackwardScan race condition on Standby during VACUUM

2020-03-17 Thread Peter Geoghegan
On Mon, Mar 16, 2020 at 7:08 AM Michail Nikolaev wrote: > -- ABSTRACT -- > There is a race condition between btree_xlog_unlink_page and _bt_walk_left. > A lot of versions are affected including 12 and new-coming 13. > Happens only on standby. Seems like could not cause invalid query

Re: WAL usage calculation patch

2020-03-17 Thread Kirill Bychik
> > Please feel free to work on any extension of this patch idea. I lack > > both time and knowledge to do it all by myself. > > > I'm adding a 3rd patch on top of yours to expose the new WAL counters in > pg_stat_database, for vacuum and autovacuum. I'm not really enthiusiastic > with > this

Re: logical copy_replication_slot issues

2020-03-17 Thread Alvaro Herrera
Thanks Arseny and Masahiko, I pushed this patch just now. I changed some comments while at it, hopefully they are improvements. On 2020-Mar-09, Masahiko Sawada wrote: > ctx = CreateInitDecodingContext(plugin, NIL, > - false, /* do not build snapshot */ > +

Re: pg_ls_tmpdir to show directories and shared filesets (and pg_ls_*)

2020-03-17 Thread Tom Lane
Justin Pryzby writes: > It seems like the only way to make variable number of arguments is is with > multiple entries in pg_proc.dat, one for each "number of" arguments. Is that > right ? Another way to do it is to have one entry, put the full set of arguments into the initial pg_proc.dat data,

Re: pg_ls_tmpdir to show directories and shared filesets (and pg_ls_*)

2020-03-17 Thread Justin Pryzby
On Tue, Mar 17, 2020 at 10:21:48AM +0100, Fabien COELHO wrote: > > About v13, seens as one patch: > > Function "pg_ls_dir_metadata" documentation suggests a variable number of > arguments with brackets, but parameters are really mandatory. Fixed, and added tests on 1 and 3 arg versions of both

Re: backend type in log_line_prefix?

2020-03-17 Thread Mike Palmiotto
> On 2020/03/15 19:32, Peter Eisentraut wrote: > > On 2020-03-13 22:24, Peter Eisentraut wrote: > >> On 2020-03-10 19:07, Alvaro Herrera wrote: > >>> I like these patches; the first two are nice cleanup. > >>> > >>> My only gripe is that pgstat_get_backend_desc() is not really a pgstat > >>>

Re: Adding missing object access hook invocations

2020-03-17 Thread Andres Freund
Hi, On 2020-03-16 16:03:51 -0700, Mark Dilger wrote: > While working on object access hooks, I noticed several locations > where I would expect the hook to be invoked, but no actual invocation. > I think this just barely qualifies as a bug. It's debatable because > whether it is a bug depends on

Re: SQL/JSON: functions

2020-03-17 Thread Pavel Stehule
út 17. 3. 2020 v 1:55 odesílatel Nikita Glukhov napsal: > Attached 44th version of the patches. > > > On 12.03.2020 16:41, Pavel Stehule wrote: > > > On 12.03.2020 00:09 Nikita Glukhov wrote: > >> Attached 43rd version of the patches. >> >> The previous patch #4 ("Add function formats") was

Re: allow online change primary_conninfo

2020-03-17 Thread Alvaro Herrera
On 2020-Mar-17, Sergei Kornilov wrote: > Well, it seems better to move this patch to next commitfest? What? You want to make wal_receiver_create_temp_slot unchangeable and default to off in pg13, and delay the patch that fixes those things to pg14? That makes no sense to me. Please keep them

Re: Collation versioning

2020-03-17 Thread Julien Rouhaud
On Tue, Mar 17, 2020 at 05:31:47PM +0100, Christoph Berg wrote: > Re: Peter Eisentraut 2020-03-17 > > > Did we discuss the regcollation type? In the current patch set, it's only > > used in two places in a new regression test, where it can easily be replaced > > by a join. Do we need it? I

Re: BEFORE ROW triggers for partitioned tables

2020-03-17 Thread Ashutosh Bapat
On Fri, 13 Mar 2020 at 21:55, Alvaro Herrera wrote: > On 2020-Mar-11, Ashutosh Bapat wrote: > > > On Thu, Feb 27, 2020 at 10:22 PM Alvaro Herrera > > wrote: > > > > * The new function I added, ReportTriggerPartkeyChange(), contains one > > > serious bug (namely: it doesn't map attribute numbers

Re: PATCH: add support for IN and @> in functional-dependency statistics use

2020-03-17 Thread Tomas Vondra
On Tue, Mar 17, 2020 at 04:14:26PM +, Dean Rasheed wrote: On Tue, 17 Mar 2020 at 15:37, Tomas Vondra wrote: On Tue, Mar 17, 2020 at 12:42:52PM +, Dean Rasheed wrote: >The other thing that I'm still concerned about is the possibility of >returning estimates with P(a,b) > P(a) or P(b).

Re: allow online change primary_conninfo

2020-03-17 Thread Sergei Kornilov
Hello Sorry for late replies. > Yes. In my opinion, patch 0002 should not change the GUC mode of > wal_receiver_create_temp_slot as the discussion here is about > primary_conninfo, even if both may share some logic regarding WAL > receiver shutdown and its restart triggered by the startup

Re: Collation versioning

2020-03-17 Thread Christoph Berg
Re: Peter Eisentraut 2020-03-17 > Did we discuss the regcollation type? In the current patch set, it's only > used in two places in a new regression test, where it can easily be replaced > by a join. Do we need it? > > I realize we've been adding new reg* types lately; I'm not sure what the >

Re: Collation versioning

2020-03-17 Thread Peter Eisentraut
Did we discuss the regcollation type? In the current patch set, it's only used in two places in a new regression test, where it can easily be replaced by a join. Do we need it? I realize we've been adding new reg* types lately; I'm not sure what the current idea is on that. -- Peter

Re: ALTER tbl rewrite loses CLUSTER ON index

2020-03-17 Thread Justin Pryzby
On Tue, Mar 17, 2020 at 02:33:32PM +0900, Michael Paquier wrote: > > Yeah, in cluster(), mark_index_clustered(). > > Patch 0002 from Justin does that, I would keep this refactoring as > HEAD-only material though, and I don't spot any other code paths in > need of patching. > > The commit message

Re: PATCH: add support for IN and @> in functional-dependency statistics use

2020-03-17 Thread Dean Rasheed
On Tue, 17 Mar 2020 at 15:37, Tomas Vondra wrote: > > On Tue, Mar 17, 2020 at 12:42:52PM +, Dean Rasheed wrote: > > >The other thing that I'm still concerned about is the possibility of > >returning estimates with P(a,b) > P(a) or P(b). I think that such a > >thing becomes much more likely

Re: [PATCH] Use PKG_CHECK_MODULES to detect the libxml2 library

2020-03-17 Thread Tom Lane
Daniel Gustafsson writes: >> On 16 Mar 2020, at 17:12, Tom Lane wrote: >> So I'm now leaning to "back-patch and make sure to mention this in >> the next release notes". Barring objections, I'll do that soon. > None from me. Done. In the event, it only seemed practical to back-patch as far as

Re: PATCH: add support for IN and @> in functional-dependency statistics use

2020-03-17 Thread Tomas Vondra
On Tue, Mar 17, 2020 at 12:42:52PM +, Dean Rasheed wrote: On Sat, 14 Mar 2020 at 18:45, Tomas Vondra wrote: I realized there's one more thing that probably needs discussing. Essentially, these two clause types are the same: a IN (1, 2, 3) (a = 1 OR a = 2 OR a = 3) but with

Re: WAL usage calculation patch

2020-03-17 Thread Julien Rouhaud
On Sun, Mar 15, 2020 at 09:52:18PM +0300, Kirill Bychik wrote: > > > > On Thu, Mar 5, 2020 at 8:55 PM Kirill Bychik > > > > wrote: > After extensive thinking and some code diving, I did not manage to > come up with a sane idea on how to expose data about autovacuum WAL > usage. Must be the flu.

Re: Berserk Autovacuum (let's save next Mandrill)

2020-03-17 Thread Justin Pryzby
On Tue, Mar 17, 2020 at 01:14:02AM +0100, Laurenz Albe wrote: > lazy_check_needs_freeze() is only called for an aggressive vacuum, which > this isn't. > --- a/src/backend/access/heap/vacuumlazy.c > +++ b/src/backend/access/heap/vacuumlazy.c > @@ -1388,17 +1388,26 @@ lazy_scan_heap(Relation

Re: Collation versioning

2020-03-17 Thread opolofdez
njhjo Enviado desde mi Redmi 4AEl Julien Rouhaud , 16 mar. 2020 3:05 p. m. escribió:On Mon, Mar 16, 2020 at 04:57:38PM +0900, Michael Paquier wrote: > On Thu, Mar 12, 2020 at 03:00:26PM +0100, Julien Rouhaud wrote: > > And v15 due to conflict with b08dee24a5 (Add pg_dump support for ALTER obj

Re: How to install https://github.com/sraoss/pgsql-ivm on postgress

2020-03-17 Thread Chapman Flack
On 3/16/20 5:51 PM, ankurthakkar wrote: > How to install https://github.com/sraoss/pgsql-ivm on postgress running on > Ubuntu and aws postgress That project appears to include its own modified version of PostgreSQL, so to use it you would simply build it. It isn't something that can just be

Re: Missing errcode() in ereport

2020-03-17 Thread Tom Lane
Amit Kapila writes: > On Tue, Mar 17, 2020 at 3:28 PM Michael Paquier wrote: >> Definitely an oversight. All stable branches down to 9.5 have >> mistakes in the same area, with nothing extra by grepping around. >> Amit, I guess that you will take care of it? > Yes, I will unless I see any

Re: custom postgres launcher for tests

2020-03-17 Thread Ivan N. Taranov
> If we support a wrapper we should support it for all pg_ctl usage IMO. As i understand it - you propose to patch pg_ctl.c & regress.c instead of PostgresNode.pm & regress.c? This is a deeper invasion to pg_ctl. There will be a conflict between the environment variable and the pg_ctl -p

Re: custom postgres launcher for tests

2020-03-17 Thread Ivan N. Taranov
> If we support a wrapper we should support it for all pg_ctl usage IMO. As i understand it - you propose to patch pg_ctl.c & regress.c instead of PostgresNode.pm & regress.c? This is a deeper invasion to pg_ctl. There will be a conflict between the environment variable and the pg_ctl -p

How to install https://github.com/sraoss/pgsql-ivm on postgress

2020-03-17 Thread ankurthakkar
How to install https://github.com/sraoss/pgsql-ivm on postgress running on Ubuntu and aws postgress -- Sent from: https://www.postgresql-archive.org/PostgreSQL-hackers-f1928748.html

Re: plan cache overhead on plpgsql expression

2020-03-17 Thread Amit Langote
Hi David, On Tue, Mar 17, 2020 at 8:53 PM David Steele wrote: > > Hi Amit, > > On 2/25/20 3:42 AM, Amit Langote wrote: > > On Tue, Feb 25, 2020 at 4:16 PM Pavel Stehule > > wrote: > >> I added this patch to a commitfest > >> > >> https://commitfest.postgresql.org/27/2467/ > >> > >> It is very

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2020-03-17 Thread Dilip Kumar
On Tue, Mar 17, 2020 at 5:14 PM Amit Kapila wrote: > > On Mon, Mar 16, 2020 at 3:24 PM Dilip Kumar wrote: > > > > + > + /* > + * Indicate that the lock is released for certain types of locks > + */ > +#ifdef USE_ASSERT_CHECKING > + CheckAndSetLockHeld(locallock, false); > +#endif > } > > /* >

Re: [HACKERS] make async slave to wait for lsn to be replayed

2020-03-17 Thread Kartyshov Ivan
I made some improvements over old implementation WAIT FOR. Synopsis == WAIT FOR [ANY | SOME | ALL] event [, event ...] and event is: LSN value options TIMESTAMP value and options is: TIMEOUT delay UNTIL TIMESTAMP timestamp ALL - option used

Re: PATCH: add support for IN and @> in functional-dependency statistics use

2020-03-17 Thread Dean Rasheed
On Sat, 14 Mar 2020 at 18:45, Tomas Vondra wrote: > > I realized there's one more thing that probably needs discussing. > Essentially, these two clause types are the same: > >a IN (1, 2, 3) > >(a = 1 OR a = 2 OR a = 3) > > but with 8f321bd1 we only recognize the first one as compatible

Re: Commitfest 2020-03 Now in Progress

2020-03-17 Thread David Steele
On 3/1/20 4:10 PM, David Steele wrote: The last Commitfest for v13 is now in progress! Current stats for the Commitfest are: Needs review: 192 Waiting on Author: 19 Ready for Committer: 4 Total: 215 Halfway through, here's where we stand. Note that a CF entry was added after the stats

Re: plan cache overhead on plpgsql expression

2020-03-17 Thread David Steele
Hi Amit, On 2/25/20 3:42 AM, Amit Langote wrote: On Tue, Feb 25, 2020 at 4:16 PM Pavel Stehule wrote: I added this patch to a commitfest https://commitfest.postgresql.org/27/2467/ It is very interesting speedup and it is in good direction to JIT expressions Thank you. I was planning to

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2020-03-17 Thread Amit Kapila
On Mon, Mar 16, 2020 at 3:24 PM Dilip Kumar wrote: > + + /* + * Indicate that the lock is released for certain types of locks + */ +#ifdef USE_ASSERT_CHECKING + CheckAndSetLockHeld(locallock, false); +#endif } /* @@ -1618,6 +1666,11 @@ GrantLockLocal(LOCALLOCK *locallock, ResourceOwner owner)

Assert() failures during RI checks

2020-03-17 Thread Antonin Houska
I was trying to figure out what exactly the "crosscheck snapshot" does in the RI checks, and hit some assertion failures: postgres=# create table p(i int primary key); CREATE TABLE postgres=# create table f (i int references p on delete cascade on update cascade deferrable initially deferred);

Re: Improving connection scalability: GetSnapshotData()

2020-03-17 Thread David Rowley
Hi, Nice performance gains. On Sun, 1 Mar 2020 at 21:36, Andres Freund wrote: > The series currently consists out of: > > 0001-0005: Fixes and assert improvements that are independent of the patch, > but >are hit by the new code (see also separate thread). > > 0006: Move delayChkpt

Re: [HACKERS] [PATCH] Generic type subscripting

2020-03-17 Thread Dmitry Dolgov
> On Tue, Mar 17, 2020 at 11:03:22AM +0100, Pavel Stehule wrote: > > here is a attached fixed first patch > > v30-0001-Base-implementation-of-subscripting-mechanism.patch > > My objectives are fixed. I checked this patch and > > There are not problems with build (code, documentation) > All tests

Re: Missing errcode() in ereport

2020-03-17 Thread Amit Kapila
On Tue, Mar 17, 2020 at 3:28 PM Michael Paquier wrote: > > On Tue, Mar 17, 2020 at 10:26:57AM +0100, Julien Rouhaud wrote: > > On Tue, Mar 17, 2020 at 10:00 AM Amit Kapila > > wrote: > >> +1. This looks like an oversight to me. > > > > good catch! And patch LGTM. > > Definitely an oversight.

Re: [HACKERS] [PATCH] Generic type subscripting

2020-03-17 Thread Pavel Stehule
Hi > Hi > > please rebase this patch > here is a attached fixed first patch v30-0001-Base-implementation-of-subscripting-mechanism.patch My objectives are fixed. I checked this patch and There are not problems with build (code, documentation) All tests passed The code is well documented I

Re: Missing errcode() in ereport

2020-03-17 Thread Michael Paquier
On Tue, Mar 17, 2020 at 10:26:57AM +0100, Julien Rouhaud wrote: > On Tue, Mar 17, 2020 at 10:00 AM Amit Kapila wrote: >> +1. This looks like an oversight to me. > > good catch! And patch LGTM. Definitely an oversight. All stable branches down to 9.5 have mistakes in the same area, with

Re: Missing errcode() in ereport

2020-03-17 Thread Julien Rouhaud
On Tue, Mar 17, 2020 at 10:00 AM Amit Kapila wrote: > > On Tue, Mar 17, 2020 at 2:08 PM Masahiko Sawada > wrote: > > > > Hi, > > > > In PageIsVerified() we report a WARNING as follows: > > > > ereport(WARNING, > > (ERRCODE_DATA_CORRUPTED, > > errmsg("page

Re: pg_ls_tmpdir to show directories and shared filesets (and pg_ls_*)

2020-03-17 Thread Fabien COELHO
About v13, seens as one patch: Function "pg_ls_dir_metadata" documentation suggests a variable number of arguments with brackets, but parameters are really mandatory. postgres=# SELECT pg_ls_dir_metadata('.'); ERROR: function pg_ls_dir_metadata(unknown) does not exist LINE 1: SELECT

Re: Missing errcode() in ereport

2020-03-17 Thread Amit Kapila
On Tue, Mar 17, 2020 at 2:08 PM Masahiko Sawada wrote: > > Hi, > > In PageIsVerified() we report a WARNING as follows: > > ereport(WARNING, > (ERRCODE_DATA_CORRUPTED, > errmsg("page verification failed, calculated checksum > %u but expected %u", >

Missing errcode() in ereport

2020-03-17 Thread Masahiko Sawada
Hi, In PageIsVerified() we report a WARNING as follows: ereport(WARNING, (ERRCODE_DATA_CORRUPTED, errmsg("page verification failed, calculated checksum %u but expected %u", checksum, p->pd_checksum))); However the error message

Re: [HACKERS] advanced partition matching algorithm for partition-wise join

2020-03-17 Thread Etsuro Fujita
Hi Ashutosh, On Wed, Mar 4, 2020 at 1:48 AM Ashutosh Bapat wrote: > I reviewed the patch. Except for the logic of matching the pairs of > partitions from already merged partitions, I think the code changes are good. > But there are several places where it needs further changes to comments. The

  1   2   >