Re: PostgreSQL vs SQL/XML Standards

2018-12-30 Thread Pavel Stehule
po 31. 12. 2018 v 3:15 odesílatel Chapman Flack napsal: > On 12/30/18 15:18, Pavel Stehule wrote: > > ne 30. 12. 2018 v 20:06 odesílatel Chapman Flack > > napsal: > >> How difficult would it be to make the grammar constructs that currently > >> accept "BY REF" (only as noise and ignore it) accep

Re: pg_dump multi VALUES INSERT

2018-12-30 Thread Surafel Temesgen
On Fri, Dec 28, 2018 at 6:46 PM Fabien COELHO wrote: > > > At first i also try to do it like that but it seems the function will > > became long and more complex to me > > Probably. But calling it with size 100 should result in the same behavior, > so it is really just an extension of the preceed

Re: reducing the footprint of ScanKeyword (was Re: Large writable variables)

2018-12-30 Thread Tom Lane
Andres Freund writes: > On 2018-12-29 16:59:52 -0500, John Naylor wrote: >> I think 0001 with complete keyword lookup replacement is in decent >> enough shape to post. Make check-world passes. A few notes and >> caveats: > I tried to take this for a spin, an for me the build fails because various

Re: reducing the footprint of ScanKeyword (was Re: Large writable variables)

2018-12-30 Thread Andres Freund
Hi, On 2018-12-29 16:59:52 -0500, John Naylor wrote: > I think 0001 with complete keyword lookup replacement is in decent > enough shape to post. Make check-world passes. A few notes and > caveats: I tried to take this for a spin, an for me the build fails because various frontend programs don't

Re: Pluggable Storage - Andres's take

2018-12-30 Thread Peter Geoghegan
On Mon, Dec 10, 2018 at 8:13 AM Dmitry Dolgov <9erthali...@gmail.com> wrote: > Just out of curiosity I've also tried tpc-c from oltpbench (in the very same > simple environment), it doesn't show any significant difference from master as > well. FWIW, I have found BenchmarkSQL to be significantly b

Error while executing initdb...

2018-12-30 Thread Rajib Deb
Dear All I put a printf statement in the "main.c" code and built it. Later when I tried to execute INITDB, I got the following error The program "postgres" was found by but was not the same version as initdb.Check your installation After some analysis, I figured out that this error is bein

Logical decoding for operations on zheap tables

2018-12-30 Thread Amit Kapila
To support logical decoding for zheap operations, we need a way to ensure zheap tuples can be registered as change streams. One idea could be that we make ReorderBufferChange aware of another kind of tuples as well, something like this: @@ -100,6 +123,20 @@ typedef struct ReorderBufferChange R

Re: add_partial_path() may remove dominated path but still in use

2018-12-30 Thread Amit Kapila
On Sun, Dec 30, 2018 at 9:01 AM Kohei KaiGai wrote: > 2018年12月30日(日) 4:12 Tom Lane : > > > > Kohei KaiGai writes: > > > 2018年12月29日(土) 1:44 Tom Lane : > > >> However, first I'd like to know why this situation is arising in the > > >> first > > >> place. To have the situation you're describing,

Re: stats_temp_directory conflicts

2018-12-30 Thread Noah Misch
On Sun, Dec 30, 2018 at 07:47:05PM -0500, Tom Lane wrote: > Noah Misch writes: > > I'm thinking the server should manage this; during startup, create > > $stats_temp_directory/PostgreSQL.$postmaster_pid and store each stats file > > therein. > > +1 > > > Just before creating that directory, scan

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

2018-12-30 Thread Mithun Cy
On Thu, Dec 6, 2018 at 10:53 PM John Naylor wrote: > On 12/3/18, Amit Kapila wrote: > > fsm_local_set is being called from RecordAndGetPageWithFreeSpace and > > GetPageWithFreeSpace whereas the change we have discussed was specific > > to GetPageWithFreeSpace, so not sure if we need any change in

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

2018-12-30 Thread Amit Kapila
On Sun, Dec 30, 2018 at 3:49 AM John Naylor wrote: > > On 12/29/18, Mithun Cy wrote: > > Results are execution time(unit ms) taken by copy statement when number of > > records equal to exact number which fit HEAP_FSM_CREATION_THRESHOLD = 4 > > pages. For fill factor 20 it is till tid (3, 43) and

doc: where best to add ~ 400 words to the manual?

2018-12-30 Thread Chapman Flack
I would like to add material to the manual, detailing the differences between the XPath 1.0 language supported in PG, and the XQuery/XPath 2.0+ expected by the standard. A good preview of what that would look like is the "related to version of XPath" wiki section at [1]. That wiki section (minus

Re: PostgreSQL vs SQL/XML Standards

2018-12-30 Thread Chapman Flack
On 12/30/18 15:18, Pavel Stehule wrote: > ne 30. 12. 2018 v 20:06 odesílatel Chapman Flack > napsal: >> How difficult would it be to make the grammar constructs that currently >> accept "BY REF" (only as noise and ignore it) accept and ignore both BY REF >> and BY VALUE? > > This is difficult que

Re: Removing --disable-strong-random from the code

2018-12-30 Thread Michael Paquier
On Sun, Dec 30, 2018 at 11:47:03AM -0500, Tom Lane wrote: > Michael Paquier writes: > > And attached is an updated patch with all those fixes included. Any > > thoughts or opinions? > > contrib/pgcrypto has some variant expected-files for the no-strong-random > case that could be removed now. >

Re: Removing --disable-strong-random from the code

2018-12-30 Thread Michael Paquier
On Sun, Dec 30, 2018 at 11:56:48AM -0500, Tom Lane wrote: > Oh, one more thought: the removal of the --disable-strong-random > documentation stanza means there's no explanation of what to do > to build on platforms without /dev/urandom. Perhaps something > like this in installation.sgml: > >

Re: Minor comment fix for pg_config_manual.h

2018-12-30 Thread Ian Barwick
On 12/29/18 8:27 AM, Michael Paquier wrote: On Fri, Dec 28, 2018 at 12:37:41AM -0300, Alvaro Herrera wrote: Looks good to me. Thanks for the lookup. I have committed and back-patched to v11 for consistency. Thanks! Regards Ian Barwick -- Ian Barwick http://www.2ndQua

Re: stats_temp_directory conflicts

2018-12-30 Thread Tom Lane
Noah Misch writes: > I'm thinking the server should manage this; during startup, create > $stats_temp_directory/PostgreSQL.$postmaster_pid and store each stats file > therein. +1 > Just before creating that directory, scan $stats_temp_directory and > delete subdirectories that no longer correspo

stats_temp_directory conflicts

2018-12-30 Thread Noah Misch
On Sun, Dec 30, 2018 at 10:32:31AM -0500, Andrew Dunstan wrote: > On 12/30/18 12:53 AM, Noah Misch wrote: > > stats_temp_directory = '/cygdrive/w/lorikeet/HEAD' > > 2. stats_temp_directory is incompatible with TAP suites that start more than > >one node simultaneously. > > It's already a pro

Re: [PATCH] Change "checkpoint starting" message to use "wal"

2018-12-30 Thread Peter Eisentraut
On 29/11/2018 09:47, Christoph Berg wrote: > A customer was complaining that the "checkpoint starting: xlog" > message was not included in the grand PG10 rename of user-visible > bits. The attached patch fixes that. committed -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQ

Synchronizing slots from primary to standby

2018-12-30 Thread Petr Jelinek
Hi, As Andres has mentioned over at minimal decoding on standby thread [1], that functionality can be used to add simple worker which periodically synchronizes the slot state from the primary to a standby. Attached patch is rough implementation of such worker. It's nowhere near committable in the

Re: [Patch] Create a new session in postmaster by calling setsid()

2018-12-30 Thread Tom Lane
Heikki Linnakangas writes: > Here's a patch to implement that. Seems to work. There is a small window > between launching postmaster and installing the signal handler, though, > where CTRL-C on pg_ctl will not abort the server launch. I think that's > acceptable. Hm ... you could partially for

Re: [Patch] Create a new session in postmaster by calling setsid()

2018-12-30 Thread Heikki Linnakangas
On 30/12/2018 21:59, Heikki Linnakangas wrote: On 28/12/2018 22:13, Tom Lane wrote: Heikki Linnakangas writes: Another idea would be to call setsid() in pg_ctl, after forking postmaster, like in Paul's original patch. That solves 1. and 2. To still do 3., add a signal handler for SIGINT in pg_

Re: PostgreSQL vs SQL/XML Standards

2018-12-30 Thread Pavel Stehule
ne 30. 12. 2018 v 20:06 odesílatel Chapman Flack napsal: > On 12/30/18 03:23, Pavel Stehule wrote: > > I agree with more stronger detail description about difference between > > XPath, XPath2 and XQuery. > > > > Some like "The XPath 1.0 is ancestor of XPath 2.0, that is part of > XQuery. > > ..."

Re: [Patch] Create a new session in postmaster by calling setsid()

2018-12-30 Thread Heikki Linnakangas
On 28/12/2018 22:13, Tom Lane wrote: Heikki Linnakangas writes: Another idea would be to call setsid() in pg_ctl, after forking postmaster, like in Paul's original patch. That solves 1. and 2. To still do 3., add a signal handler for SIGINT in pg_ctl, which forwards the SIGINT to the postmaster

Re: Shared Memory: How to use SYSV rather than MMAP ?

2018-12-30 Thread Thomas Munro
On Thu, Dec 27, 2018 at 7:25 AM Andres Freund wrote: > On December 26, 2018 6:48:31 PM GMT+01:00, Robert Haas > wrote: > >I disagree. I think there is a growing body of evidence that > >b0fc0df9364d2d2d17c0162cf3b8b59f6cb09f67 killed performance on many > >types of non-Linux systems. This is t

Re: Unified logging system for command-line programs

2018-12-30 Thread Tom Lane
Peter Eisentraut writes: > I have developed a patch that unifies the various ad hoc logging > (message printing, error printing) systems used throughout the > command-line programs. I've not read the patch in any detail, but +1 for making this more uniform. > - Common files (common/, fe_utils/,

Re: Moving slot restart_lsn/catalog_xmin more eagerly from SQL functions

2018-12-30 Thread Petr Jelinek
On 30/12/2018 20:27, Petr Jelinek wrote: > Hi, > > while messing around with slot code I noticed that the SQL functions for > consuming/moving logical replication slots only move restart_lsn up to > previously consumed position and not to currently consumed position. The > reason for that is that

Re: Optimize constant MinMax expressions

2018-12-30 Thread Vik Fearing
On 30/12/2018 19:44, Tom Lane wrote: > Vik Fearing writes: >> On 30/12/2018 00:36, Tom Lane wrote: >>> Can we assume that the underlying datatype comparison function is >>> immutable? I guess so, since we assume that in nearby code such as >>> contain_mutable_functions_walker, but I don't think i

Moving slot restart_lsn/catalog_xmin more eagerly from SQL functions

2018-12-30 Thread Petr Jelinek
Hi, while messing around with slot code I noticed that the SQL functions for consuming/moving logical replication slots only move restart_lsn up to previously consumed position and not to currently consumed position. The reason for that is that restart_lsn is not moved forward unless new value is

Re: PostgreSQL vs SQL/XML Standards

2018-12-30 Thread Chapman Flack
On 12/30/18 03:23, Pavel Stehule wrote: > I agree with more stronger detail description about difference between > XPath, XPath2 and XQuery. > > Some like "The XPath 1.0 is ancestor of XPath 2.0, that is part of XQuery. > ..." I'll be happy to work on some wording to help detail the differences.

Re: Optimize constant MinMax expressions

2018-12-30 Thread Tom Lane
Vik Fearing writes: > On 30/12/2018 00:36, Tom Lane wrote: >> Can we assume that the underlying datatype comparison function is >> immutable? I guess so, since we assume that in nearby code such as >> contain_mutable_functions_walker, but I don't think it should be done >> without at least a comm

Is MinMaxExpr really leakproof?

2018-12-30 Thread Tom Lane
contain_leaked_vars_walker asserts the following about MinMaxExpr: ... case T_MinMaxExpr: ... /* * We know these node types don't contain function calls; but * something further down in the node tree might. */

Re: Removing --disable-strong-random from the code

2018-12-30 Thread Tom Lane
I wrote: > LGTM otherwise. Oh, one more thought: the removal of the --disable-strong-random documentation stanza means there's no explanation of what to do to build on platforms without /dev/urandom. Perhaps something like this in installation.sgml: - You need OpenSSL, if you want to

Re: Removing --disable-strong-random from the code

2018-12-30 Thread Tom Lane
Michael Paquier writes: > And attached is an updated patch with all those fixes included. Any > thoughts or opinions? contrib/pgcrypto has some variant expected-files for the no-strong-random case that could be removed now. BackendRandomLock should be removed, too. Since pg_strong_random is de

Re: Move regression.diffs of pg_upgrade test suite

2018-12-30 Thread Noah Misch
On Sun, Dec 30, 2018 at 10:41:46AM -0500, Andrew Dunstan wrote: > On 12/26/18 5:44 PM, Noah Misch wrote: > > On Wed, Dec 26, 2018 at 05:02:37PM -0500, Tom Lane wrote: > >> Andrew Dunstan writes: > >>> On 12/23/18 10:44 PM, Noah Misch wrote: > A disadvantage of any change here is that it degra

Re: Move regression.diffs of pg_upgrade test suite

2018-12-30 Thread Andrew Dunstan
On 12/26/18 5:44 PM, Noah Misch wrote: > On Wed, Dec 26, 2018 at 05:02:37PM -0500, Tom Lane wrote: >> Andrew Dunstan writes: >>> On 12/23/18 10:44 PM, Noah Misch wrote: A disadvantage of any change here is that it degrades buildfarm reports, which recover slowly as owners upgrade

Re: Augment every test postgresql.conf

2018-12-30 Thread Andrew Dunstan
On 12/30/18 12:53 AM, Noah Misch wrote: > On Sat, Dec 29, 2018 at 10:46:31PM -0500, Tom Lane wrote: >> Noah Misch writes: >>> Looking more closely, we already have the TEMP_CONFIG variable and apply it >>> to >>> everything except TAP suites. Closing that gap, as attached, is enough. >>> The

Re: Removing --disable-strong-random from the code

2018-12-30 Thread Michael Paquier
On Sun, Dec 30, 2018 at 04:15:49PM +0900, Michael Paquier wrote: > On Sun, Dec 30, 2018 at 01:45:42AM -0500, Tom Lane wrote: >> Hah, I was just about to work on that myself --- glad I didn't get >> to it quite yet. A couple of thoughts: >> >> 1. Surely there's documentation about --disable-strong

Re: Using Btree to Provide Sorting on Suffix Keys with LIMIT

2018-12-30 Thread James Coleman
On Sat, Dec 29, 2018 at 9:50 PM David Rowley wrote: > > On Sun, 30 Dec 2018 at 13:00, James Coleman wrote: > > Note that the index scan (or bitmap scan) nodes return all 1500 rows > > matching `bar_fk IN (1,2,3)`. After all rows are returned, that total > > set is ordered, and finally the LIMIT i

Re: pgsql: Use a separate random seed for SQL random()/setseed() functions.

2018-12-30 Thread Fabien COELHO
Hello Tom, I'm sorry I'm a bit late back into this discussion, I was on the road. To fix this reliably, we need random() and setseed() to use their own private random state variable. Ok. Standard random(3) isn't amenable to such usage, so let's switch to pg_erand48(). Hmmm… bad idea? It

Re: Optimize constant MinMax expressions

2018-12-30 Thread Vik Fearing
On 30/12/2018 00:36, Tom Lane wrote: > Vik Fearing writes: >> I was working on a little thing where I needed to simulate BETWEEN >> SYMMETRIC so naturally I used least() and greatest(). I was a little >> surprised to see that my expressions were not folded into straight >> constants and the estim

Re: PostgreSQL vs SQL/XML Standards

2018-12-30 Thread Pavel Stehule
ne 30. 12. 2018 v 3:46 odesílatel Chapman Flack napsal: > On 11/12/18 04:58, Pavel Stehule wrote: > > It is assigned to January commitfest. > > When I build this patch against master (4203842), it builds, but breaks > make check. The diffs seem only incidental (loss of some error context > output