Re: pgbench -M option can be specified more than once

2018-11-03 Thread Fabien COELHO
Hello Tatsuo-san, While playing with pgbench, I found multiple "-M query_mode" can be set more than once. As already said by others, the "last one win" is somehow a useful feature, so I'd prefer avoiding erroring out on this one. This could leave: (1) improving pgbench doc by spelling ou

Re: Hooks to Modify Execution Flow and Query Planner

2018-11-03 Thread Vincent Mirian
Hi Amit, Thank you for your response. Chapters 51, 57 and 59 (Overview of PostgreSQL Internals, Writing A Foreign Data Wrapper and Writing A Custom Scan Provider) seem to be relevant. Aside from the source code snippets in the document, is there functional source code that can be used as reference

Re: csv format for psql

2018-11-03 Thread Fabien COELHO
Bonjour Daniel, Here's a rebased version with a couple regression tests added per the discussions during the previous CF. Now at https://commitfest.postgresql.org/20/1861/ Patch applies cleanly, compiles, make check ok, doc gen ok. Fine with me. I switched the patch to "Ready". -- Fabien.

Re: pgbench doc fix

2018-11-03 Thread Peter Eisentraut
On 03/11/2018 01:08, Tatsuo Ishii wrote: > I like this. But maybe we can remove "named"? > > "prepared: use extended query protocol with reused prepared statements" I don't think this mouthful is useful in the --help output. The existing wording gets the message across just fine, I think. More

zheap storage_engine parameter, shouldn't this raise an error?

2018-11-03 Thread Daniel Westermann
Hi, I believe this should raise an error or at least a warning? postgres=# alter system set storage_engine = 'zheap'; ALTER SYSTEM postgres=# alter system set storage_engine = 'zheap2'; ALTER SYSTEM postgres=# alter system set storage_engine = 'zheap3'; ALTER SYSTEM postgres=# Regards Daniel

Re: zheap storage_engine parameter, shouldn't this raise an error?

2018-11-03 Thread Amit Kapila
On Sat, Nov 3, 2018 at 3:13 PM Daniel Westermann < daniel.westerm...@dbi-services.com> wrote: > Hi, > > > I believe this should raise an error or at least a warning? > > > postgres=# alter system set storage_engine = 'zheap'; > ALTER SYSTEM > postgres=# alter system set storage_engine = 'zheap2';

Re: zheap storage_engine parameter, shouldn't this raise an error?

2018-11-03 Thread Amit Kapila
On Sat, Nov 3, 2018 at 3:21 PM Amit Kapila wrote: > > On Sat, Nov 3, 2018 at 3:13 PM Daniel Westermann > wrote: >> >> Hi, >> >> >> I believe this should raise an error or at least a warning? >> > > Sure, if we want we can raise the error or warning for this, but this is a > parameter mainly to

Re: pgbench doc fix

2018-11-03 Thread Fabien COELHO
"prepared: use extended query protocol with reused prepared statements" I don't think this mouthful is useful in the --help output. The existing wording gets the message across just fine, I think. More details can be put in the reference page. These suggestions are for the online doc page

Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query

2018-11-03 Thread Amit Kapila
On Fri, Sep 28, 2018 at 7:45 AM Haribabu Kommi wrote: > > On Tue, Sep 25, 2018 at 3:09 PM Michael Paquier wrote: >> >> On Tue, Sep 25, 2018 at 01:49:09PM +1000, Haribabu Kommi wrote: >> Hmm. I see a problem with the tests and the stability of what >> pg_stat_statements_reset() can return. Norma

Re: Constraint documentation

2018-11-03 Thread Fabien COELHO
Thanks for your remarks and advices, and of course for your help to rewrite the text. So, it is now included in the new version attached. I hope it will be ok this time. At least it looks ok to me. Patch applies cleanly, doc build ok. I've put the patch as "Ready". -- Fabien.

Re: pread() and pwrite()

2018-11-03 Thread Thomas Munro
On Sat, Nov 3, 2018 at 2:07 AM Jesper Pedersen wrote: > This still applies, and passes make check-world. > > I wonder what the commit policy is on this, if the Windows part isn't > included. I read Heikki's comment [1] as it would be ok to commit > benefiting all platforms that has pread/pwrite.

Re: pgbench -M option can be specified more than once

2018-11-03 Thread Tatsuo Ishii
> Andres Freund writes: >> On 2018-11-03 10:12:14 +0900, Tatsuo Ishii wrote: >>> One of my colleagues actually believed that if both "-M extended" and >>> "-M prepared" were specified, pgbench runs in mixture of those >>> modes. So I felt avoiding such misunderstanding is more important. > >> I r

Re: partitioned indexes and tablespaces

2018-11-03 Thread Andrew Dunstan
On 11/02/2018 07:12 PM, Alvaro Herrera wrote: On 2018-Nov-03, Michael Paquier wrote: On Fri, Nov 02, 2018 at 03:53:51PM -0300, Alvaro Herrera wrote: In this thread I'm not proposing to change the behavior for tables, only for indexes. If people want to change behavior for tables (and I agr

Re: COPY FROM WHEN condition

2018-11-03 Thread Daniel Verite
David Fetter wrote: > It also seems like a violation of separation of concerns to couple > FEBE to grammar, so there'd need to be some way to do those things > separately, too. After re-reading psql/copy.c, I withdraw what I said upthread: it doesn't appear necessary to add anything to su

RE: Internal error XX000 with enable_partition_pruning=on, pg 11 beta1 on Debian

2018-11-03 Thread Phil Florent
Hi, Thanks for your work, our prototype runs OK. PostgreSQL 11 and its now fully functional partitioning feature is our validated choice to replace a well-known proprietary RDBMS in 100+ public hospitals for our dss application. Best regards Phil De : Amit Langot

plruby: rb_iterate symbol clash with libruby.so

2018-11-03 Thread Pavel Raiskup
Hi, I'm curious how it worked before (seems like the function is defined in both PostgreSQL and Ruby projects for quite some time) - but I recently came across this situation: - /bin/postgres is build-time linked with 'ld -E' - /bin/postgres dlopen()s plruby.so - plruby.so calls rb_ite

Re: Special role for subscriptions

2018-11-03 Thread Stephen Frost
Greetings, * Evgeniy Efimkin (efim...@yandex-team.ru) wrote: > In postgresql 10 and 11 only superuser can create/alter subscriptions. > If there was a special role (like pg_monitor), it would be more easy to grant > control on subscriptions. > I can make a patch if there are no objections against

Re: partitioned indexes and tablespaces

2018-11-03 Thread Alvaro Herrera
On 2018-Nov-03, Andrew Dunstan wrote: > +1. This is unquestionably a POLA violation that should be fixed, IMNSHO. Yeah, that's my view on it too. Pushed. -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Re: INSTALL file

2018-11-03 Thread Stephen Frost
Greetings, * Andreas 'ads' Scherbaum (a...@pgug.de) wrote: > On 02.11.18 01:38, Stephen Frost wrote: > >* Andreas 'ads' Scherbaum (a...@pgug.de) wrote: > >>How about the attached one? Picked up your draft, and cleaned it up a bit. > >(unsurprisingly) this is looking pretty good to me. > > > >A few

Re: WIP Patch: Add a function that returns binary JSONB as a bytea

2018-11-03 Thread Merlin Moncure
On Fri, Nov 2, 2018 at 5:15 PM Andrew Dunstan wrote: > On 11/02/2018 05:20 PM, Andres Freund wrote: > > Hi, > > > > On 2018-11-02 17:02:24 -0400, Andrew Dunstan wrote: > >> On 11/02/2018 11:34 AM, Merlin Moncure wrote: > >>> Binary format consuming applications already have to deal with these > >>

Re: plruby: rb_iterate symbol clash with libruby.so

2018-11-03 Thread Tom Lane
Pavel Raiskup writes: > Hi, I'm curious how it worked before (seems like the function is defined > in both PostgreSQL and Ruby projects for quite some time) - but I recently > came across this situation: > - /bin/postgres is build-time linked with 'ld -E' > - /bin/postgres dlopen()s plruby

Re: partitioned indexes and tablespaces

2018-11-03 Thread Robert Haas
On Fri, Nov 2, 2018 at 7:12 PM Alvaro Herrera wrote: > With all due respect, this argument makes no sense. All partitioned > indexes that exist today have a null reltablespace (all pg_class rows > already have a reltablespace column; I'm not changing that). If users I hope not, because that col

Re: plruby: rb_iterate symbol clash with libruby.so

2018-11-03 Thread Andres Freund
Hi, On 2018-11-03 14:19:46 -0400, Tom Lane wrote: > Pavel Raiskup writes: > > Hi, I'm curious how it worked before (seems like the function is defined > > in both PostgreSQL and Ruby projects for quite some time) - but I recently > > came across this situation: > > - /bin/postgres is build-ti

Re: plruby: rb_iterate symbol clash with libruby.so

2018-11-03 Thread Tom Lane
Andres Freund writes: >> Pavel Raiskup writes: >>> Is it realistic we could rename red-black tree methods from 'rb_*' to e.g. >>> 'rbt_*' to avoid this clash? > ISTM this specific case we could solve the issue by opening plruby.so / > extension sos with RTLD_DEEPBIND. That doesn't work if ruby

Re: plruby: rb_iterate symbol clash with libruby.so

2018-11-03 Thread Andres Freund
On 2018-11-03 14:39:45 -0400, Tom Lane wrote: > Andres Freund writes: > >> Pavel Raiskup writes: > >>> Is it realistic we could rename red-black tree methods from 'rb_*' to e.g. > >>> 'rbt_*' to avoid this clash? > > > ISTM this specific case we could solve the issue by opening plruby.so / > > e

Re: partitioned indexes and tablespaces

2018-11-03 Thread Alvaro Herrera
On 2018-Nov-03, Robert Haas wrote: > Well, you've guaranteed that already. Now 11 will be different from > 11.1, and tables will be different from indexes until somebody goes > and makes that consistent again. Nobody is running 11.0 in production. The people using 11.0 are just testing, and tho

Re: partitioned indexes and tablespaces

2018-11-03 Thread Andres Freund
On 2018-11-03 16:24:28 -0300, Alvaro Herrera wrote: > On 2018-Nov-03, Robert Haas wrote: > > Well, you've guaranteed that already. Now 11 will be different from > > 11.1, and tables will be different from indexes until somebody goes > > and makes that consistent again. > > Nobody is running 11.0

Re: partitioned indexes and tablespaces

2018-11-03 Thread Tom Lane
Alvaro Herrera writes: > On 2018-Nov-03, Andrew Dunstan wrote: >> +1. This is unquestionably a POLA violation that should be fixed, IMNSHO. > Yeah, that's my view on it too. > Pushed. Hmm ... in the April thread, one of the main concerns that prevented hasty action was fear of breaking dump/rest

Re: plruby: rb_iterate symbol clash with libruby.so

2018-11-03 Thread Tom Lane
Andres Freund writes: > On 2018-11-03 14:39:45 -0400, Tom Lane wrote: >> Andres Freund writes: >>> ISTM this specific case we could solve the issue by opening plruby.so / >>> extension sos with RTLD_DEEPBIND. That doesn't work if ruby extensions >>> that are loaded later use rb_iterate, but shou

Re: ToDo: show size of partitioned table

2018-11-03 Thread Pavel Stehule
pá 2. 11. 2018 v 6:17 odesílatel Amit Langote napsal: > Hi, > > On 2018/11/01 2:19, Pavel Stehule wrote: > > st 31. 10. 2018 v 7:34 odesílatel Amit Langote < > > langote_amit...@lab.ntt.co.jp> napsal: > >> On 2018/10/31 15:30, Pavel Stehule wrote: > >>> st 31. 10. 2018 v 3:27 odesílatel Amit Lang

Re: bugfix: BUG #15477: Procedure call with named inout refcursor parameter - "invalid input syntax for type boolean"

2018-11-03 Thread Tom Lane
Pavel Stehule writes: > pá 2. 11. 2018 v 9:02 odesílatel Peter Eisentraut < > peter.eisentr...@2ndquadrant.com> napsal: >> Could you explain your analysis of the problem and how this patch >> proposes to fix it? > The original code works with original function arguments - and this compare > with

Re: INSTALL file

2018-11-03 Thread Andreas 'ads' Scherbaum
On 03.11.18 18:06, Stephen Frost wrote: Greetings, * Andreas 'ads' Scherbaum (a...@pgug.de) wrote: On 02.11.18 01:38, Stephen Frost wrote: * Andreas 'ads' Scherbaum (a...@pgug.de) wrote: How about the attached one? Picked up your draft, and cleaned it up a bit. (unsurprisingly) this is looki

Re: partitioned indexes and tablespaces

2018-11-03 Thread Alvaro Herrera
On 2018-Nov-03, Tom Lane wrote: > Hmm ... in the April thread, one of the main concerns that prevented hasty > action was fear of breaking dump/restore behavior. Have you checked that > with this change, a dump/restore will restore the same state (same > actual tablespace assignments) that existe

Re: Installation instructions update (pg_ctl)

2018-11-03 Thread Andreas 'ads' Scherbaum
On 30.10.18 14:52, Andreas 'ads' Scherbaum wrote: On 30.10.18 09:04, Michael Banck wrote: Hi, On Tue, Oct 30, 2018 at 12:08:49AM +0100, Andreas 'ads' Scherbaum wrote: The installation instructions (short version) are not consistent with the "initdb" output. The first one still uses "postgres

Re: [PATCH] Improvements to "Getting started" tutorial for Google Code-in task

2018-11-03 Thread Andreas 'ads' Scherbaum
Hello, On 02.11.18 14:07, LAM JUN RONG wrote: I’m a student taking part in Google Code-in 2018. The task I am currently working on, https://codein.withgoogle.com/dashboard/task-instances/6406170207059968/, requires that I review and improve the “Getting Started”

Re: bugfix: BUG #15477: Procedure call with named inout refcursor parameter - "invalid input syntax for type boolean"

2018-11-03 Thread Tom Lane
I wrote: > I'm going to go see about converting this to just call > expand_function_arguments and then drop all the special-case code. So while looking at that ... isn't the behavior for non-writable output parameters basically insane? It certainly fails to accord with the plpgsql documentation,

Reduce maintenance burden of alternative output files with \if \quit

2018-11-03 Thread Andres Freund
Hi, We have a few alterntive expected output files that are essentially full of errors, because a certain feature isn't supported. Those are somewhat painful to maintain. I wonder if it'd be a good idea to reduce the maintenance overhead for some of them by putting something like SELECT NOT feat

Re: [PATCH] Improvements to "Getting started" tutorial for Google Code-in task

2018-11-03 Thread LAM JUN RONG
Thanks for your feedback. I'll make some changes based on your suggestions and send a new diff. Thanks! From: Andreas 'ads' Scherbaum Sent: Saturday, November 3, 2018 9:17:54 PM To: LAM JUN RONG; pgsql-hack...@postgresql.org Subject: Re: [PATCH] Improvements to "Getting started" tutorial for Goo

Re: partitioned indexes and tablespaces

2018-11-03 Thread Michael Paquier
On Sat, Nov 03, 2018 at 12:30:15PM -0700, Andres Freund wrote: > On 2018-11-03 16:24:28 -0300, Alvaro Herrera wrote: >> On 2018-Nov-03, Robert Haas wrote: >>> Well, you've guaranteed that already. Now 11 will be different from >>> 11.1, and tables will be different from indexes until somebody goes

Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query

2018-11-03 Thread Michael Paquier
On Sat, Nov 03, 2018 at 03:56:14PM +0530, Amit Kapila wrote: > Before trying out any solution or deciding which is better, I think we > want to understand why the variability in results occurred only after > your patch? Without the patch, it works just fine. Good point. We surely want to have a

Re: WIP: Avoid creation of the free space map for small tables

2018-11-03 Thread Michael Paquier
On Fri, Nov 02, 2018 at 10:38:45AM -0400, Robert Haas wrote: > I think it's in evidence, in the form of several messages mentioning a > flag called try_every_block. > > Just checking the last page of the table doesn't sound like a good > idea to me. I think that will just lead to a lot of stupid

Re: CF app feature request

2018-11-03 Thread Michael Paquier
On Fri, Nov 02, 2018 at 09:15:36PM +0100, Dmitry Dolgov wrote: > Just to make sure, if a duplicated entry will be removed, the patch itself > will stay or not? I'm asking, because both entries have the same patch > referenced, and the admin form says that one of the related items, that > would be r

Re: Resetting PGPROC atomics in ProcessInit()

2018-11-03 Thread Robert Haas
On Sat, Oct 27, 2018 at 6:41 AM Andres Freund wrote: > I just noticed, while working on a patch adding things to PGPROC, that > the group clearning patches for the proc array and clog reset atomics in > InitProcess(). > > I'm not a big fan of that, because it means that it's not safe to look > at

Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query

2018-11-03 Thread Haribabu Kommi
On Sun, Nov 4, 2018 at 11:17 AM Michael Paquier wrote: > On Sat, Nov 03, 2018 at 03:56:14PM +0530, Amit Kapila wrote: > > Before trying out any solution or deciding which is better, I think we > > want to understand why the variability in results occurred only after > > your patch? Without the p

Re: heap_sync seems rather oblivious to partitioned tables (wal_level=minimal)

2018-11-03 Thread David Rowley
On 2 November 2018 at 15:43, Steve Singer wrote: > I am happy with the changes. > I think the patch is ready for a committer. Many thanks for your review. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

RE: [PATCH] Improvements to "Getting started" tutorial for Google Code-in task

2018-11-03 Thread LAM JUN RONG
Hi, I have made some changes based on Andreas’ suggestions. > +then one or more of the packages PostgreSQL > requires is not installed. > +See for the required packages. > > How about: > then packages which are required to build > PostgreSQL are missing. > See for a list of requirement

Re: settings to control SSL/TLS protocol version

2018-11-03 Thread Steve Singer
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: not tested Documentation:tested, passed I've reviewed the patch and here are my comments. The feature se

Re: bugfix: BUG #15477: Procedure call with named inout refcursor parameter - "invalid input syntax for type boolean"

2018-11-03 Thread Pavel Stehule
Hi so 3. 11. 2018 v 22:47 odesílatel Tom Lane napsal: > I wrote: > > I'm going to go see about converting this to just call > > expand_function_arguments and then drop all the special-case code. > > So while looking at that ... isn't the behavior for non-writable output > parameters basically in

Re: Making all nbtree entries unique by having heap TIDs participate in comparisons

2018-11-03 Thread Andrey Lepikhov
On 03.11.2018 5:00, Peter Geoghegan wrote: The DESC heap TID sort order thing probably needs to go. I'll probably have to go fix the regression test failures that occur when ASC heap TID order is used. (Technically those failures are a pre-existing problem, a problem that I mask by using DESC

Re: WIP: Avoid creation of the free space map for small tables

2018-11-03 Thread Amit Kapila
On Sun, Nov 4, 2018 at 5:56 AM Michael Paquier wrote: > > On Fri, Nov 02, 2018 at 10:38:45AM -0400, Robert Haas wrote: > > I think it's in evidence, in the form of several messages mentioning a > > flag called try_every_block. > > > > Just checking the last page of the table doesn't sound like a g

Re: Tid scan improvements

2018-11-03 Thread Edmund Horner
Hi all, I have managed to split my changes into 4 patches: v3-0001-Add-selectivity-and-nullness-estimates-for-the-ItemP.patch v3-0002-Support-range-quals-in-Tid-Scan.patch v3-0003-Support-backward-scans-over-restricted-ranges-in-hea.patch v3-0004-Tid-Scan-results-are-ordered.patch (1) is basical

Re: Making all nbtree entries unique by having heap TIDs participate in comparisons

2018-11-03 Thread Peter Geoghegan
On Fri, Nov 2, 2018 at 5:00 PM Peter Geoghegan wrote: > I had the opportunity to discuss this patch at length with Heikki > during pgConf.EU. > The DESC heap TID sort order thing probably needs to go. I'll probably > have to go fix the regression test failures that occur when ASC heap > TID order

Re: Making all nbtree entries unique by having heap TIDs participate in comparisons

2018-11-03 Thread Peter Geoghegan
On Sat, Nov 3, 2018 at 8:52 PM Andrey Lepikhov wrote: > I applied your patches at top of master. After tests corrections > (related to TID ordering in index relations DROP...CASCADE operation) > 'make check-world' passed successfully many times. > In the case of 'create view' regression test - 'dr

Re: Small run-time pruning doc fix

2018-11-03 Thread David Rowley
Thanks for looking at this. On 2 November 2018 at 20:30, Peter Eisentraut wrote: > > - Execution-time partition pruning currently occurs for the > + Execution-time partition pruning currently only occurs for the > Append and MergeAppend node > types. > + It is not yet impl