Re: Cleanup - Removal of apply_typmod function in #if 0

2020-03-01 Thread Peter Eisentraut
On 2019-10-26 10:36, vignesh C wrote: One of the function apply_typmod in numeric.c file present within #if 0. This is like this for many years. I felt this can be removed. Attached patch contains the changes to handle removal of apply_typmod present in #if 0. committed -- Peter Eisentraut

Re: [HACKERS] WAL logging problem in 9.4.3?

2020-03-01 Thread Kyotaro Horiguchi
At Sun, 1 Mar 2020 11:56:32 -0800, Noah Misch wrote in > On Thu, Feb 27, 2020 at 04:00:24PM +0900, Kyotaro Horiguchi wrote: > > It sounds somewhat obscure. > > I see. I won't use that. Thanks. > > Coulnd't we enumetate examples? And if we > > could use pg_relation_filenode, I think we can use

Re: [BUG?] postgres_fdw incorrectly updates remote table if it has inherited children.

2020-03-01 Thread Etsuro Fujita
Hi KaiGai-san, On Sun, Mar 1, 2020 at 1:47 PM Kohei KaiGai wrote: > It looks to me the latest patch was submitted by Fujita-san, Oct-2018. > Then, Tom pointer out this simple approach has a problem of inefficient remote > query plan because of no intelligence on the structure of remote tables map

Re: more ALTER .. DEPENDS ON EXTENSION fixes

2020-03-01 Thread Ahsan Hadi
On Sat, Feb 29, 2020 at 2:38 AM Alvaro Herrera wrote: > On 2020-Feb-28, ahsan hadi wrote: > > > > Tested the pg_dump patch for dumping "ALTER .. DEPENDS ON EXTENSION" in > case of indexes, functions, triggers etc. The "ALTER .. DEPENDS ON > EXTENSION" is included in the dump. However in some case

Re: BUG #16108: Colorization to the output of command-line has unproperly behaviors at Windows platform

2020-03-01 Thread Michael Paquier
On Mon, Feb 24, 2020 at 06:56:05PM +0100, Juan José Santamaría Flecha wrote: > The patch was originaly reported for Windows, but looking into Peter's > patch, I think this issue affects other systems unless we use stricter > logic to detect a colorable terminal when using the "auto" option. > Proba

Re: WIP: WAL prefetch (another approach)

2020-03-01 Thread Thomas Munro
On Wed, Feb 12, 2020 at 7:52 PM Thomas Munro wrote: > 1. It now uses effective_io_concurrency to control how many > concurrent prefetches to allow. It's possible that we should have a > different GUC to control "maintenance" users of concurrency I/O as > discussed elsewhere[1], but I'm staying o

Re: [PATCH v1] Allow COPY "text" to output a header and add header matching mode to COPY FROM

2020-03-01 Thread Surafel Temesgen
On Mon, Mar 2, 2020 at 2:45 AM Rémi Lapeyre wrote: > > I created an entry for this patch in the new CommiFest but it seems that > it is not finding it. Is there anything that I need to do? > > Is is added on next open commit fest which is https://commitfest.postgresql.org/28/ now regards Suraf

effective_io_concurrency's steampunk spindle maths

2020-03-01 Thread Thomas Munro
Hello, I was reading through some old threads[1][2][3] while trying to figure out how to add a new GUC to control I/O prefetching for new kinds of things[4][5], and enjoyed Simon Riggs' reference to Jules Verne in the context of RAID spindles. On 2 Sep 2015 14:54, "Andres Freund" wrote: > > On 2

Re: partition routing layering in nodeModifyTable.c

2020-03-01 Thread Amit Langote
On Mon, Mar 2, 2020 at 4:43 AM Tom Lane wrote: > Amit Langote writes: > > Rebased again. > > Seems to need that again, according to cfbot :-( Thank you, done. Regards, Amit v10-0002-Remove-es_result_relation_info.patch Description: Binary data v10-0003-Rearrange-partition-update-row-movemen

Re: [Patch] pg_rewind: options to use restore_command from recovery.conf or command line

2020-03-01 Thread Michael Paquier
On Fri, Feb 28, 2020 at 03:37:47PM +0300, Alexey Kondratov wrote: > I would prefer to keep it, since there are plenty of similar comments near > Asserts and elogs all over the Postgres. Otherwise it may look like a valid > error state. It may be obvious now, but for someone who is not aware of > Bu

Re: [PATCH] Add schema and table names to partition error

2020-03-01 Thread Amit Langote
Hi Chris, On Mon, Mar 2, 2020 at 8:51 AM Chris Bandy wrote: > On 3/1/20 5:14 AM, Amit Kapila wrote: > > On Sun, Mar 1, 2020 at 10:10 AM Amit Langote > > wrote: > >> This makes sense to me. Btree code which implements unique > >> constraints also does this; see _bt_check_unique() function in >

Re: logical replication empty transactions

2020-03-01 Thread Dilip Kumar
On Sat, Nov 9, 2019 at 7:29 AM Euler Taveira wrote: > > Em seg., 21 de out. de 2019 às 21:20, Jeff Janes > escreveu: > > > > After setting up logical replication of a slowly changing table using the > > built in pub/sub facility, I noticed way more network traffic than made > > sense. Looking

Re: ALTER tbl rewrite loses CLUSTER ON index

2020-03-01 Thread Michael Paquier
On Sat, Feb 29, 2020 at 10:52:58AM -0600, Justin Pryzby wrote: > Rebased Amit's patch and included my own 0002 to fix the REINDEX CONCURRENTLY > issue. I have looked at 0002 as that concerns me. > +SELECT indexrelid::regclass FROM pg_index WHERE > indrelid='concur_clustered'::regclass; > +

Re: Ought to use heap_multi_insert() for pg_attribute/depend insertions?

2020-03-01 Thread Michael Paquier
On Fri, Feb 28, 2020 at 05:24:29PM +0900, Michael Paquier wrote: > + /* > +* CONTAINS_NEW_TUPLE will always be set unless the multi_insert was > +* performed for a catalog. If it is a catalog, return immediately as > +* there is nothing to logically decode. > +*/ > + if (!(xlre

Re[4]: bool_plperl transform

2020-03-01 Thread Ivan Panchenko
Thanks, Tom.   I think now it should build, please find the fixed patch attached. I had no possibility to check it on Windows now, but the relevant changes in Mkvcbuild.pm are done, so I hope it should work. The documentation changes are also included in the same patch.   Regards, Ivan   >Понеде

Re: [PATCH] Add schema and table names to partition error

2020-03-01 Thread Chris Bandy
Thank you both for look at this! On 3/1/20 5:14 AM, Amit Kapila wrote: On Sun, Mar 1, 2020 at 10:10 AM Amit Langote wrote: Hi Chris, On Sun, Mar 1, 2020 at 4:34 AM Chris Bandy wrote: Hello, I'm writing telemetry data into a table partitioned by time. When there is no partition for a parti

Re: [PATCH v1] Allow COPY "text" to output a header and add header matching mode to COPY FROM

2020-03-01 Thread Rémi Lapeyre
I created an entry for this patch in the new CommiFest but it seems that it is not finding it. Is there anything that I need to do?

Re[2]: bool_plperl transform

2020-03-01 Thread Ivan Panchenko
  >Понедельник, 2 марта 2020, 1:09 +03:00 от ilm...@ilmari.org: >  >Wao < w...@mail.ru > writes: >  >> +Datum >> +bool_to_plperl(PG_FUNCTION_ARGS) >> +{ >> + dTHX; >> + bool in = PG_GETARG_BOOL(0); >> + SV *sv = newSVnv(SvNV(in ? &PL_sv_yes : &PL_sv_no)); >> + return PointerGetDatum(sv); >> +}

Re: Remove win32ver.rc from version_stamp.pl

2020-03-01 Thread Tom Lane
Peter Eisentraut writes: > This removes another relic from the old nmake-based Windows build. > version_stamp.pl put version number information into win32ver.rc. But > win32ver.rc already gets other version number information from the > preprocessor at build time, so it would make more sense i

Re: Allow to_date() and to_timestamp() to accept localized names

2020-03-01 Thread Tom Lane
I wrote: > * I don't think it's appropriate to hard-wire DEFAULT_COLLATION_OID > as the collation to do case-folding with. For to_date/to_timestamp, > we have collatable text input so we can rely on the function's input > collation instead, at the cost of having to pass down the collation > OID th

Re: bool_plperl transform

2020-03-01 Thread Dagfinn Ilmari Mannsåker
Wao writes: > +Datum > +bool_to_plperl(PG_FUNCTION_ARGS) > +{ > + dTHX; > + bool in = PG_GETARG_BOOL(0); > + SV *sv = newSVnv(SvNV(in ? &PL_sv_yes : &PL_sv_no)); > + return PointerGetDatum(sv); > +} Why is this only copying the floating point part of the built-in booleans be

Re: Commitfest 2020-03 Now in Progress

2020-03-01 Thread Tom Lane
David Steele writes: > The last Commitfest for v13 is now in progress! > The number of patches waiting on author seems lower (as a percentage) > than usual which I take to be a good sign. I'll be assessing the WoA > patches over the next day or two, so if your patch is in this state get > a ne

Re: pgbench: option delaying queries till connections establishment?

2020-03-01 Thread Fabien COELHO
Hello Andres, FWIW, leaving windows, error handling, and other annoyances aside, this can be implemented fairly simply. See below. Attached an attempt at improving things. I've put 2 barriers: one so that all threads are up, one when all connections are setup and the bench is ready to go.

Re: Re[2]: bool_plperl transform

2020-03-01 Thread Tom Lane
=?UTF-8?B?V2Fv?= writes: > Please find the full patch attached. The cfbot shows this failing to build on Windows: https://ci.appveyor.com/project/postgresql-cfbot/postgresql/build/1.0.81889 I believe that's a build without plperl, so what it's probably telling you is that Mkvcbuild.pm needs to

Commitfest 2020-03 Now in Progress

2020-03-01 Thread David Steele
Hackers, 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 Note that this time I'll be ignoring work done prior to the actual CF when reporting progress. Arbitrary, perhaps, but I'm

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

2020-03-01 Thread Tom Lane
Andy Fan writes: > Please see if you have any comments. Thanks The cfbot isn't at all happy with this. Its linux build is complaining about a possibly-uninitialized variable, and then giving up: https://travis-ci.org/postgresql-cfbot/postgresql/builds/656722993 The Windows build isn't using

RE: Delaying/avoiding BTreeTupleGetNAtts() call within _bt_compare()

2020-03-01 Thread Floris Van Nee
> The cfbot thinks it doesn't even apply anymore --- conflict with the dedup > patch, no doubt? Minor conflict with that patch indeed. Attached is rebased version. I'm running some tests now - will post the results here when finished. -Floris v4-0001-Avoid-pipeline-stall-in-_bt_compare.patch

Re: [HACKERS] WAL logging problem in 9.4.3?

2020-03-01 Thread Noah Misch
On Thu, Feb 27, 2020 at 04:00:24PM +0900, Kyotaro Horiguchi wrote: > At Tue, 25 Feb 2020 21:36:12 -0800, Noah Misch wrote in > > On Tue, Feb 25, 2020 at 10:01:51AM +0900, Kyotaro Horiguchi wrote: > > > At Sat, 22 Feb 2020 21:12:20 -0800, Noah Misch wrote > > > in > > > > On Fri, Feb 21, 2020 a

Re: Some improvements to numeric sqrt() and ln()

2020-03-01 Thread Dean Rasheed
On Fri, 28 Feb 2020 at 08:15, Dean Rasheed wrote: > > It's possible that there are further gains to be had in the sqrt() > algorithm on platforms that support 128-bit integers, but I haven't > had a chance to investigate that yet. > Rebased patch attached, now using 128-bit integers for part of s

Re: partition routing layering in nodeModifyTable.c

2020-03-01 Thread Tom Lane
Amit Langote writes: > Rebased again. Seems to need that again, according to cfbot :-( regards, tom lane

Re: Delaying/avoiding BTreeTupleGetNAtts() call within _bt_compare()

2020-03-01 Thread Tom Lane
Peter Geoghegan writes: > Attached is v3, which no longer includes the third patch/optimization. > It also inlines (in the second patch) by marking the _bt_compare > definition as inline, while not changing anything in nbtree.h. I > believe that this is portable C99 -- let's see what CF Tester thi

Re: [HACKERS] Cached plans and statement generalization

2020-03-01 Thread Tom Lane
Konstantin Knizhnik writes: > [ autoprepare-extended-4.patch ] The cfbot is showing that this doesn't apply anymore; there's some doubtless-trivial conflict in prepare.c. However ... TBH I've been skeptical of this whole proposal from the beginning, on the grounds that it would probably hurt mor

Re: [PATCH] Add support for ON UPDATE/DELETE actions on ALTER CONSTRAINT

2020-03-01 Thread Tom Lane
Matheus de Oliveira writes: > [ postgresql-alter-constraint.v7.patch ] cfbot says this isn't applying --- looks like a minor conflict in the regression test file. Please rebase. regards, tom lane

Re: proposal - reglanguage type

2020-03-01 Thread Pavel Stehule
ne 1. 3. 2020 v 19:31 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > I miss a reglanguage type from our set of reg* types. > > I'm skeptical about this. I don't think we want to wind up with a reg* > type for every system catalog, so there needs to be some rule about which > ones it's

Re: proposal - reglanguage type

2020-03-01 Thread Tom Lane
Pavel Stehule writes: > I miss a reglanguage type from our set of reg* types. I'm skeptical about this. I don't think we want to wind up with a reg* type for every system catalog, so there needs to be some rule about which ones it's worth the trouble for. The original idea was to provide a reg*

Re: explain HashAggregate to report bucket and memory stats

2020-03-01 Thread Justin Pryzby
Updated for new tests in 58c47ccfff20b8c125903482725c1dbfd30beade and rebased. >From 3e1904c6c36ee3ff4f56a2808c2400a3b2d2a0e5 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Tue, 31 Dec 2019 18:49:41 -0600 Subject: [PATCH v6 1/7] explain to show tuplehash bucket and memory stats.. Note that ha

Re: Planning counters in pg_stat_statements (using pgss_store)

2020-03-01 Thread legrand legrand
>> I like the idea of adding a check for a non-zero queryId in the new >> pgss_planner_hook() (zero queryid shouldn't be reserved for >> utility_statements ?). > Some assert hit later, I can say that it's not always true. For > instance a CREATE TABLE AS won't run parse analysis for the underlyin

Re: proposal \gcsv

2020-03-01 Thread Vik Fearing
On 01/03/2020 13:29, Pavel Stehule wrote: > so 29. 2. 2020 v 11:34 odesílatel Vik Fearing > napsal: > >> On 29/02/2020 06:43, Pavel Stehule wrote: >>> Hi >>> >>> I would to enhance \g command about variant \gcsv >>> >>> proposed command has same behave like \g, only the result will be every >>> t

Re: d25ea01275 and partitionwise join

2020-03-01 Thread Amit Langote
On Sat, Feb 29, 2020 at 8:18 AM Tom Lane wrote: > Amit Langote writes: > > On Wed, Nov 6, 2019 at 2:00 AM Tom Lane wrote: > >> Just to leave a breadcrumb in this thread --- the planner failure > >> induced by d25ea01275 has been fixed in 529ebb20a. The difficulty > >> with multiway full joins t

Re: Planning counters in pg_stat_statements (using pgss_store)

2020-03-01 Thread Julien Rouhaud
Hi, On Fri, Feb 28, 2020 at 4:06 PM legrand legrand wrote: > > It seems IVM team does not consider this point as a priority ... Well, IVM is a big project and I agree that fixing this issue isn't the most urgent one, especially since there's no guarantee that this pgss planning patch will be com

Re: Broken resetting of subplan hash tables

2020-03-01 Thread Ranier Vilela
Em sáb., 29 de fev. de 2020 às 18:44, Tom Lane escreveu: > "throw it away" sure looks like it means the entire hashtable, not just > its tuple contents. > I don't know if I can comment clearly to help, but from my experience, destroying and rebuilding the hashtable is a waste if possible, resetti

Re: proposal \gcsv

2020-03-01 Thread Pavel Stehule
so 29. 2. 2020 v 18:06 odesílatel David Fetter napsal: > On Sat, Feb 29, 2020 at 11:59:22AM +0100, Pavel Stehule wrote: > > so 29. 2. 2020 v 11:34 odesílatel Vik Fearing > > napsal: > > > > > On 29/02/2020 06:43, Pavel Stehule wrote: > > > > Hi > > > > > > > > I would to enhance \g command about

Re: proposal \gcsv

2020-03-01 Thread Pavel Stehule
so 29. 2. 2020 v 11:34 odesílatel Vik Fearing napsal: > On 29/02/2020 06:43, Pavel Stehule wrote: > > Hi > > > > I would to enhance \g command about variant \gcsv > > > > proposed command has same behave like \g, only the result will be every > > time in csv format. > > > > It can helps with writ

Re: [PATCH] Add schema and table names to partition error

2020-03-01 Thread Amit Kapila
On Sun, Mar 1, 2020 at 10:10 AM Amit Langote wrote: > > Hi Chris, > > On Sun, Mar 1, 2020 at 4:34 AM Chris Bandy wrote: > > Hello, > > > > I'm writing telemetry data into a table partitioned by time. When there > > is no partition for a particular date, my app notices the constraint > > violation

Re[2]: bool_plperl transform

2020-03-01 Thread Ivan Panchenko
  >Воскресенье, 1 февраля 2020, 1:15 +03:00 от Tom Lane : >  >=?UTF-8?B?SXZhbiBQYW5jaGVua28=?= < w...@mail.ru > writes: >> While using PL/Perl I have found that it obtains boolean arguments from >> Postgres as ‘t’ and ‘f’, which is extremely inconvenient because ‘f’ is not >> false from the p

Re: Improving connection scalability: GetSnapshotData()

2020-03-01 Thread Amit Kapila
On Sun, Mar 1, 2020 at 2:17 PM Andres Freund wrote: > > Hi, > > On 2020-03-01 00:36:01 -0800, Andres Freund wrote: > > conns tps mastertps pgxact-split > > > > 1 26842.49284526524.194821 > > 10 246923.158682 249224.782661 > > 50 695956.539704

Re: Yet another fast GiST build

2020-03-01 Thread Komяpa
Hello, Thanks for the patch and working on GiST infrastructure, it's really valuable for PostGIS use cases and I wait to see this improvement in PG13. On Sat, Feb 29, 2020 at 3:13 PM Andrey M. Borodin wrote: > Thomas, I've used your wording almost exactly with explanation how > point_zorder_int

proposal - reglanguage type

2020-03-01 Thread Pavel Stehule
Hi I miss a reglanguage type from our set of reg* types. It reduce a mental overhead for queries over pg_proc table With this type I can easy filter only plpgsql functions select * from pg_proc where prolang = 'plpgsql'::reglanguage and pronamespace <> 'pg_catalog'::regnamespace; Regards

Re: Improving connection scalability: GetSnapshotData()

2020-03-01 Thread Andres Freund
Hi, On 2020-03-01 00:36:01 -0800, Andres Freund wrote: > conns tps mastertps pgxact-split > > 1 26842.49284526524.194821 > 10 246923.158682 249224.782661 > 50 695956.539704 709833.746374 > 100 1054727.043139 1903616.306028

Improving connection scalability: GetSnapshotData()

2020-03-01 Thread Andres Freund
Hi, I think postgres' issues with scaling to larger numbers of connections is a serious problem in the field. While poolers can address some of that, given the issues around prepared statements, transaction state, etc, I don't think that's sufficient in many cases. It also adds latency. Nor do I

Re[2]: bool_plperl transform

2020-03-01 Thread Wao
Sorry,   Please find the full patch attached.   Ivan   >Воскресенье, 1 марта 2020, 7:57 +03:00 от Andrew Dunstan >: >  > >On 2/29/20 4:55 PM, Ivan Panchenko wrote: >> Hi, >> While using PL/Perl I have found that it obtains boolean arguments >> from Postgres as ‘t’ and ‘f’, which is extremely inc