Re: [HACKERS] Partition-wise aggregation/grouping

2017-12-14 Thread Ashutosh Bapat
On Thu, Dec 14, 2017 at 4:01 PM, Ashutosh Bapat wrote: > + > +-- Test when input relation for grouping is dummy > +EXPLAIN (COSTS OFF) > +SELECT c, sum(a) FROM pagg_tab WHERE 1 = 2 GROUP BY c; > + QUERY PLAN > + > + HashAggregate > + Group Key: pagg_tab.

Re: [HACKERS] Partition-wise aggregation/grouping

2017-12-14 Thread Ashutosh Bapat
On Thu, Dec 14, 2017 at 4:01 PM, Ashutosh Bapat wrote: > > + > +EXPLAIN (COSTS OFF) > +SELECT a FROM pagg_tab GROUP BY a ORDER BY 1; > + QUERY PLAN > +- > + Group > + Group Key: pagg_tab_p1.a > + -> Merge Append > + Sor

Re: procedures and plpgsql PERFORM

2017-12-14 Thread Pavel Stehule
2017-12-15 4:43 GMT+01:00 Ashutosh Bapat : > On Thu, Dec 14, 2017 at 10:16 PM, Pavel Stehule > wrote: > > > > > > 2017-12-14 17:10 GMT+01:00 David G. Johnston >: > >> > >> On Thu, Dec 14, 2017 at 8:22 AM, Merlin Moncure > >> wrote: > >>> > >>> On Thu, Dec 14, 2017 at 8:38 AM, Tom Lane wrote: >

Re: [HACKERS] replace GrantObjectType with ObjectType

2017-12-14 Thread Rushabh Lathia
On Tue, Dec 12, 2017 at 10:16 PM, Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > On 10/12/17 22:18, Stephen Frost wrote: > > I'm generally supportive of this, but I'm not entirely thrilled with how > > this ends up conflating TABLEs and RELATIONs. From the GRANT > > perspective, th

Re: procedures and plpgsql PERFORM

2017-12-14 Thread Ashutosh Bapat
On Thu, Dec 14, 2017 at 10:16 PM, Pavel Stehule wrote: > > > 2017-12-14 17:10 GMT+01:00 David G. Johnston : >> >> On Thu, Dec 14, 2017 at 8:22 AM, Merlin Moncure >> wrote: >>> >>> On Thu, Dec 14, 2017 at 8:38 AM, Tom Lane wrote: >>> > Ashutosh Bapat writes: >>> >> We allow a function to be invo

Re: procedures and plpgsql PERFORM

2017-12-14 Thread Ashutosh Bapat
On Thu, Dec 14, 2017 at 9:40 PM, David G. Johnston wrote: > On Thu, Dec 14, 2017 at 8:22 AM, Merlin Moncure wrote: >> >> On Thu, Dec 14, 2017 at 8:38 AM, Tom Lane wrote: >> > Ashutosh Bapat writes: >> >> We allow a function to be invoked as part of PERFORM statement in >> >> plpgsql >> >> ... >

Re: procedures and plpgsql PERFORM

2017-12-14 Thread Ashutosh Bapat
On Thu, Dec 14, 2017 at 8:08 PM, Tom Lane wrote: > Ashutosh Bapat writes: >> We allow a function to be invoked as part of PERFORM statement in plpgsql >> ... >> But we do not allow a procedure to be invoked this way > >> Procedures fit that category and like functions, I think, we should >> allow

GSoC 2018

2017-12-14 Thread Stephen Frost
Greetings -hackers, Google Summer of Code 2018 was announced back in September and they've changed up the timeline a bit [1]. Specifically, they moved up the dates for things like the mentoring organization application deadline, so it's time to start working on our Idea's page for 2018 in earnest

Re: pearltidy source code has been removed (pgindent)

2017-12-14 Thread David Fetter
7;s time to update to a less hoary version? If this one were any younger, it would be violating causality. http://search.cpan.org/~shancock/Perl-Tidy-20171214/lib/Perl/Tidy.pod We can probably require one somewhere in between the current one and that one without stressing anyone unduly.

Re: incorrect error message, while dropping PROCEDURE

2017-12-14 Thread Rushabh Lathia
On Fri, Dec 15, 2017 at 3:32 AM, Michael Paquier wrote: > On Fri, Dec 15, 2017 at 12:18 AM, Peter Eisentraut > wrote: > > On 12/13/17 23:31, Rushabh Lathia wrote: > >> PFA patch, where introduced new AclObjectKind (ACL_KIND_PROCEDURE), > >> msg for the new AclObjectKind, and passed it through at

Re: pearltidy source code has been removed (pgindent)

2017-12-14 Thread John Naylor
On 12/15/17, Jordan Deitch wrote: > Hi hackers, > > I am unable to build pgindent as it appears the pearltidy source has been > removed from sourceforge: I found it here: https://cpan.metacpan.org/authors/id/S/SH/SHANCOCK/Perl-Tidy-20090616.tar.gz

Re: Using ProcSignal to get memory context stats from a running backend

2017-12-14 Thread Craig Ringer
On 15 December 2017 at 09:24, Greg Stark wrote: > Another simpler option would be to open up a new file in the log > directory ... if we have one. We might be logging to syslog, or whatever else. I'd rather keep it simple(ish). -- Craig Ringer http://www.2ndQuadrant.com/

Re: [HACKERS] [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple

2017-12-14 Thread Andres Freund
On 2017-12-14 17:00:29 -0800, Andres Freund wrote: > Hi, > > On 2017-11-13 19:03:41 -0800, Andres Freund wrote: > > diff --git a/src/backend/access/heap/rewriteheap.c > > b/src/backend/access/heap/rewriteheap.c > > index f93c194e182..7d163c91379 100644 > > --- a/src/backend/access/heap/rewritehea

Re: pearltidy source code has been removed (pgindent)

2017-12-14 Thread Tom Lane
Andrew Dunstan writes: > On 12/14/2017 08:37 PM, Jordan Deitch wrote: >> I am unable to build pgindent as it appears the pearltidy source has >> been removed from sourceforge: >> https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob_plain;f=src/tools/pgindent/README;hb=HEAD > I just download

Re: pearltidy source code has been removed (pgindent)

2017-12-14 Thread Andrew Dunstan
On 12/14/2017 08:37 PM, Jordan Deitch wrote: > Hi hackers, > > I am unable to build pgindent as it appears the pearltidy source has > been removed from sourceforge: > > see prerequisite 2: > > https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob_plain;f=src/tools/pgindent/README;hb=HEAD > >

pearltidy source code has been removed (pgindent)

2017-12-14 Thread Jordan Deitch
Hi hackers, I am unable to build pgindent as it appears the pearltidy source has been removed from sourceforge: see prerequisite 2: https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob_plain;f=src/tools/pgindent/README;hb=HEAD Thanks, Jordan Deitch

Re: Using ProcSignal to get memory context stats from a running backend

2017-12-14 Thread Greg Stark
Another simpler option would be to open up a new file in the log directory something like "debug_dump..txt" and print whatever you want there. Then print out a reasonable size log entry saying "Debug dump output to file 'debug_dump..txt'". You could provide a function that reads such files out of t

Re: Top-N sorts verses parallelism

2017-12-14 Thread Thomas Munro
On Fri, Dec 15, 2017 at 10:05 AM, Jeff Janes wrote: > On Tue, Dec 12, 2017 at 10:46 PM, Thomas Munro > wrote: >> >> Hi hackers, >> >> The start-up cost of bounded (top-N) sorts is sensitive at the small >> end of N, and the >> comparison_cost * tuples * LOG2(2.0 * output_tuples) curve doesn't >>

Re: [HACKERS] [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple

2017-12-14 Thread Andres Freund
Hi, On 2017-11-13 19:03:41 -0800, Andres Freund wrote: > diff --git a/src/backend/access/heap/rewriteheap.c > b/src/backend/access/heap/rewriteheap.c > index f93c194e182..7d163c91379 100644 > --- a/src/backend/access/heap/rewriteheap.c > +++ b/src/backend/access/heap/rewriteheap.c > @@ -407,7 +40

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-12-14 Thread Masahiko Sawada
On Fri, Dec 15, 2017 at 6:46 AM, Michael Paquier wrote: > On Fri, Dec 15, 2017 at 3:52 AM, Fujii Masao wrote: >> On Mon, Dec 11, 2017 at 2:16 PM, Michael Paquier >> wrote: >>> On Mon, Dec 11, 2017 at 2:03 PM, Masahiko Sawada >>> wrote: On Sat, Dec 9, 2017 at 2:24 AM, Robert Haas wrote: >

Re: [HACKERS] Walsender timeouts and large transactions

2017-12-14 Thread Craig Ringer
On 15 December 2017 at 00:36, Andrew Dunstan wrote: > > > On 12/14/2017 01:46 AM, Craig Ringer wrote: > > On 7 December 2017 at 01:22, Petr Jelinek > > mailto:petr.jeli...@2ndquadrant.com>> > > wrote: > > > > On 05/12/17 21:07, Robert Haas wrote: > > > > > > Generally we write if (a &

Re: Would a BGW need shmem_access or database_connection to enumerate databases?

2017-12-14 Thread Michael Paquier
On Fri, Dec 15, 2017 at 8:12 AM, Chapman Flack wrote: > On 12/04/2017 09:13 AM, Craig Ringer wrote: >> On 1 December 2017 at 23:04, Chapman Flack wrote: >>> Can I call RegisterDynamicBackgroundWorker when not in the postmaster, >>> but also not in a "regular backend", but rather another BGW? >>>

Re: Would a BGW need shmem_access or database_connection to enumerate databases?

2017-12-14 Thread Chapman Flack
On 12/04/2017 09:13 AM, Craig Ringer wrote: > On 1 December 2017 at 23:04, Chapman Flack wrote: >> Can I call RegisterDynamicBackgroundWorker when not in the postmaster, >> but also not in a "regular backend", but rather another BGW? >> > Yes. BDR does it a lot. Would this doc patch be acceptable

Re: pgbench's expression parsing & negative numbers

2017-12-14 Thread Fabien COELHO
Hello, - I do not think that updating pgbench arithmetic for managing integer overflows is worth Andres Freund time. My guess is that most script would not trigger client-side overflows, so the change would be a no-op in practice. It might not be if you view it in isolation (althoug

worker_spi example BGW code GUC tweak

2017-12-14 Thread Chapman Flack
Would this sample code make an even better teaching example if it used the existing GUC way to declare that worker_spi.naptime is in units of seconds? Or does it not do that for some reason I've overlooked? -Chap >From 50fd326e5c1ff033c701f90ce09ab9b15d600593 Mon Sep 17 00:00:00 2001 From: Chapma

Re: [HACKERS] Surjective functional indexes

2017-12-14 Thread Michael Paquier
On Fri, Dec 15, 2017 at 6:15 AM, Alvaro Herrera wrote: > Konstantin Knizhnik wrote: >> If you still thing that additional 16 bytes per relation in statistic is too >> high overhead, then I will also remove autotune. > > I think it's pretty clear that these additional bytes are excessive. The bar

Re: incorrect error message, while dropping PROCEDURE

2017-12-14 Thread Michael Paquier
On Fri, Dec 15, 2017 at 12:18 AM, Peter Eisentraut wrote: > On 12/13/17 23:31, Rushabh Lathia wrote: >> PFA patch, where introduced new AclObjectKind (ACL_KIND_PROCEDURE), >> msg for the new AclObjectKind, and passed it through at >> appropriate places. > > Yeah, that's a way to do it, but having

Re: [HACKERS] [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple

2017-12-14 Thread Andres Freund
On 2017-12-07 18:32:51 +0900, Michael Paquier wrote: > On Thu, Dec 7, 2017 at 5:23 AM, Alvaro Herrera > wrote: > > Looking at 0002: I agree with the stuff being done here. > > The level of details you are providing with a proper error code is an > improvement over the first version proposed in m

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-12-14 Thread Michael Paquier
On Fri, Dec 15, 2017 at 3:52 AM, Fujii Masao wrote: > On Mon, Dec 11, 2017 at 2:16 PM, Michael Paquier > wrote: >> On Mon, Dec 11, 2017 at 2:03 PM, Masahiko Sawada >> wrote: >>> On Sat, Dec 9, 2017 at 2:24 AM, Robert Haas wrote: On Fri, Dec 8, 2017 at 4:13 AM, Michael Paquier wrote:

Re: [HACKERS] Surjective functional indexes

2017-12-14 Thread Alvaro Herrera
Konstantin Knizhnik wrote: > If you still thing that additional 16 bytes per relation in statistic is too > high overhead, then I will also remove autotune. I think it's pretty clear that these additional bytes are excessive. -- Álvaro Herrerahttps://www.2ndQuadrant.com/ Postgre

Re: Top-N sorts verses parallelism

2017-12-14 Thread Jeff Janes
On Tue, Dec 12, 2017 at 10:46 PM, Thomas Munro < thomas.mu...@enterprisedb.com> wrote: > Hi hackers, > > The start-up cost of bounded (top-N) sorts is sensitive at the small > end of N, and the > comparison_cost * tuples * LOG2(2.0 * output_tuples) curve doesn't > seem to correspond to reality. H

Re: pgsql: Provide overflow safe integer math inline functions.

2017-12-14 Thread Andres Freund
Hi, On 2017-12-14 09:28:08 +0100, Christoph Berg wrote: > Re: Andres Freund 2017-12-13 > <20171213173524.rjs7b3ahsong5...@alap3.anarazel.de> > > After staring at it for a while, I seem to have partially mis-copied the > > note for addition to the subtraction operation... > > I believe the attach

Re: pgbench's expression parsing & negative numbers

2017-12-14 Thread Andres Freund
Hi, On 2017-12-14 10:41:04 +0100, Fabien COELHO wrote: > - I do not think that updating pgbench arithmetic for managing integer >overflows is worth Andres Freund time. My guess is that most >script would not trigger client-side overflows, so the change would >be a no-op in practice.

Re: [HACKERS] Surjective functional indexes

2017-12-14 Thread Robert Haas
On Wed, Dec 13, 2017 at 12:32 PM, Konstantin Knizhnik wrote: > I can not believe that there can be more than thousand non-temporary > relations in any database. I ran across a cluster with more than 5 million non-temporary relations just this week. That's extreme, but having more than a thousand

Re: [HACKERS] Proposal for CSN based snapshots

2017-12-14 Thread Alexander Kuzmenkov
El 08/12/17 a las 14:59, Alexander Korotkov escribió: These results look promising for me.  Could you try benchmarking using more workloads including read-only and mixed mostly-read workloads? You can try same benchmarks I used in my talk about CSN in pgconf.eu [1] slides 19-2

Re: procedures and plpgsql PERFORM

2017-12-14 Thread Merlin Moncure
On Thu, Dec 14, 2017 at 11:56 AM, Pavel Stehule wrote: > > > 2017-12-14 18:33 GMT+01:00 Merlin Moncure : >> >> On Thu, Dec 14, 2017 at 10:46 AM, Pavel Stehule >> wrote: >> > >> > >> > 2017-12-14 17:10 GMT+01:00 David G. Johnston >> > : >> >> >> >> On Thu, Dec 14, 2017 at 8:22 AM, Merlin Moncure

Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

2017-12-14 Thread Fujii Masao
On Mon, Dec 11, 2017 at 2:16 PM, Michael Paquier wrote: > On Mon, Dec 11, 2017 at 2:03 PM, Masahiko Sawada > wrote: >> On Sat, Dec 9, 2017 at 2:24 AM, Robert Haas wrote: >>> On Fri, Dec 8, 2017 at 4:13 AM, Michael Paquier >>> wrote: I would just write "To avoid calling CHECK_FOR_INTE

Re: procedures and plpgsql PERFORM

2017-12-14 Thread Pavel Stehule
2017-12-14 18:33 GMT+01:00 Merlin Moncure : > On Thu, Dec 14, 2017 at 10:46 AM, Pavel Stehule > wrote: > > > > > > 2017-12-14 17:10 GMT+01:00 David G. Johnston >: > >> > >> On Thu, Dec 14, 2017 at 8:22 AM, Merlin Moncure > >> wrote: > >>> > >>> On Thu, Dec 14, 2017 at 8:38 AM, Tom Lane wrote:

Re: procedures and plpgsql PERFORM

2017-12-14 Thread Merlin Moncure
On Thu, Dec 14, 2017 at 10:46 AM, Pavel Stehule wrote: > > > 2017-12-14 17:10 GMT+01:00 David G. Johnston : >> >> On Thu, Dec 14, 2017 at 8:22 AM, Merlin Moncure >> wrote: >>> >>> On Thu, Dec 14, 2017 at 8:38 AM, Tom Lane wrote: >>> > Ashutosh Bapat writes: >>> >> We allow a function to be invo

Re: [HACKERS] Custom compression methods

2017-12-14 Thread Tomas Vondra
On 12/14/2017 04:21 PM, Robert Haas wrote: > On Wed, Dec 13, 2017 at 5:10 AM, Tomas Vondra > wrote: >>> 2. If several data types can benefit from a similar approach, it has >>> to be separately implemented for each one. >> >> I don't think the current solution improves that, though. If you >> want

Re: procedures and plpgsql PERFORM

2017-12-14 Thread Pavel Stehule
2017-12-14 17:10 GMT+01:00 David G. Johnston : > On Thu, Dec 14, 2017 at 8:22 AM, Merlin Moncure > wrote: > >> On Thu, Dec 14, 2017 at 8:38 AM, Tom Lane wrote: >> > Ashutosh Bapat writes: >> >> We allow a function to be invoked as part of PERFORM statement in >> plpgsql >> >> ... >> >> But we d

Re: [HACKERS] Walsender timeouts and large transactions

2017-12-14 Thread Andrew Dunstan
On 12/14/2017 01:46 AM, Craig Ringer wrote: > On 7 December 2017 at 01:22, Petr Jelinek > mailto:petr.jeli...@2ndquadrant.com>> > wrote: > > On 05/12/17 21:07, Robert Haas wrote: > >  > > Generally we write if (a && b) { ... } not if (a) { if (b) .. } > > > > It's rather ugly

Re: procedures and plpgsql PERFORM

2017-12-14 Thread David G. Johnston
On Thu, Dec 14, 2017 at 8:22 AM, Merlin Moncure wrote: > On Thu, Dec 14, 2017 at 8:38 AM, Tom Lane wrote: > > Ashutosh Bapat writes: > >> We allow a function to be invoked as part of PERFORM statement in > plpgsql > >> ... > >> But we do not allow a procedure to be invoked this way > > > >> Pro

Re: BUG #14941: Vacuum crashes

2017-12-14 Thread Bossart, Nathan
On 12/11/17, 9:41 PM, "Masahiko Sawada" wrote: > I also reviewed the patches. Thanks for taking a look. > For 0003 patch, if we do VACUUM (NOWAIT) to whole database we don't > get the above WARNING messages, but I think we should get them. The > reported issue also did VACUUM FULL and REINDEX to

Re: BUG #14941: Vacuum crashes

2017-12-14 Thread Bossart, Nathan
On 12/10/17, 11:13 PM, "Michael Paquier" wrote: > Let's see what other folks think first about the ANALYZE grammar in > VACUUM, as well as having ANALYZE use a parenthesized grammer. FWIW, I > like the contents of this patch set, and the thing is non-intrusive. I > think that NOWAIT gains more val

Re: [HACKERS] Custom compression methods

2017-12-14 Thread Robert Haas
On Wed, Dec 13, 2017 at 7:18 AM, Ildus Kurbangaliev wrote: > Since we agreed on ALTER syntax, i want to clear things about CREATE. > Should it be CREATE ACCESS METHOD .. TYPE СOMPRESSION or CREATE > COMPRESSION METHOD? I like the access method approach, and it > simplifies the code, but I'm just n

Re: [HACKERS] Custom compression methods

2017-12-14 Thread Robert Haas
On Wed, Dec 13, 2017 at 1:34 PM, Tomas Vondra wrote: > Wouldn't that require some universal compression level, shared by all > supported compression algorithms? I don't think there is such thing. > > Defining it should not be extremely difficult, although I'm sure there > will be some cumbersome c

Re: procedures and plpgsql PERFORM

2017-12-14 Thread Merlin Moncure
On Thu, Dec 14, 2017 at 8:38 AM, Tom Lane wrote: > Ashutosh Bapat writes: >> We allow a function to be invoked as part of PERFORM statement in plpgsql >> ... >> But we do not allow a procedure to be invoked this way > >> Procedures fit that category and like functions, I think, we should >> allow

Re: [HACKERS] Custom compression methods

2017-12-14 Thread Robert Haas
On Wed, Dec 13, 2017 at 5:10 AM, Tomas Vondra wrote: >> 2. If several data types can benefit from a similar approach, it has >> to be separately implemented for each one. > > I don't think the current solution improves that, though. If you want to > exploit internal features of individual data typ

Re: incorrect error message, while dropping PROCEDURE

2017-12-14 Thread Peter Eisentraut
On 12/13/17 23:31, Rushabh Lathia wrote: > Currently if some one try to drop the PROCEDURE and > it don't have privilege or it's not an owner, than error message > still indicate object as FUNCTION. Yes, that is actually something that is fixed by the patches proposed in the thread "replace GrantO

Re: access/parallel.h lacks PGDLLIMPORT

2017-12-14 Thread Robert Haas
On Wed, Dec 13, 2017 at 8:19 PM, Thomas Munro wrote: > I suppose that extensions are supposed to be allowed to use the > facilities in access/parallel.h. I noticed in passing when I wrote a > throwaway test harness that my Windows built drone complained: > > test_sharedtuplestore.obj : error LNK2

Sun Studio 12 vs. __builtin_constant_p()

2017-12-14 Thread Tom Lane
Well, that's annoying: buildfarm member castoroides just fell over with symptoms indicating that its compiler thinks that __builtin_constant_p("string literal") is false, thus breaking the check I installed in commit 9fa6f00b1 that AllocSetContextCreate's name argument is a literal. https://buildf

Re: PATCH: Exclude unlogged tables from base backups

2017-12-14 Thread Robert Haas
On Tue, Dec 12, 2017 at 8:48 PM, Stephen Frost wrote: > If the persistence is changed then the table will be written into the > WAL, no? All of the WAL generated during a backup (which is what we're > talking about here) has to be replayed after the restore is done and is > before the database is

Re: [HACKERS] pgbench more operators & functions

2017-12-14 Thread Fabien COELHO
Hello Teodor, Huh, you are fast. Rebase patch during half an hour. Hmmm... just lucky, and other after lunch tasks were more demanding. I haven't objection about patch idea, but I see some gotchas in coding. 1) /* Try to convert variable to numeric form; return false on failure */ static b

Re: procedures and plpgsql PERFORM

2017-12-14 Thread Tom Lane
Ashutosh Bapat writes: > We allow a function to be invoked as part of PERFORM statement in plpgsql > ... > But we do not allow a procedure to be invoked this way > Procedures fit that category and like functions, I think, we should > allow them be invoked directly without any quoting and CALL > d

Re: [HACKERS] pgbench more operators & functions

2017-12-14 Thread Teodor Sigaev
Huh, you are fast. Rebase patch during half an hour. I haven't objection about patch idea, but I see some gotchas in coding. 1) /* Try to convert variable to numeric form; return false on failure */ static bool makeVariableValue(Variable *var) as now, makeVariableValue() convert value of eny ty

Re: [HACKERS] pg_upgrade failed with error - ERROR: column "a" in child table must be marked NOT NULL

2017-12-14 Thread Ali Akbar
2017-12-14 15:08 GMT+07:00 Michael Paquier : > > On Thu, Dec 14, 2017 at 2:49 PM, Justin Pryzby wrote: > > On Thu, Dec 14, 2017 at 08:51:06AM +0700, Ali Akbar wrote: > >> 2017-12-13 15:37 GMT+07:00 Amit Langote : > >> Patch for adding check in pg_upgrade. Going through git history, the check > >>

Re: pgbench - add \if support

2017-12-14 Thread Fabien COELHO
Mostly a rebase after zipfian function commit. This patch adds \if support to pgbench, similar to psql's version added in March. This patch brings a consistent set of features especially when combined with two other patches already in the (slow) CF process: - https://commitfest.postgresql.

Re: [HACKERS] pgbench more operators & functions

2017-12-14 Thread Fabien COELHO
Attached v16 fixes those two errors. I regenerated the documentation with the new xml toolchain, and made "check" overall and in pgbench. Attached v17 is a rebase after the zipfian commit. -- Fabien.diff --git a/doc/src/sgml/ref/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgml index 4431fc3..ea8f

Re: [HACKERS] pow support for pgbench

2017-12-14 Thread Fabien COELHO
Fixed in the attached patch. v7 needs a rebase. Also, you might try to produce a version which is compatible with Robert's constraints. -- Fabien.

Re: [HACKERS] Surjective functional indexes

2017-12-14 Thread Konstantin Knizhnik
On 13.12.2017 14:29, Simon Riggs wrote: On 4 December 2017 at 15:35, Konstantin Knizhnik wrote: On 30.11.2017 05:02, Michael Paquier wrote: On Wed, Sep 27, 2017 at 4:07 PM, Simon Riggs wrote: On 15 September 2017 at 16:34, Konstantin Knizhnik wrote: Attached please find yet another vers

Re: CUBE seems a bit confused about ORDER BY

2017-12-14 Thread Teodor Sigaev
SELECT dep.classid::regclass AS class,   CASE WHEN dep.classid = 'pg_catalog.pg_class'::regclass THEN dep.objid::regclass::text        WHEN dep.classid = 'pg_catalog.pg_constraint'::regclass THEN (SELECT conname FROM pg_catalog.pg_constraint WHERE oid = dep.objid)   ELSE NULL   END AS name

Re: [HACKERS] [WIP] Zipfian distribution in pgbench

2017-12-14 Thread Teodor Sigaev
Thank you for all, pushed Fabien COELHO wrote: Note that the patch may interact with other patches which add functions to pgbench, so might need a rebase depending on the order in which the patch are applied. Attached a minor rebase after 16827d4424. -- Teodor Sigaev

Re: CUBE seems a bit confused about ORDER BY

2017-12-14 Thread Alexander Korotkov
On Thu, Dec 14, 2017 at 1:36 PM, Teodor Sigaev wrote: > Yes. I bet only few users have built indexes over ~> operator if any. >>> Ask them to reindex in the release notes seems OK for me. >>> >>> >> Is there a good way to detect such cases? Either in pg_upgrade, so that >> we can print warnings,

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

2017-12-14 Thread Masahiko Sawada
On Wed, Dec 13, 2017 at 5:57 PM, Masahiko Sawada wrote: > On Wed, Dec 13, 2017 at 4:30 PM, Andres Freund wrote: >> On 2017-12-13 16:02:45 +0900, Masahiko Sawada wrote: >>> When we add extra blocks on a relation do we access to the disk? I >>> guess we just call lseek and write and don't access to

Re: CUBE seems a bit confused about ORDER BY

2017-12-14 Thread Teodor Sigaev
Yes.  I bet only few users have built indexes over ~> operator if any. Ask them to reindex in the release notes seems OK for me. Is there a good way to detect such cases? Either in pg_upgrade, so that we can print warnings, or at least manually (which would be suitable for release notes). Hmm

Re: [HACKERS] Partition-wise aggregation/grouping

2017-12-14 Thread Ashutosh Bapat
On Wed, Dec 13, 2017 at 6:37 PM, Jeevan Chalke wrote: > > > On Tue, Dec 12, 2017 at 3:43 PM, Ashutosh Bapat > wrote: >> >> Here are review comments for 0009 > > > Thank you, Ashutosh for the detailed review so far. > > I am working on your reviews but since parallel Append is now committed, > I n

Re: pgbench's expression parsing & negative numbers

2017-12-14 Thread Fabien COELHO
Hello Andres, There are some overflow checking with div and double to int cast, which were added because of previous complaints, but which are not very useful to me. I think handling it inconsistently is the worst of all worlds. Hmmm... I cannot say that inconsistency is a good thing, that

Re: procedures and plpgsql PERFORM

2017-12-14 Thread Merlin Moncure
On Thursday, December 14, 2017, Ashutosh Bapat < ashutosh.ba...@enterprisedb.com> wrote: > Hi, > We allow a function to be invoked as part of PERFORM statement in plpgsql > do $$ > begin perform pg_relation_size('t1'); end; $$ language plpgsql; > DO > > But we do not allow a procedure to be invoke

Re: [HACKERS] Parallel Hash take II

2017-12-14 Thread Andres Freund
Hi, Looking at the main patch (v28). First off: This looks pretty good, the code's quite readable now (especially compared to earlier versions), the comments are good. Really like the nodeHash split, and the always inline hackery in nodeHashjoin. Think we're getting really really close. *

Re: pgsql: Provide overflow safe integer math inline functions.

2017-12-14 Thread Christoph Berg
Re: Andres Freund 2017-12-13 <20171213173524.rjs7b3ahsong5...@alap3.anarazel.de> > On 2017-12-13 09:37:25 -0500, Robert Haas wrote: > > On Wed, Dec 13, 2017 at 5:10 AM, Christoph Berg wrote: > > > Re: Andres Freund 2017-12-13 > > >> Provide overflow safe integer math inline functions. > > > > > >

Re: [HACKERS] pg_upgrade failed with error - ERROR: column "a" in child table must be marked NOT NULL

2017-12-14 Thread Michael Paquier
On Thu, Dec 14, 2017 at 2:49 PM, Justin Pryzby wrote: > On Thu, Dec 14, 2017 at 08:51:06AM +0700, Ali Akbar wrote: >> 2017-12-13 15:37 GMT+07:00 Amit Langote : >> Patch for adding check in pg_upgrade. Going through git history, the check >> for inconsistency in NOT NULL constraint has ben there si

Re: [HACKERS] Parallel Hash take II

2017-12-14 Thread Thomas Munro
On Thu, Dec 14, 2017 at 11:45 AM, Andres Freund wrote: > + booloverflow; /* Continuation of previous > chunk? */ > + chardata[FLEXIBLE_ARRAY_MEMBER]; > +} SharedTuplestoreChunk; > > Ah. I was thinking we could have the 'overflow' variable be an in

Re: procedures and plpgsql PERFORM

2017-12-14 Thread Pavel Stehule
2017-12-14 8:21 GMT+01:00 Ashutosh Bapat : > Hi, > We allow a function to be invoked as part of PERFORM statement in plpgsql > do $$ > begin perform pg_relation_size('t1'); end; $$ language plpgsql; > DO > > But we do not allow a procedure to be invoked this way > create procedure dummy_proc(a in