Re: PATCH: psql tab completion for SELECT

2018-03-20 Thread Edmund Horner
On 8 March 2018 at 17:23, Edmund Horner wrote: > New patch that fixes a little bug with appending NULL addons to schema > queries. Hi all, I haven't heard anything for a while and so assume you're beavering away on real features. :) I've been dogfooding this patch at work, and I am personally p

Re: [HACKERS] taking stdbool.h into use

2018-03-20 Thread Tom Lane
Andres Freund writes: > On March 20, 2018 8:24:41 PM PDT, Michael Paquier wrote: >> Yeah, I agree with that. Just not using stdbool.h in those cases ought >> to be fine. Any platforms where sizeof(bool) is 4 involves macos older >> than 10.5 and Windows platforms using MSVC versions older than

Re: pg_get_functiondef forgets about most GUC_LIST_INPUT GUCs

2018-03-20 Thread Tom Lane
Michael Paquier writes: > On Tue, Mar 20, 2018 at 01:27:35PM -0400, Tom Lane wrote: >> + if (flags & GUC_LIST_QUOTE) >> + elog(FATAL, "extensions cannot define GUC_LIST_QUOTE >> variables"); > This would be better as an ereport with ERRCODE_FEATURE_NOT_SUPPORTED I > think. A

Re: pg_get_functiondef forgets about most GUC_LIST_INPUT GUCs

2018-03-20 Thread Michael Paquier
On Tue, Mar 20, 2018 at 01:27:35PM -0400, Tom Lane wrote: > 1. Only GUC_LIST_QUOTE variables need to be special-cased. It works > fine to treat plain LIST variables (e.g. datestyle) with the regular > code path. This is good because there are so few of them. Check. > 2. We should make an effort

Re: [HACKERS] taking stdbool.h into use

2018-03-20 Thread Andres Freund
On March 20, 2018 8:24:41 PM PDT, Michael Paquier wrote: >On Tue, Mar 20, 2018 at 02:14:23PM -0700, Andres Freund wrote: >> On 2018-03-20 17:04:22 -0400, Peter Eisentraut wrote: >> > On 3/20/18 02:18, Tom Lane wrote: >> > > I think it'd be worth identifying exactly which platforms have >> > > si

Re: Removing useless DISTINCT clauses

2018-03-20 Thread Melanie Plageman
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, passed This is a review of the patch to remove useless DISTINCT colu

Re: [HACKERS] taking stdbool.h into use

2018-03-20 Thread Michael Paquier
On Tue, Mar 20, 2018 at 02:14:23PM -0700, Andres Freund wrote: > On 2018-03-20 17:04:22 -0400, Peter Eisentraut wrote: > > On 3/20/18 02:18, Tom Lane wrote: > > > I think it'd be worth identifying exactly which platforms have > > > sizeof(bool) different from 1. Are any of them things that anyone

Re: PATCH: Configurable file mode mask

2018-03-20 Thread Michael Paquier
On Tue, Mar 20, 2018 at 05:44:22PM -0400, Stephen Frost wrote: > * David Steele (da...@pgmasters.net) wrote: >> On 3/16/18 11:12 AM, Stephen Frost wrote: >> It seems to me that pg_basebackup and pg_receivexlog should have a -g >> option to control the mode of the files that they write to disk (not

Re: JIT compiling with LLVM v12.2

2018-03-20 Thread Andres Freund
Hi, On 2018-03-20 23:03:13 -0400, Stephen Frost wrote: > Greetings, > > * Andres Freund (and...@anarazel.de) wrote: > > On 2018-03-20 19:29:55 -0700, Andres Freund wrote: > > > On 2018-03-21 15:22:08 +1300, Thomas Munro wrote: > > > > Somehow your configure test correctly concludes that my $CC (c

Re: JIT compiling with LLVM v12.2

2018-03-20 Thread Stephen Frost
Greetings, * Andres Freund (and...@anarazel.de) wrote: > On 2018-03-20 19:29:55 -0700, Andres Freund wrote: > > On 2018-03-21 15:22:08 +1300, Thomas Munro wrote: > > > Somehow your configure test correctly concludes that my $CC (clang > > > 4.0) doesn't support -fexcess-precision=standard but that

Re: JIT compiling with LLVM v12.2

2018-03-20 Thread Andres Freund
On 2018-03-20 19:29:55 -0700, Andres Freund wrote: > Hi, > > On 2018-03-21 15:22:08 +1300, Thomas Munro wrote: > > Somehow your configure test correctly concludes that my $CC (clang > > 4.0) doesn't support -fexcess-precision=standard but that my $CXX > > (clang++ 4.0) does, despite producing a ne

Re: JIT compiling with LLVM v12.2

2018-03-20 Thread Andres Freund
Hi, On 2018-03-21 15:22:08 +1300, Thomas Munro wrote: > Somehow your configure test correctly concludes that my $CC (clang > 4.0) doesn't support -fexcess-precision=standard but that my $CXX > (clang++ 4.0) does, despite producing a nearly identical warning: Yea, there was a copy & pasto (s/ac_c_

Re: JIT compiling with LLVM v12.2

2018-03-20 Thread Thomas Munro
On Wed, Mar 21, 2018 at 1:50 PM, Andres Freund wrote: > On 2018-03-20 03:14:55 -0700, Andres Freund wrote: >> My current plan is to push the first few commits relatively soon, give >> the BF a few cycles to shake out. Set up a few BF animals with each >> supported LLVM version. Then continue mergi

Re: Question about WalSndWriteData

2018-03-20 Thread Peter Eisentraut
On 3/16/18 12:08, Konstantin Knizhnik wrote: > pq_putmessage_noblock copies data from ctx->out buffer to libpq buffers. > After it we write timestamp to ctx->out buffer. > And comments says that we should do it "as late as possible". > But this timestamp is not included in the copy data packet whic

Re: JIT compiling with LLVM v12.2

2018-03-20 Thread Andres Freund
Hi, On 2018-03-20 03:14:55 -0700, Andres Freund wrote: > My current plan is to push the first few commits relatively soon, give > the BF a few cycles to shake out. Set up a few BF animals with each > supported LLVM version. Then continue mergin. I've done that. I'll set up a number of BF animals

Re: WIP: BRIN multi-range indexes

2018-03-20 Thread Tomas Vondra
ored for most "distance" functions, because those can't overflow or underflow in double precision AFAICS. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services 0001-Pass-all-keys-to-BRIN-consist

Re: [HACKERS] Optional message to user when terminating/cancelling backend

2018-03-20 Thread Daniel Gustafsson
> On 20 Mar 2018, at 12:12, Eren Başak wrote: > I reviewed the patch. Here are my notes: Thanks! > The patch does not add new tests (maybe isolation tests) for the new feature. > Are there any opportunities to have tests for confirming the new behavior? Good point, not sure why I’ve forgotten

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-20 Thread Haribabu Kommi
On Wed, Mar 21, 2018 at 6:06 AM, Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > On 3/16/18 00:03, Kyotaro HORIGUCHI wrote: > > I agree to the conclusion that PQhost() shouldn't return hostaddr > > "if it has any host name to return". But I still haven't found > > the reason for retu

Re: [PoC PATCH] Parallel dump to /dev/null

2018-03-20 Thread Stephen Frost
Greetings, * Christoph Berg (christoph.b...@credativ.de) wrote: > Re: Tom Lane 2018-03-20 <12960.1521557...@sss.pgh.pa.us> > > It might help if the patch were less enthusiastic about trying to > > "optimize" by avoiding extra file opens/closes in the case of output > > to /dev/null. That seems to

Re: JIT compiling with LLVM v12.2

2018-03-20 Thread Andres Freund
Hi, On 2018-03-21 12:07:59 +1300, Thomas Munro wrote: > The documentation builds and the resulting HTML looks good, and I like > what you've written for users and also for developers in the README > file. Cool. > Perhaps it could use something about how to know it's working > with EXPLAIN (or a

Re: JIT compiling with LLVM v12.2

2018-03-20 Thread Thomas Munro
On Tue, Mar 20, 2018 at 11:14 PM, Andres Freund wrote: > - doc proofreading, addition of --with-llvm docs The documentation builds and the resulting HTML looks good, and I like what you've written for users and also for developers in the README file. Perhaps it could use something about how to k

Re: [HACKERS] [FEATURE PATCH] pg_stat_statements with plans (v02)

2018-03-20 Thread Julian Markwort
I just realized I made a whitespace error when I modified the comments. I hope I don't make a habit of sending erroneous mails. Please accept my apologies, as well as a guaranteed whitespace-error-free patch (updated to version 5 for clarity). Julian Julian Markwort schrieb am 2018-03-20: > To

Re: PATCH: Configurable file mode mask

2018-03-20 Thread Stephen Frost
David, * David Steele (da...@pgmasters.net) wrote: > On 3/16/18 11:12 AM, Stephen Frost wrote: > > > >>> Visibly there would be no need for a -g switch in > >>> pg_basebackup as it is possible to guess from the received untar'ed > >>> files what should be the permissions of the data based on what

Re: [HACKERS] path toward faster partition pruning

2018-03-20 Thread Robert Haas
On Tue, Mar 20, 2018 at 7:07 AM, Amit Langote wrote: > On 2018/03/16 21:55, Amit Langote wrote: >> Attached updated patches. > > Attached is further revised version. > > Of note is getting rid of PartitionPruneContext usage in the static > functions of partprune.c. Most of the code there ought to

Re: INOUT parameters in procedures

2018-03-20 Thread Merlin Moncure
On Tue, Mar 20, 2018 at 4:19 PM, Merlin Moncure wrote: > A) you can't assign output variables with into: > CALL p(1) INTO i; // gives syntax error > > B) you can't assign via assignment > i := p(1); // gives error, 'use CALL' > > C) but you *can* via execute > EXECUTE 'CALL p(1)' INTO i; // this

Re: [HACKERS] [FEATURE PATCH] pg_stat_statements with plans (v02)

2018-03-20 Thread Julian Markwort
To anyone who followed along with this for so long, I'd like to present my newest version of this patch. As suggested by Arthur Zakirov, there is now only a single GUC ( pg_stat_statements.plan_track ) responsible for the selection of the plans that should be tracked. Possible values are: all,

Re: INOUT parameters in procedures

2018-03-20 Thread Merlin Moncure
On Tue, Mar 20, 2018 at 10:09 AM, Pavel Stehule wrote: > 2018-03-20 15:18 GMT+01:00 Merlin Moncure : >> >> postgres=# create or replace procedure p(a inout int default 7) as $$ >> >> begin return; end; $$ language plpgsql; >> >> CREATE PROCEDURE >> >> Time: 1.182 ms >> >> postgres=# call p(); >> >

RE: PostgreSQL 10: Segmentation fault when using GROUPING SETS with all unsortable columns

2018-03-20 Thread Huong Dangminh
Hi, Thanks for response and the fix patch. > > "Huong" == Huong Dangminh writes: > > Huong> Hi, > > Huong> I have found a case which could get segmentation fault when Huong> > using GROUPING SETS. It occurs when columns in GROUPING SETS are Huong> > all unsortable but hashable. > > Ye

Re: [HACKERS] taking stdbool.h into use

2018-03-20 Thread Andres Freund
Hi, On 2018-03-20 17:04:22 -0400, Peter Eisentraut wrote: > On 3/20/18 02:18, Tom Lane wrote: > > I think it'd be worth identifying exactly which platforms have > > sizeof(bool) different from 1. Are any of them things that anyone > > cares about going forward? The point of this patch is to ease

Re: [HACKERS] taking stdbool.h into use

2018-03-20 Thread Peter Eisentraut
On 3/20/18 02:18, Tom Lane wrote: > I think it'd be worth identifying exactly which platforms have > sizeof(bool) different from 1. Are any of them things that anyone > cares about going forward? The point of this patch is to ease > future development of extensions, but it's unlikely any extensio

Re: [HACKERS] MERGE SQL Statement for PG11

2018-03-20 Thread Peter Geoghegan
On Thu, Mar 8, 2018 at 6:59 PM, Peter Geoghegan wrote: > Phew! Thanks for your patience and perseverance. I do have more > feedback on the docs lined up, but that isn't so important right now. I want to get this feedback on the docs to you now. This is a little raw, as it's taken from notes made

Add "docs" to top-level Makefile for non-GNU make?

2018-03-20 Thread Thomas Munro
Hi hackers, I regularly type "make docs" *doh* "gmake docs" on one system and "gmake docs" *doh* "make docs" on another. Is there any reason we shouldn't add it, for consistency with other targets like check, installcheck etc? Patch attached. -- Thomas Munro http://www.enterprisedb.com 0001-

Re: [HACKERS] Partition-wise aggregation/grouping

2018-03-20 Thread Robert Haas
On Tue, Mar 20, 2018 at 10:46 AM, Jeevan Chalke wrote: > I have added all these three patches in the attached patch-set and rebased > my changes over it. > > However, I have not yet made this patch-set dependednt on UPPERREL_TLIST > changes you have proposed on another mail-thread and thus it has

Re: [PROPOSAL] Shared Ispell dictionaries

2018-03-20 Thread Tomas Vondra
On 03/20/2018 02:11 PM, Arthur Zakirov wrote: > Hello, > > On Mon, Mar 19, 2018 at 08:50:46PM +0100, Tomas Vondra wrote: >> Hi Arthur, >> >> I went through the patch - just skimming through the diffs, will do more >> testing tomorrow. Here are a few initial comments. > > Thank you for the revie

Re: configure's checks for --enable-tap-tests are insufficient

2018-03-20 Thread Alvaro Herrera
Christoph Berg wrote: > Re: Alvaro Herrera 2018-03-20 <20180320185038.r3hjvfio4elnaqku@alvherre.pgsql> > > Time::HiRes is also in libperl5.24, so as far Debian goes, that one > > would be unnecessary; but IPC::Run and Test::More are in separate > > packages (libipc-run-perl and libtest-base-perl, r

Re: [HACKERS] VACUUM and ANALYZE disagreeing on what reltuples means

2018-03-20 Thread Tomas Vondra
Hi, So here is an updated version of the patch/fix, addressing the remaining issues in v3 posted by Tom in November. The 0001 part is actually a bugfix in bloom and spgist index AM, which did something like this: reltuples = IndexBuildHeapScan(...) result->heap_tuples = result->index_t

Re: configure's checks for --enable-tap-tests are insufficient

2018-03-20 Thread Christoph Berg
Re: Alvaro Herrera 2018-03-20 <20180320185038.r3hjvfio4elnaqku@alvherre.pgsql> > Time::HiRes is also in libperl5.24, so as far Debian goes, that one > would be unnecessary; but IPC::Run and Test::More are in separate > packages (libipc-run-perl and libtest-base-perl, respectively.) The Debian pack

Re: configure's checks for --enable-tap-tests are insufficient

2018-03-20 Thread Tom Lane
Andres Freund writes: > It's also certainly annoying that AX_PROG_PERL_MODULES doesn't support > caching. Yeah, that was the main reason I didn't want to add wholesale module probing. Improving that script is no doubt possible, but it's beyond what I care to do about the issue.

Re: configure's checks for --enable-tap-tests are insufficient

2018-03-20 Thread Andres Freund
On 2018-03-20 17:23:26 +, Dagfinn Ilmari Mannsåker wrote: > Tom Lane writes: > > That seems like expensive overkill to me, especially since it seems > > unlikely that we'd keep the list up-to-date over time. > > The patches uptread add about 0.2s to a 6.9s configure run here, I don't > consi

Re: configure's checks for --enable-tap-tests are insufficient

2018-03-20 Thread Dagfinn Ilmari Mannsåker
Alvaro Herrera writes: > Tom Lane wrote: > >> Ah, thanks. Not sure we need to make an explicit test for Opcode; we've >> not heard of anyone not having that. > > In Debian stable, Opcode is in package libperl5.24. This probably > explains why nobody runs into trouble with it, since libperl is a

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-20 Thread Peter Eisentraut
On 3/16/18 00:03, Kyotaro HORIGUCHI wrote: > I agree to the conclusion that PQhost() shouldn't return hostaddr > "if it has any host name to return". But I still haven't found > the reason for returning '/tmp' for IP connection. > > The attached patch is revised version of that in the following th

Re: configure's checks for --enable-tap-tests are insufficient

2018-03-20 Thread Tom Lane
Alvaro Herrera writes: > Tom Lane wrote: >> Ah, thanks. Not sure we need to make an explicit test for Opcode; we've >> not heard of anyone not having that. > In Debian stable, Opcode is in package libperl5.24. This probably > explains why nobody runs into trouble with it, since libperl is alrea

Re: [HACKERS] plpgsql - additional extra checks

2018-03-20 Thread Pavel Stehule
2018-03-20 13:56 GMT+01:00 Tels : > Hello Pavel and Tomas, > > On Tue, March 20, 2018 12:36 am, Pavel Stehule wrote: > > 2018-03-19 21:47 GMT+01:00 Tomas Vondra : > > > >> Hi, > >> > >> I'm looking at the updated patch (plpgsql-extra-check-180316.patch), > and > >> this time it applies and builds

Re: pgsql: Fix CommandCounterIncrement in partition-related DDL

2018-03-20 Thread Alvaro Herrera
Tom Lane wrote: > Alvaro Herrera writes: > > I wonder about adding a syscache callback so that when an item in > > pg_partitioned_table is invalidated, the relcache entry for partrelid > > entry in pg_class is invalidated also. I can't find any precedent for > > anything similar, though, and ther

Re: configure's checks for --enable-tap-tests are insufficient

2018-03-20 Thread Alvaro Herrera
Tom Lane wrote: > ilm...@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) writes: > > Tom Lane writes: > >> I just want to test for modules that we know are likely to be omitted > >> on popular platforms. I've proposed testing two that would improve > >> the user experience on Red Hat; what

Re: constraint exclusion and nulls in IN (..) clause

2018-03-20 Thread Tom Lane
I wrote: > After further thought, it seems like the place to deal with this is > really operator_predicate_proof(), as in the attached draft patch > against HEAD. This passes the smell test for me, in the sense that > it's an arguably correct and general extension of the proof rules, > but it coul

Re: [HACKERS] per-sesson errors after interrupting CLUSTER pg_attribute (not attrdef)

2018-03-20 Thread Justin Pryzby
On Tue, Mar 20, 2018 at 01:03:57PM -0500, Justin Pryzby wrote: > On Tue, Oct 24, 2017 at 04:56:27PM -0700, Michael Paquier wrote: > > On Fri, Oct 20, 2017 at 9:01 AM, Justin Pryzby wrote: > > > This was briefly scary but seems to have been limited to my psql session > > > (no > > > other errors l

Re: pgsql: Fix CommandCounterIncrement in partition-related DDL

2018-03-20 Thread Tom Lane
Alvaro Herrera writes: > I wonder about adding a syscache callback so that when an item in > pg_partitioned_table is invalidated, the relcache entry for partrelid > entry in pg_class is invalidated also. I can't find any precedent for > anything similar, though, and there doesn't seem to be any c

Re: pgsql: Fix CommandCounterIncrement in partition-related DDL

2018-03-20 Thread Alvaro Herrera
Alvaro Herrera wrote: > Alvaro Herrera wrote: > > Fix CommandCounterIncrement in partition-related DDL > > Hmm, Prion seems unhappy about this. Looking Here's a patch that seems to fix the problem, and generally looks sane to me. The previous arrangements to avoid CCI seem brittle: apparently w

Re: configure's checks for --enable-tap-tests are insufficient

2018-03-20 Thread Tom Lane
ilm...@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) writes: > Tom Lane writes: >> I just want to test for modules that we know are likely to be omitted >> on popular platforms. I've proposed testing two that would improve >> the user experience on Red Hat; what's the equivalent minimum

Re: [HACKERS] per-sesson errors after interrupting CLUSTER pg_attribute (not attrdef)

2018-03-20 Thread Justin Pryzby
On Tue, Oct 24, 2017 at 04:56:27PM -0700, Michael Paquier wrote: > On Fri, Oct 20, 2017 at 9:01 AM, Justin Pryzby wrote: > > This was briefly scary but seems to have been limited to my psql session (no > > other errors logged). Issue with catcache (?) > > > > I realized that the backup job I'd ki

Re: [PATCH] session_replication_role = replica with TRUNCATE

2018-03-20 Thread Peter Eisentraut
So, what should we do here? The argument of the patch is that it makes the behavior of TRUNCATE consistent with DELETE, which would be good. But my argument is that the behavior of DELETE is kind of bad, and we should create more stuff like that. I also haven't seen an argument why this change is

Re: pg_get_functiondef forgets about most GUC_LIST_INPUT GUCs

2018-03-20 Thread Tom Lane
So here's what I think we should do about this: 1. Only GUC_LIST_QUOTE variables need to be special-cased. It works fine to treat plain LIST variables (e.g. datestyle) with the regular code path. This is good because there are so few of them. 2. We should make an effort to minimize the number o

Re: configure's checks for --enable-tap-tests are insufficient

2018-03-20 Thread Dagfinn Ilmari Mannsåker
Tom Lane writes: > ilm...@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) writes: >> Tom Lane writes: >>> ilm...@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) writes: I think the other way would be better simpler: we require a complete Perl core installation. > >>> And

Re: configure's checks for --enable-tap-tests are insufficient

2018-03-20 Thread Tom Lane
ilm...@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) writes: > Tom Lane writes: >> ilm...@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) writes: >>> I think the other way would be better simpler: we require a complete >>> Perl core installation. >> And you propose to test for tha

Re: configure's checks for --enable-tap-tests are insufficient

2018-03-20 Thread Dagfinn Ilmari Mannsåker
Tom Lane writes: > ilm...@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) writes: >> Tom Lane writes: >>> Ah-hah. So it seems to me that it'd be a useful exercise to start >>> from perl-base and find out what has to be added to get to working >>> TAP tests. Anyone? > >> I think the othe

Re: missing support of named convention for procedures

2018-03-20 Thread Peter Eisentraut
On 3/16/18 06:29, Pavel Stehule wrote: > attached patch fixes it The fix doesn't seem to work for LANGUAGE SQL procedures. For example: CREATE PROCEDURE ptest5(a int, b int DEFAULT 0) LANGUAGE SQL AS $$ INSERT INTO cp_test VALUES (a, 'foo'); INSERT INTO cp_test VALUES (b, 'bar'); $$; CALL ptest5

Re: [WIP PATCH] Index scan offset optimisation using visibility map

2018-03-20 Thread Michail Nikolaev
Hello everyone. I need an advice. I was reworking the patch: added support for the planner, added support for queries with projection, addded support for predicates which could be executed over index data. And.. I realized that my IndexScan is even more index-only than the original IndexOnlyScan.

Re: XID-assigned idle transactions affect vacuum's job.

2018-03-20 Thread Masahiko Sawada
On Tue, Mar 20, 2018 at 11:41 PM, Masahiko Sawada wrote: > Hi, Amit > > On Tue, Mar 20, 2018 at 8:02 PM, Amit Kapila wrote: >> On Tue, Mar 20, 2018 at 12:22 PM, Masahiko Sawada >> wrote: >>> Hi, >>> >>> Long transactions often annoy users because if a long transaction >>> exists on a database v

Re: Define variable only in the scope that needs it

2018-03-20 Thread Robert Haas
On Tue, Mar 20, 2018 at 7:11 AM, Antonin Houska wrote: > I suppose the current definition in the higher scope is not intentional. This > is what I suggest: This is moot in light of commit 4f15e5d09de276fb77326be5567dd9796008ca2e. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Ente

Re: PATCH: Configurable file mode mask

2018-03-20 Thread David Steele
On 3/16/18 11:12 AM, Stephen Frost wrote: > >>> Visibly there would be no need for a -g switch in >>> pg_basebackup as it is possible to guess from the received untar'ed >>> files what should be the permissions of the data based on what is >>> received in pg_basebackup.c. It would also be necessa

Re: INOUT parameters in procedures

2018-03-20 Thread Pavel Stehule
2018-03-20 15:18 GMT+01:00 Merlin Moncure : > On Tue, Mar 20, 2018 at 9:09 AM, Pavel Stehule > wrote: > >> Edit: In one case, after dropping the function and recreating it, I > >> got the procedure to return 0 where it had not before, so this smells > >> like a bug. > >> postgres=# call p(); > >>

Re: [PoC PATCH] Parallel dump to /dev/null

2018-03-20 Thread Christoph Berg
Re: Tom Lane 2018-03-20 <12960.1521557...@sss.pgh.pa.us> > It might help if the patch were less enthusiastic about trying to > "optimize" by avoiding extra file opens/closes in the case of output > to /dev/null. That seems to account for a lot of the additional > complication, and I can't see a re

Re: [PoC PATCH] Parallel dump to /dev/null

2018-03-20 Thread Tom Lane
Christoph Berg writes: > Re: Michael Paquier 2018-03-20 <20180320135720.ge13...@paquier.xyz> >> Now, why are people using pg_dump > /dev/null? Mainly the lack of >> better tools, which would be actually able to detect pages in corrupted >> pages in one run, and not only heap pages. I honestly th

Re: file cloning in pg_upgrade and CREATE DATABASE

2018-03-20 Thread Peter Eisentraut
On 3/19/18 22:58, Michael Paquier wrote: > I have been thinking about this patch over the night, and here is a list > of bullet points which would be nice to tackle: > - Remove the current diff in copydir. done > - Extend copy_file so as it is able to use fcopyfile. fcopyfile() does not support

Re: [HACKERS] Partition-wise aggregation/grouping

2018-03-20 Thread Jeevan Chalke
Hi, On Mon, Mar 19, 2018 at 10:56 PM, Robert Haas wrote: > On Fri, Mar 16, 2018 at 1:50 PM, Ashutosh Bapat > wrote: > > Ok. That looks good. > > Here's an updated version. In this version, based on a voice > discussion with Ashutosh and Jeevan, I adjusted 0001 to combine it > with an earlier i

Re: Lack of T_TargetEntry in exprType function

2018-03-20 Thread Tom Lane
Konstantin Knizhnik writes: > On 20.03.2018 17:00, Tom Lane wrote: >> It's intentional because that's not considered an executable >> expression. > I tried to apply this function to the argument of Aggref and it has > exactly this kind. > Aggref is executable expression. This is why I thought th

Re: XID-assigned idle transactions affect vacuum's job.

2018-03-20 Thread Masahiko Sawada
Hi, Amit On Tue, Mar 20, 2018 at 8:02 PM, Amit Kapila wrote: > On Tue, Mar 20, 2018 at 12:22 PM, Masahiko Sawada > wrote: >> Hi, >> >> Long transactions often annoy users because if a long transaction >> exists on a database vacuum cannot reclaim efficiently. There are >> several reason why the

Re: configure's checks for --enable-tap-tests are insufficient

2018-03-20 Thread Tom Lane
ilm...@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) writes: > Tom Lane writes: >> Ah-hah. So it seems to me that it'd be a useful exercise to start >> from perl-base and find out what has to be added to get to working >> TAP tests. Anyone? > I think the other way would be better simpl

Re: Online enabling of checksums

2018-03-20 Thread Magnus Hagander
On Mon, Mar 19, 2018 at 7:27 AM, Heikki Linnakangas wrote: > Hi, > > The patch looks good to me at a high level. Some notes below. I didn't > read through the whole thread, so sorry if some of these have been > discussed already. > > +void >> +ShutdownChecksumHelperIfRunning(void) >> +{ >> +

Re: XID-assigned idle transactions affect vacuum's job.

2018-03-20 Thread Tom Lane
Masahiko Sawada writes: > I think that to decide which deleted tuples must be preserved we don't > need to care about backend PGXACT.xid but must care about PGXACT.xmin. Surely this is wrong? Assume that the XID in question is the oldest one visible in the ProcArray (if it isn't, the question is

Re: [PoC PATCH] Parallel dump to /dev/null

2018-03-20 Thread Christoph Berg
Re: Michael Paquier 2018-03-20 <20180320135720.ge13...@paquier.xyz> > Now, why are people using pg_dump > /dev/null? Mainly the lack of > better tools, which would be actually able to detect pages in corrupted > pages in one run, and not only heap pages. I honestly think that > amcheck is somethi

Re: configure's checks for --enable-tap-tests are insufficient

2018-03-20 Thread Dagfinn Ilmari Mannsåker
Tom Lane writes: > ilm...@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) writes: >> Note that Fedora aren't the only ones to do this: Debian also splits the >> Perl core dist into multiple packages. The crucial difference is that >> on Debian installing the 'perl' package gives you the w

Re: Lack of T_TargetEntry in exprType function

2018-03-20 Thread Konstantin Knizhnik
On 20.03.2018 17:00, Tom Lane wrote: Konstantin Knizhnik writes: Is there any reason for not handling T_TargetEntry node kind in exprType() function in nodeFuncs.c? It's intentional because that's not considered an executable expression. I tried to apply this function to the argument of Ag

Re: INOUT parameters in procedures

2018-03-20 Thread Merlin Moncure
On Tue, Mar 20, 2018 at 9:09 AM, Pavel Stehule wrote: >> Edit: In one case, after dropping the function and recreating it, I >> got the procedure to return 0 where it had not before, so this smells >> like a bug. >> postgres=# call p(); >> 2018-03-20 09:04:50.543 CDT [21494] ERROR: function p() d

Re: INOUT parameters in procedures

2018-03-20 Thread Pavel Stehule
2018-03-20 15:05 GMT+01:00 Merlin Moncure : > On Wed, Feb 28, 2018 at 4:28 PM, Peter Eisentraut > wrote: > > This patch set adds support for INOUT parameters to procedures. > > Currently, INOUT and OUT parameters are not supported. > > > > A top-level CALL returns the output parameters as a resul

Re: INOUT parameters in procedures

2018-03-20 Thread Merlin Moncure
On Wed, Feb 28, 2018 at 4:28 PM, Peter Eisentraut wrote: > This patch set adds support for INOUT parameters to procedures. > Currently, INOUT and OUT parameters are not supported. > > A top-level CALL returns the output parameters as a result row. In > PL/pgSQL, I have added special support to pa

Re: Lack of T_TargetEntry in exprType function

2018-03-20 Thread Tom Lane
Konstantin Knizhnik writes: > Is there any reason for not handling T_TargetEntry node kind in > exprType() function in nodeFuncs.c? It's intentional because that's not considered an executable expression. > But why in this case it is handled in the exprLocation function? There are lots of thin

Re: [PoC PATCH] Parallel dump to /dev/null

2018-03-20 Thread Michael Paquier
On Tue, Mar 20, 2018 at 09:54:07AM +0100, Christoph Berg wrote: > Otherwise, +1 from me. I have been thinking about this patch lately, and on the contrary I am voting -1 for the concepts behind this patch. pg_dump is by nature a tool aimed at fetching data from the database, at putting it in a sh

Re: configure's checks for --enable-tap-tests are insufficient

2018-03-20 Thread Tom Lane
ilm...@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) writes: > Note that Fedora aren't the only ones to do this: Debian also splits the > Perl core dist into multiple packages. The crucial difference is that > on Debian installing the 'perl' package gives you the whole lot, while > on Fed

Re: [PROPOSAL] Shared Ispell dictionaries

2018-03-20 Thread Arthur Zakirov
Hello, On Mon, Mar 19, 2018 at 08:50:46PM +0100, Tomas Vondra wrote: > Hi Arthur, > > I went through the patch - just skimming through the diffs, will do more > testing tomorrow. Here are a few initial comments. Thank you for the review! > 1) max_shared_dictionaries_size / PGC_POSTMASTER > > I

[no subject]

2018-03-20 Thread Torsten Grust
G'day all, what is the recommended method to dump the steps[] array of EvalSteps for a compiled expression, showing the opcodes themselves as well as details/arguments for the various opcodes? (I am asking out of curiosity and for teaching purposes.) This must have been done plenty of time already

Re: [HACKERS] plpgsql - additional extra checks

2018-03-20 Thread Tels
Hello Pavel and Tomas, On Tue, March 20, 2018 12:36 am, Pavel Stehule wrote: > 2018-03-19 21:47 GMT+01:00 Tomas Vondra : > >> Hi, >> >> I'm looking at the updated patch (plpgsql-extra-check-180316.patch), and >> this time it applies and builds OK. The one thing I noticed is that the >> documentati

Re: [HACKERS] Optional message to user when terminating/cancelling backend

2018-03-20 Thread Christoph Berg
Re: Eren Başak 2018-03-20 > Another thing is that, in a similar manner, we could allow changing the > error code which might be useful for extensions. For example, Citus could > use it to cancel remote backends when it detects a distributed deadlock and > changes the error code to something retry

Re: [HACKERS] path toward faster partition pruning

2018-03-20 Thread David Rowley
On 21 March 2018 at 00:07, Amit Langote wrote: > Attached is further revised version. In the 0004 patch I see: @@ -1439,6 +1441,10 @@ inheritance_planner(PlannerInfo *root) if (IS_DUMMY_PATH(subpath)) continue; + /* Add the current parent's RT index to the partitioned rels set. */ + partiti

Re: [HACKERS] plpgsql - additional extra checks

2018-03-20 Thread Tomas Vondra
On 03/20/2018 05:36 AM, Pavel Stehule wrote: > > > 2018-03-19 21:47 GMT+01:00 Tomas Vondra >: > > Hi, > > I'm looking at the updated patch (plpgsql-extra-check-180316.patch), and > this time it applies and builds OK. The one thing I noticed is

Re: [HACKERS] Add support for tuple routing to foreign partitions

2018-03-20 Thread Alvaro Herrera
Hi, Amit Langote wrote: > 2. If I understand the description you provided in [1] correctly, the > point of having ri_PartitionIsValid and ExecInitExtraPartitionInfo() is to > avoid possibly-redundantly performing following two steps in > ExecSetupPartitionTupleRouting() for *reused* partition Res

Lack of T_TargetEntry in exprType function

2018-03-20 Thread Konstantin Knizhnik
Is there any reason for not handling T_TargetEntry node kind in exprType() function in nodeFuncs.c? Is it considered as non-valid expression tag? But why in this case it is handled in the exprLocation function? -- Konstantin Knizhnik Postgres Professional: http://www.postgrespro.com The Russian

Re: [HACKERS] Add support for tuple routing to foreign partitions

2018-03-20 Thread Etsuro Fujita
Hi Amit, (2018/03/20 15:57), Amit Langote wrote: On 2018/03/19 20:25, Amit Langote wrote: That's all I have for now. Will reply to your previous email. While testing this patch, I noticed a crash when performing EXPLAIN on update of a partition tree containing foreign partitions. Crash occ

Re: ON CONFLICT DO UPDATE for partitioned tables

2018-03-20 Thread Etsuro Fujita
(2018/03/20 13:30), Amit Langote wrote: On 2018/03/19 21:59, Etsuro Fujita wrote: (2018/03/18 13:17), Alvaro Herrera wrote: Alvaro Herrera wrote: The only thing that I remain unhappy about this patch is the whole adjust_and_expand_partition_tlist() thing. I fear we may be doing redundant and/o

Re: configure's checks for --enable-tap-tests are insufficient

2018-03-20 Thread Dagfinn Ilmari Mannsåker
Tom Lane writes: > Craig Ringer writes: >> On 19 March 2018 at 23:56, Tom Lane wrote: >>> ... much excavation finds a complaint about Time::HiRes not being installed > >> That's absurd. Time::HiRes is a core module, as is Test::More. Sigh. > >> Yes, looks like tests are necessary. I'd argue it'

Re: [HACKERS] Optional message to user when terminating/cancelling backend

2018-03-20 Thread Eren Başak
Hi, I reviewed the patch. Here are my notes: I can confirm that the patches apply and pass the tests as of 03/19/2018 @ 11:00am (UTC). I didn't test whether the docs compile or look good. I have briefly tested and can confirm that the patch does what is intended. Here are my comments about the

Define variable only in the scope that needs it

2018-03-20 Thread Antonin Houska
I suppose the current definition in the higher scope is not intentional. This is what I suggest: diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c new file mode 100644 index 9c4a1ba..ae35e1e *** a/src/backend/optimizer/plan/planner.c --- b/src/backend/optimi

Re: XID-assigned idle transactions affect vacuum's job.

2018-03-20 Thread Amit Kapila
On Tue, Mar 20, 2018 at 12:22 PM, Masahiko Sawada wrote: > Hi, > > Long transactions often annoy users because if a long transaction > exists on a database vacuum cannot reclaim efficiently. There are > several reason why they exist on a database but it's a common case > where users or application

Re: JIT compiling with LLVM v12.2

2018-03-20 Thread Andres Freund
Hi, I've pushed a revised and rebased version of my JIT patchset. The git tree is at https://git.postgresql.org/git/users/andresfreund/postgres.git in the jit branch https://git.postgresql.org/gitweb/?p=users/andresfreund/postgres.git;a=shortlog;h=refs/heads/jit There's a lot of tiny changes

Re: [HACKERS] [PATCH] Generic type subscripting

2018-03-20 Thread Oleksandr Shulgin
On Tue, Mar 6, 2018 at 6:21 PM, Dmitry Dolgov <9erthali...@gmail.com> wrote: > > One more small update after fd1a421fe6 in attachments. > Before looking at the code I have a few comments about documentation: in json.sgml: +-- Extract value by key +SELECT ('{"a": 1}'::jsonb)['a']; What is the r

Re: PostgreSQL 10: Segmentation fault when using GROUPING SETS with all unsortable columns

2018-03-20 Thread Andrew Gierth
> "Andrew" == Andrew Gierth writes: Huong> Not yet fully understand the related commit, but I think it is Huong> fine to put ERRCODE_FEATURE_NOT_SUPPORTED error from Huong> preprocess_grouping_sets when all columns in GROUPING SETS are Huong> unsortable. Is that right? Andrew> No, that'

Re: Online enabling of checksums

2018-03-20 Thread Magnus Hagander
On Tue, Mar 20, 2018 at 10:29 AM, Andrey Borodin wrote: > Hi! > > > 19 марта 2018 г., в 11:27, Heikki Linnakangas > написал(а): > > > > Is there no way to stop the checksum helper once it's started? That > seems rather user-unfriendly. I can imagine it being a pretty common > mistake to call pg_

Re: INOUT parameters in procedures

2018-03-20 Thread Rushabh Lathia
On Tue, Mar 20, 2018 at 6:38 AM, Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > On 3/19/18 03:25, Rushabh Lathia wrote: > > For the FUNCTION when we have single OUT/INOUT parameter > > the return type for that function will be set to the type of OUT > parameter. > > But in case of P

Re: Online enabling of checksums

2018-03-20 Thread Andrey Borodin
Hi! > 19 марта 2018 г., в 11:27, Heikki Linnakangas написал(а): > > Is there no way to stop the checksum helper once it's started? That seems > rather user-unfriendly. I can imagine it being a pretty common mistake to > call pg_enable_data_checksums() on a 10 TB cluster, only to realize that y

  1   2   >