Re: [HACKERS] Floating point comparison inconsistencies of the geometric types

2017-01-18 Thread Kyotaro HORIGUCHI
Hello. (I apologize in advance for possible inaccurate wording on maths, which might cause confusion..) At Wed, 11 Jan 2017 16:37:59 +0100, Emre Hasegeli wrote in > > - Floating point comparisons for gemetric types > > > > Comparison related to geometric types is performed by FPeq > > macr

Re: [HACKERS] pageinspect: Hash index support

2017-01-18 Thread Ashutosh Sharma
Hi, > 1. > +static Page > +verify_hash_page(bytea *raw_page, int flags) > > Few checks for meta page are missing, refer _hash_checkpage. okay, I have added the checks for meta page as well. Please refer to attached patch. > > 2. > + if (!superuser()) > + ereport(ERROR, > + (errcode(ERRCODE_INSUF

Re: [HACKERS] emergency outage requiring database restart

2017-01-18 Thread Ants Aasma
On Wed, Jan 4, 2017 at 5:36 PM, Merlin Moncure wrote: > Still getting checksum failures. Over the last 30 days, I see the > following. Since enabling checksums FWICT none of the damage is > permanent and rolls back with the transaction. So creepy! The checksums still only differ in least sig

Re: [HACKERS] Add pgstathashindex() to get hash index table statistics.

2017-01-18 Thread Kuntal Ghosh
On Fri, Jan 6, 2017 at 6:58 PM, Ashutosh Sharma wrote: I've successfully applied the patch on the latest head and ran a regression tests without any failure. There is no major changes. However, I've some minor comments on the patch: +/* + * HASH_ALLOCATABLE_PAGE_SZ represents allocatable + * spa

Re: [HACKERS] [PATCH] Rename pg_switch_xlog to pg_switch_wal

2017-01-18 Thread Vladimir Rusinov
On Tue, Jan 17, 2017 at 10:03 PM, Robert Haas wrote: > Q: OK, where is my WAL stored? > A: pg_wal > Q: How do I reset it? > A: pg_resetxlog > On the topic of binaries, there's going to be another patch renaming them. Those will have no aliases as it's trivial to work-around (symlinks, shell scri

Re: [HACKERS] postgres_fdw bug in 9.6

2017-01-18 Thread Ashutosh Bapat
On Wed, Jan 18, 2017 at 8:18 AM, Etsuro Fujita wrote: > On 2017/01/16 11:38, Etsuro Fujita wrote: >> >> On 2017/01/14 6:39, Jeff Janes wrote: >>> >>> I do get a compiler warning: >>> >>> foreign.c: In function 'CreateLocalJoinPath': >>> foreign.c:832: warning: implicit declaration of function >>>

Re: [HACKERS] [PATCH] kNN for btree

2017-01-18 Thread Nikita Glukhov
Sorry for the broken formatting in my previous message. Below is a corrected version of this message. I'd like to present a series of patches that implements k-Nearest Neighbors (kNN) search for btree, which can be used to speed up ORDER BY distance queries like this: SELECT * FROM events ORDER

Re: [HACKERS] [PATCH] Rename pg_switch_xlog to pg_switch_wal

2017-01-18 Thread Michael Paquier
On Wed, Jan 18, 2017 at 8:15 PM, Vladimir Rusinov wrote: > On the topic of binaries, there's going to be another patch renaming them. > Those will have no aliases as it's trivial to work-around (symlinks, shell > scripts, etc) and not so trivial to implement in a portable way. On Windows that wou

Re: [HACKERS] [COMMITTERS] pgsql: Generate fmgr prototypes automatically

2017-01-18 Thread Tom Lane
Peter Eisentraut writes: > Generate fmgr prototypes automatically BTW, I notice some suspicious-looking behavior with -j: $ make -j8 -s Writing fmgroids.h Writing fmgroids.h Writing postgres.bki Writing fmgrprotos.h Writing fmgrtab.c Writing schemapg.h Writing postgres.description Writing postgr

Re: [HACKERS] Parallel Index Scans

2017-01-18 Thread Amit Kapila
On Tue, Jan 17, 2017 at 11:27 PM, Robert Haas wrote: > On Mon, Jan 16, 2017 at 7:11 AM, Amit Kapila wrote: > > > WAIT_EVENT_PARALLEL_INDEX_SCAN is in fact btree-specific. There's no > guarantee that any other AMs the implement parallel index scans will > use that wait event, and they might have

Re: [HACKERS] Re: Clarifying "server starting" messaging in pg_ctl start without --wait

2017-01-18 Thread Stephen Frost
Michael, * Michael Paquier (michael.paqu...@gmail.com) wrote: > On Wed, Jan 18, 2017 at 7:31 AM, Stephen Frost wrote: > > Perhaps we need a way for pg_ctl to realize a cold-standby case and > > throw an error or warning if --wait is specified then, but that hardly > > seems like the common use-ca

Re: [HACKERS] Re: Clarifying "server starting" messaging in pg_ctl start without --wait

2017-01-18 Thread Stephen Frost
Michael, * Michael Paquier (michael.paqu...@gmail.com) wrote: > On Wed, Jan 18, 2017 at 10:35 AM, Michael Paquier > wrote: > > On Wed, Jan 18, 2017 at 7:31 AM, Stephen Frost wrote: > >> Perhaps we need a way for pg_ctl to realize a cold-standby case and > >> throw an error or warning if --wait i

Re: [HACKERS] Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)

2017-01-18 Thread Tom Lane
I did a review pass over 0001 and 0002. I think the attached updated version is committable ... except for one thing. The more I look at it, the more disturbed I am by the behavioral change shown in rangefuncs.out --- that's the SRF-in-one-arm-of-CASE issue. (The changes in tsrf.out are fine and

Re: [HACKERS] Parallel Index Scans

2017-01-18 Thread Amit Kapila
On Wed, Jan 18, 2017 at 6:25 AM, Haribabu Kommi wrote: > > > On Mon, Jan 16, 2017 at 11:11 PM, Amit Kapila > wrote: >> > > + * index_beginscan_parallel - join parallel index scan > > The name and the description doesn't sync properly, any better description? > This can be called by both the work

Re: [HACKERS] emergency outage requiring database restart

2017-01-18 Thread Merlin Moncure
On Wed, Jan 18, 2017 at 4:11 AM, Ants Aasma wrote: > On Wed, Jan 4, 2017 at 5:36 PM, Merlin Moncure wrote: >> Still getting checksum failures. Over the last 30 days, I see the >> following. Since enabling checksums FWICT none of the damage is >> permanent and rolls back with the transaction.

Re: [HACKERS] Improving RLS planning

2017-01-18 Thread Tom Lane
Stephen Frost writes: > * Tom Lane (t...@sss.pgh.pa.us) wrote: >> Thanks for the review. Attached is an updated patch that I believe >> addresses all of the review comments so far. The code is unchanged from >> v2, but I improved the README, some comments, and the regression tests. > I've revie

Re: [HACKERS] References to arbitrary database objects that are suitable for pg_dump

2017-01-18 Thread Alvaro Herrera
Jim Nasby wrote: > Is there anything that will translate an object identity (as returned by > pg_event_trigger_ddl_commands) into class/object/subobject OIDs? If I had > that, I could use it to track objects by OID (like pg_depend does), as well > as storing the text representation. That way I can

Re: [HACKERS] [PATCH] Rename pg_switch_xlog to pg_switch_wal

2017-01-18 Thread Vladimir Rusinov
On Wed, Jan 18, 2017 at 12:28 PM, Michael Paquier wrote: > On Wed, Jan 18, 2017 at 8:15 PM, Vladimir Rusinov > wrote: > > On the topic of binaries, there's going to be another patch renaming > them. > > Those will have no aliases as it's trivial to work-around (symlinks, > shell > > scripts, etc

Re: [HACKERS] pageinspect: Hash index support

2017-01-18 Thread Jesper Pedersen
Hi, On 01/18/2017 04:54 AM, Ashutosh Sharma wrote: Is there a reason for keeping the input arguments for hash_bitmap_info() different from hash_page_items()? Yes, there are two reasons behind it. Firstly, we need metapage to identify the bitmap page that holds the information about the overf

Re: [HACKERS] move collation import to backend

2017-01-18 Thread Jeff Janes
On Tue, Jan 17, 2017 at 9:05 AM, Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > On 1/9/17 10:04 PM, Euler Taveira wrote: > > On 18-12-2016 18:30, Peter Eisentraut wrote: > >> Updated patch with that fix. > >> > > Peter, I reviewed and improved your patch. > > > > * I document the ne

Re: [HACKERS] Parallel Index Scans

2017-01-18 Thread Robert Haas
On Wed, Jan 18, 2017 at 8:03 AM, Amit Kapila wrote: > On Tue, Jan 17, 2017 at 11:27 PM, Robert Haas wrote: >> On Mon, Jan 16, 2017 at 7:11 AM, Amit Kapila wrote: >> WAIT_EVENT_PARALLEL_INDEX_SCAN is in fact btree-specific. There's no >> guarantee that any other AMs the implement parallel index

Re: [HACKERS] Patch to implement pg_current_logfile() function

2017-01-18 Thread Karl O. Pinc
On Wed, 18 Jan 2017 13:26:46 +0900 Michael Paquier wrote: > On Wed, Jan 18, 2017 at 11:36 AM, Karl O. Pinc wrote: > > On Wed, 18 Jan 2017 11:08:25 +0900 > > Michael Paquier wrote: > > > >> Our ideas rather map here, ERRCODE_INTERNAL_ERROR would be adapted > >> for this situation. Do any of yo

Re: [HACKERS] move collation import to backend

2017-01-18 Thread Tom Lane
Jeff Janes writes: > With this commit, I'm getting 'make check' fail at initdb with the error: > 2017-01-18 07:47:50.565 PST [43691] FATAL: collation "aa_ER@saaho" for > encoding "UTF8" already exists Yeah, so are large chunks of the buildfarm. Having now read the patch, I see that the problem

Re: [HACKERS] PSQL commands: \quit_if, \quit_unless

2017-01-18 Thread Corey Huinker
On Wed, Jan 18, 2017 at 12:08 AM, Michael Paquier wrote: > On Wed, Jan 18, 2017 at 3:24 AM, Robert Haas > wrote: > > On Sat, Jan 14, 2017 at 12:22 AM, Tom Lane wrote: > >> > >> $ cat loop.sql > >> \if :x < 1000 > >> \echo :x > >> \set x :x + 1 > >> \include loop.sql > >> \fi > >> $ psql -

Re: [HACKERS] Patch to implement pg_current_logfile() function

2017-01-18 Thread Karl O. Pinc
On Wed, 18 Jan 2017 10:11:20 -0600 "Karl O. Pinc" wrote: > You must write > errcode(ERRCODE_INTERNAL_ERROR) > instead of just > ERRCODE_INTERNAL_ERROR > > If you don't you get back 01000 for the error code. > v26 patch attached which fixes this. Attached are revised versions of the 2 (opti

Re: [HACKERS] Logical replication existing data copy

2017-01-18 Thread Erik Rijkers
On 2017-01-18 14:46, Petr Jelinek wrote: 0001-Logical-replication-support-for-initial-data-copy-v2.patch Applies and builds fine on top of the previous 5 patches. Two problems: 1. alter_subscription.sgml has an unpaired -tag, which breaks the doc-build: This is the offending patch-line: +

Re: [HACKERS] Patch to implement pg_current_logfile() function

2017-01-18 Thread Karl O. Pinc
Hi Micheal, On Wed, 18 Jan 2017 10:26:43 -0600 "Karl O. Pinc" wrote: > > v26 patch attached which fixes this. I was glancing over the changes to the documentation you made between the v22 and v25 and from looking at the diffs it seems the format of the current_logfiles file content is no lon

[HACKERS] Function transform optimizations versus reality

2017-01-18 Thread Tom Lane
I looked into bug #14504, https://www.postgresql.org/message-id/20170118144828.1432.52...@wrigleys.postgresql.org The problem is that timestamp_zone_transform() has the cute idea that it can simplify timezone('UTC', timestamptzvalue) into a RelabelType that claims the timestamptzvalue is just type

Re: [HACKERS] increasing the default WAL segment size

2017-01-18 Thread Robert Haas
On Tue, Jan 17, 2017 at 8:54 PM, Michael Paquier wrote: > I think that we could get a committer look at that at the least. This is sort of awkward, because it would be nice to reuse the code for the existing SHOW command rather than reinventing the wheel, but it's not very easy to do that, primar

Re: [HACKERS] Function transform optimizations versus reality

2017-01-18 Thread Robert Haas
On Wed, Jan 18, 2017 at 12:10 PM, Tom Lane wrote: > More generally, this is the second serious bug we've found in the last > month in the "transform" optimizations (see also bug #14479 and commit > f0774abde). I'm starting to get the feeling that that idea was an > attractive nuisance --- at the

Re: [HACKERS] Patch to implement pg_current_logfile() function

2017-01-18 Thread Karl O. Pinc
On Wed, 18 Jan 2017 11:08:23 -0600 "Karl O. Pinc" wrote: > Hi Micheal, > > On Wed, 18 Jan 2017 10:26:43 -0600 > "Karl O. Pinc" wrote: > > > > v26 patch attached which fixes this. > > I was glancing over the changes to the documentation > you made between the v22 and v25 If it were me I'd

Re: [HACKERS] PoC: Grouped base relation

2017-01-18 Thread Robert Haas
On Tue, Jan 17, 2017 at 11:33 PM, Ashutosh Bapat wrote: > I don't think aggcombinefn isn't there because we couldn't write it > for array_agg() or string_agg(). I guess, it won't be efficient to > have those aggregates combined across parallel workers. I think there are many cases where it would

Re: [HACKERS] Parallel bitmap heap scan

2017-01-18 Thread Robert Haas
On Wed, Jan 18, 2017 at 12:14 AM, Dilip Kumar wrote: > On Fri, Jan 13, 2017 at 6:36 PM, Dilip Kumar wrote: >> >> Please verify with the new patch. > > Patch 0001 and 0003 required to rebase on the latest head. 0002 is > still the same. I've committed the first half of 0001. -- Robert Haas Ente

Re: [HACKERS] Parallel Index Scans

2017-01-18 Thread Robert Haas
On Mon, Jan 16, 2017 at 7:11 AM, Amit Kapila wrote: > Fixed. With respect to the second patch (parallel_index_opt_exec_support_v4.patch), I'm hoping it can use the new function from Dilip's bitmap heap scan patch set. See commit 716c7d4b242f0a64ad8ac4dc48c6fed6557ba12c. -- Robert Haas Enterpri

Re: [HACKERS] Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)

2017-01-18 Thread Andres Freund
Hi, On 2017-01-18 08:43:24 -0500, Tom Lane wrote: > I did a review pass over 0001 and 0002. I think the attached updated > version is committable Cool. > ... except for one thing. The more I look at it, > the more disturbed I am by the behavioral change shown in rangefuncs.out > --- that's the

Re: [HACKERS] Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)

2017-01-18 Thread Tom Lane
Andres Freund writes: > On 2017-01-18 08:43:24 -0500, Tom Lane wrote: >> ... except for one thing. The more I look at it, >> the more disturbed I am by the behavioral change shown in rangefuncs.out >> --- that's the SRF-in-one-arm-of-CASE issue. > I'm fine with leaving it as is in the patch, but

Re: [HACKERS] Declarative partitioning vs. information_schema

2017-01-18 Thread Robert Haas
On Tue, Jan 10, 2017 at 4:17 AM, Amit Langote wrote: > On 2017/01/10 14:44, Keith Fiske wrote: >> Is there any reason for the exclusion of parent tables from the pg_tables >> system catalog view? They do not show up in information_schema.tables as >> well. I believe I found where to make the chang

Re: [HACKERS] Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)

2017-01-18 Thread Andres Freund
Hi, On 2017-01-18 14:24:12 -0500, Tom Lane wrote: > Andres Freund writes: > > On 2017-01-18 08:43:24 -0500, Tom Lane wrote: > >> ... except for one thing. The more I look at it, > >> the more disturbed I am by the behavioral change shown in rangefuncs.out > >> --- that's the SRF-in-one-arm-of-CA

Re: [HACKERS] Logical replication existing data copy

2017-01-18 Thread Petr Jelinek
On 18/01/17 17:35, Erik Rijkers wrote: > On 2017-01-18 14:46, Petr Jelinek wrote: > >> 0001-Logical-replication-support-for-initial-data-copy-v2.patch > > Applies and builds fine on top of the previous 5 patches. > > Two problems: > > 1. alter_subscription.sgml has an unpaired -tag, which brea

Re: [HACKERS] Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)

2017-01-18 Thread Tom Lane
Andres Freund writes: > On 2017-01-18 14:24:12 -0500, Tom Lane wrote: >> So I think we can push this patch now and get on with the downstream >> patches. Do you want to do the honors, or shall I? > Whatever you prefer - either way, I'll go on to rebasing the cleanup > patch afterwards (whose exi

Re: [HACKERS] Re: Clarifying "server starting" messaging in pg_ctl start without --wait

2017-01-18 Thread Peter Eisentraut
On 1/18/17 8:25 AM, Stephen Frost wrote: > I was actually thinking about it the other way- start out by changing > them to both be 5m and then document next to checkpoint_timeout (and > max_wal_size, perhaps...) that if you go changing those parameters (eg: > bumping up checkpoint_timeout to 30 min

[HACKERS] [PATCH] fix typo in commit a4523c5

2017-01-18 Thread Nikita Glukhov
Attached patch fixes typo in regression test src/test/regress/sql/create_index.sql that was introduced in commit a4523c5 ("Improve planning of btree index scans using ScalarArrayOpExpr quals."). In this commit the following lines were added to create_index.sql: SET enable_indexonlyscan = OFF; .

Re: [HACKERS] Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)

2017-01-18 Thread Andres Freund
Hi, On January 18, 2017 12:00:12 PM PST, Tom Lane wrote: >Andres Freund writes: >> On 2017-01-18 14:24:12 -0500, Tom Lane wrote: >>> So I think we can push this patch now and get on with the downstream >>> patches. Do you want to do the honors, or shall I? > >> Whatever you prefer - either way,

Re: [HACKERS] Declarative partitioning - another take

2017-01-18 Thread Robert Haas
On Tue, Jan 10, 2017 at 6:06 AM, Amit Langote wrote: > [ updated patches ] I committed 0004 and also fixed the related regression test not to rely on DROP .. CASCADE, which isn't always stable. The remainder of this patch set needs a rebase, and perhaps you could also fold in other pending parti

Re: [HACKERS] Re: Clarifying "server starting" messaging in pg_ctl start without --wait

2017-01-18 Thread Stephen Frost
* Peter Eisentraut (peter.eisentr...@2ndquadrant.com) wrote: > On 1/18/17 8:25 AM, Stephen Frost wrote: > > I was actually thinking about it the other way- start out by changing > > them to both be 5m and then document next to checkpoint_timeout (and > > max_wal_size, perhaps...) that if you go cha

Re: [HACKERS] Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)

2017-01-18 Thread Tom Lane
Andres Freund writes: > Yea, have something lying around. Let me push it then when I get back from > lunch? Sure, no sweat. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgr

Re: [HACKERS] Declarative partitioning vs. BulkInsertState

2017-01-18 Thread Robert Haas
On Wed, Jan 11, 2017 at 10:53 PM, Amit Langote wrote: > On 2017/01/06 20:23, Amit Langote wrote: >> On 2017/01/05 3:26, Robert Haas wrote: >>> It's unclear to me why we need to do 0002. It doesn't seem like it >>> should be necessary, it doesn't seem like a good idea, and the commit >>> message y

Re: [HACKERS] Declarative partitioning - another take

2017-01-18 Thread Robert Haas
On Wed, Jan 18, 2017 at 3:12 PM, Robert Haas wrote: > On Tue, Jan 10, 2017 at 6:06 AM, Amit Langote > wrote: >> [ updated patches ] > > I committed 0004 and also fixed the related regression test not to > rely on DROP .. CASCADE, which isn't always stable. The remainder of > this patch set needs

Re: [HACKERS] Re: Clarifying "server starting" messaging in pg_ctl start without --wait

2017-01-18 Thread Robert Haas
On Tue, Jan 17, 2017 at 5:31 PM, Stephen Frost wrote: > If I'm understanding your concern correctly, you're worried about the > case of a cold standby where the database is only replaying WAL but not > configured to come up as a hot standby and therefore PQping() won't ever > succeed? I think we'

Re: [HACKERS] jsonb_delete with arrays

2017-01-18 Thread Magnus Hagander
On Wed, Jan 18, 2017 at 5:49 AM, Michael Paquier wrote: > On Tue, Jan 17, 2017 at 8:45 PM, Magnus Hagander > wrote: > > On Tue, Jan 17, 2017 at 8:25 AM, Michael Paquier < > michael.paqu...@gmail.com> > > wrote: > >> On Sun, Dec 18, 2016 at 1:27 AM, Dmitry Dolgov <9erthali...@gmail.com> > >> wrot

Re: [HACKERS] postgres_fdw bug in 9.6

2017-01-18 Thread Robert Haas
On Fri, Jan 13, 2017 at 6:22 AM, Etsuro Fujita wrote: > My biggest concern about GetExistingLocalJoinPath is that might not be > extendable to the case of foreign-join paths with parameterization; in which > case, fdw_outerpath for a given foreign-join path would need to have the > same parameteri

Re: [HACKERS] Re: Clarifying "server starting" messaging in pg_ctl start without --wait

2017-01-18 Thread Stephen Frost
Robert, * Robert Haas (robertmh...@gmail.com) wrote: > On Tue, Jan 17, 2017 at 5:31 PM, Stephen Frost wrote: > > If I'm understanding your concern correctly, you're worried about the > > case of a cold standby where the database is only replaying WAL but not > > configured to come up as a hot sta

Re: [HACKERS] Re: Clarifying "server starting" messaging in pg_ctl start without --wait

2017-01-18 Thread Robert Haas
On Wed, Jan 18, 2017 at 3:43 PM, Stephen Frost wrote: > * Robert Haas (robertmh...@gmail.com) wrote: >> On Tue, Jan 17, 2017 at 5:31 PM, Stephen Frost wrote: >> > If I'm understanding your concern correctly, you're worried about the >> > case of a cold standby where the database is only replaying

Re: [HACKERS] Patch to implement pg_current_logfile() function

2017-01-18 Thread Robert Haas
On Wed, Jan 18, 2017 at 12:56 PM, Karl O. Pinc wrote: > If it were me I'd have the documentation mention > that the pg_current_logfiles() result is > supplied on a "best effort" basis and under > rare conditions may be outdated. The > sentence in the pg_current_logfles() docs > which reads "pg_c

Re: [HACKERS] Patch to implement pg_current_logfile() function

2017-01-18 Thread Robert Haas
On Wed, Jan 18, 2017 at 12:08 PM, Karl O. Pinc wrote: > Seems to me that the file format should > be documented if there's any intention that the end user > look at or otherwise use the file's content. > > It's fine with me if the content of current_logfiles > is supposed to be internal to PG and

Re: [HACKERS] Re: Clarifying "server starting" messaging in pg_ctl start without --wait

2017-01-18 Thread Stephen Frost
Robert, * Robert Haas (robertmh...@gmail.com) wrote: > On Wed, Jan 18, 2017 at 3:43 PM, Stephen Frost wrote: > > * Robert Haas (robertmh...@gmail.com) wrote: > >> I think we've changed the defaults to make things better for an > >> attended startup and worse for an unattended startup. But I thin

Re: [HACKERS] Patch to implement pg_current_logfile() function

2017-01-18 Thread Karl O. Pinc
On Wed, 18 Jan 2017 15:52:36 -0500 Robert Haas wrote: > On Wed, Jan 18, 2017 at 12:08 PM, Karl O. Pinc wrote: > > Seems to me that the file format should > > be documented if there's any intention that the end user > > look at or otherwise use the file's content. > > > > It's fine with me if the

Re: [HACKERS] Re: Clarifying "server starting" messaging in pg_ctl start without --wait

2017-01-18 Thread Robert Haas
On Wed, Jan 18, 2017 at 3:59 PM, Stephen Frost wrote: > For non-cold standby configurations, pg_ctl is going to return just as > soon as the database has finished crash recovery, which in most cases > will probably be on the order of a few seconds. /me is poleaxed. -- Robert Haas EnterpriseDB:

Re: [HACKERS] Re: Clarifying "server starting" messaging in pg_ctl start without --wait

2017-01-18 Thread Stephen Frost
On Wed, Jan 18, 2017 at 16:15 Robert Haas wrote: > On Wed, Jan 18, 2017 at 3:59 PM, Stephen Frost wrote: > > > For non-cold standby configurations, pg_ctl is going to return just as > > > soon as the database has finished crash recovery, which in most cases > > > will probably be on the order of

Re: [HACKERS] [PATCH] fix typo in commit a4523c5

2017-01-18 Thread Tom Lane
Nikita Glukhov writes: > Obviously, the last line should be > RESET enable_indexonlyscan; Yeah, I think you're right. Pushed, thanks! regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://w

Re: [HACKERS] Typo in hashsearch.c

2017-01-18 Thread Robert Haas
On Fri, Jan 13, 2017 at 4:38 AM, Mithun Cy wrote: > There is a typo in comments of function _hash_first(); Adding a fix for same. Thanks. I pushed a commit including this fix and some other improvements to that comment. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise Po

Re: [HACKERS] Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)

2017-01-18 Thread Andres Freund
Hi, On 2017-01-18 15:24:32 -0500, Tom Lane wrote: > Andres Freund writes: > > Yea, have something lying around. Let me push it then when I get back from > > lunch? > > Sure, no sweat. Pushed. Yay! There's one sgml comment you'd added: "Furthermore, nested set-returning functions did not wor

Re: [HACKERS] Patch to implement pg_current_logfile() function

2017-01-18 Thread Karl O. Pinc
On Wed, 18 Jan 2017 15:08:09 -0600 "Karl O. Pinc" wrote: > I would like to see index entries for "current_logfiles" > so this stuff is findable. Attached is a v27 of the patch. I polished some of the sentences in the documentation and added index entries. Also attached are a series of 2 patche

Re: [HACKERS] Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)

2017-01-18 Thread Tom Lane
Andres Freund writes: > There's one sgml comment you'd added: > "Furthermore, nested set-returning functions did not work at all." > I'm not quite sure what you're referring to there - it was previously > allowed to have one set argument to an SRF: Ooops ... that was composed too hastily, evident

Re: [HACKERS] Performance improvement for joins where outer side is unique

2017-01-18 Thread David Rowley
On 3 December 2016 at 10:26, Tom Lane wrote: > Robert Haas writes: >> On Dec 2, 2016, at 7:47 AM, Haribabu Kommi wrote: >>> Patch still applies fine to HEAD. >>> Moved to next CF with "ready for committer" status. > >> Tom, are you picking this up? > > Yeah, I apologize for not having gotten to

Re: [HACKERS] Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)

2017-01-18 Thread Andres Freund
On 2017-01-18 16:56:46 -0500, Tom Lane wrote: > Andres Freund writes: > I have not actually looked at 0003 at all yet. So yeah, please post > for review after you're done rebasing. Here's a rebased and lightly massaged version. I'm vanishing in a meeting for a bit, thought it'd be more useful to

Re: [HACKERS] PoC: Grouped base relation

2017-01-18 Thread David Rowley
On 19 January 2017 at 07:32, Robert Haas wrote: > On Tue, Jan 17, 2017 at 11:33 PM, Ashutosh Bapat > wrote: >> I don't think aggcombinefn isn't there because we couldn't write it >> for array_agg() or string_agg(). I guess, it won't be efficient to >> have those aggregates combined across paralle

[HACKERS] smallint out of range EXECUTEing prepared statement

2017-01-18 Thread Justin Pryzby
Is this expected behavior ? ts=# SELECT * FROM t WHERE site_id=32768 LIMIT 1; (0 rows) ts=# PREPARE x AS SELECT * FROM t WHERE site_id=$1 LIMIT 1; PREPARE ts=# EXECUTE x(32768); ERROR: smallint out of range ts=# PREPARE y AS SELECT * FROM t WHERE site_id::int=$1 LIMIT 1; PREPARE ts=# EXECUTE y(

Re: [HACKERS] smallint out of range EXECUTEing prepared statement

2017-01-18 Thread David G. Johnston
On Wed, Jan 18, 2017 at 3:15 PM, Justin Pryzby wrote: > Is this expected behavior ? ​​ > > ts=# SELECT * FROM t WHERE site_id=32768 LIMIT 1; > (0 rows) > > ts=# PREPARE x AS SELECT * FROM t WHERE site_id=$1 LIMIT 1; > PREPARE > ts=# EXECUTE x(32768); > ERROR: smallint out of range > ​​Probably

Re: [HACKERS] Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)

2017-01-18 Thread Tom Lane
Andres Freund writes: > (I also noticed the previous patch should have had a catversion bump :(, > will do after the meeting). Uh, why? It isn't touching any on-disk data structure. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org

Re: [HACKERS] Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)

2017-01-18 Thread Andres Freund
On 2017-01-18 17:34:56 -0500, Tom Lane wrote: > Andres Freund writes: > > (I also noticed the previous patch should have had a catversion bump :(, > > will do after the meeting). > > Uh, why? It isn't touching any on-disk data structure. Forget what I said - I was rushing to a meeting and not t

Re: [HACKERS] Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)

2017-01-18 Thread Tom Lane
I wrote: > I'll try to write something about the SRF-in-CASE issue too. Seeing > whether we can document that adequately seems like an important part > of making the decision about whether we need to block it. Here's what I came up with: This behavior also means that set-returning functions wi

Re: [HACKERS] Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)

2017-01-18 Thread Andres Freund
On 2017-01-18 18:14:26 -0500, Tom Lane wrote: > I wrote: > > I'll try to write something about the SRF-in-CASE issue too. Seeing > > whether we can document that adequately seems like an important part > > of making the decision about whether we need to block it. > > Here's what I came up with: >

Re: [HACKERS] Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)

2017-01-18 Thread David G. Johnston
On Wed, Jan 18, 2017 at 4:14 PM, Tom Lane wrote: > I wrote: > > I'll try to write something about the SRF-in-CASE issue too. Seeing > > whether we can document that adequately seems like an important part > > of making the decision about whether we need to block it. > > Here's what I came up wit

Re: [HACKERS] Performance improvement for joins where outer side is unique

2017-01-18 Thread David Rowley
On 19 January 2017 at 11:06, David Rowley wrote: > Old patch no longer applies, so I've attached a rebased patch. This > also re-adds a comment line which I mistakenly removed. (meanwhile Andres commits 69f4b9c) I should've waited a bit longer. Here's another that fixes the new conflicts. --

Re: [HACKERS] Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)

2017-01-18 Thread Andres Freund
On 2017-01-18 16:27:53 -0700, David G. Johnston wrote: > ​I'd rather fail now and allow for the possibility of future implementation > of the "it might seem that..." behavior.​ That's very unlikely to happen. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes

Re: [HACKERS] Patch to implement pg_current_logfile() function

2017-01-18 Thread Michael Paquier
On Thu, Jan 19, 2017 at 6:08 AM, Karl O. Pinc wrote: > On Wed, 18 Jan 2017 15:52:36 -0500 > Robert Haas wrote: > >> On Wed, Jan 18, 2017 at 12:08 PM, Karl O. Pinc wrote: >> > Seems to me that the file format should >> > be documented if there's any intention that the end user >> > look at or oth

Re: [HACKERS] Re: Clarifying "server starting" messaging in pg_ctl start without --wait

2017-01-18 Thread Michael Paquier
On Thu, Jan 19, 2017 at 6:20 AM, Stephen Frost wrote: > On Wed, Jan 18, 2017 at 16:15 Robert Haas wrote: >> On Wed, Jan 18, 2017 at 3:59 PM, Stephen Frost wrote: >> > For non-cold standby configurations, pg_ctl is going to return just as >> > soon as the database has finished crash recovery, whi

Re: [HACKERS] Re: Clarifying "server starting" messaging in pg_ctl start without --wait

2017-01-18 Thread Michael Paquier
On Thu, Jan 19, 2017 at 5:01 AM, Peter Eisentraut wrote: > On 1/18/17 8:25 AM, Stephen Frost wrote: >> I was actually thinking about it the other way- start out by changing >> them to both be 5m and then document next to checkpoint_timeout (and >> max_wal_size, perhaps...) that if you go changing

Re: [HACKERS] Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)

2017-01-18 Thread Robert Haas
On Wed, Jan 18, 2017 at 6:19 PM, Andres Freund wrote: >> SELECT x, CASE WHEN x > 0 THEN generate_series(1, 5) ELSE 0 END FROM tab; >> >> It might seem that this should produce five repetitions of input rows >> that have x > 0, and a single repetition of those that do not; but >> actually i

Re: [HACKERS] Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)

2017-01-18 Thread Andres Freund
On January 18, 2017 3:59:00 PM PST, Robert Haas wrote: >On Wed, Jan 18, 2017 at 6:19 PM, Andres Freund >wrote: >>> SELECT x, CASE WHEN x > 0 THEN generate_series(1, 5) ELSE 0 END >FROM tab; >>> >>> It might seem that this should produce five repetitions of input >rows >>> that have x > 0,

Re: [HACKERS] Re: Clarifying "server starting" messaging in pg_ctl start without --wait

2017-01-18 Thread Stephen Frost
* Michael Paquier (michael.paqu...@gmail.com) wrote: > On Thu, Jan 19, 2017 at 6:20 AM, Stephen Frost wrote: > > On Wed, Jan 18, 2017 at 16:15 Robert Haas wrote: > >> On Wed, Jan 18, 2017 at 3:59 PM, Stephen Frost wrote: > >> > For non-cold standby configurations, pg_ctl is going to return just

Re: [HACKERS] Re: Clarifying "server starting" messaging in pg_ctl start without --wait

2017-01-18 Thread Stephen Frost
* Michael Paquier (michael.paqu...@gmail.com) wrote: > On Thu, Jan 19, 2017 at 5:01 AM, Peter Eisentraut > wrote: > > On 1/18/17 8:25 AM, Stephen Frost wrote: > >> I was actually thinking about it the other way- start out by changing > >> them to both be 5m and then document next to checkpoint_tim

Re: [HACKERS] Logical Replication WIP

2017-01-18 Thread Petr Jelinek
On 17/01/17 22:43, Robert Haas wrote: > On Tue, Jan 17, 2017 at 11:15 AM, Petr Jelinek > wrote: >>> Is there anything stopping anyone from implementing it? >> >> No, just didn't seem priority for the functionality right now. > > Why is it OK for this to not support rename like everything else doe

Re: [HACKERS] PoC: Grouped base relation

2017-01-18 Thread Robert Haas
On Wed, Jan 18, 2017 at 5:14 PM, David Rowley wrote: > On 19 January 2017 at 07:32, Robert Haas wrote: >> On Tue, Jan 17, 2017 at 11:33 PM, Ashutosh Bapat >> wrote: >>> I don't think aggcombinefn isn't there because we couldn't write it >>> for array_agg() or string_agg(). I guess, it won't be e

Re: [HACKERS] Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)

2017-01-18 Thread Robert Haas
On Wed, Jan 18, 2017 at 7:00 PM, Andres Freund wrote: >>So, one of the big reasons I use CASE is to avoid evaluating >>expressions in cases where they might throw an ERROR. Like, you know: >> >>CASE WHEN d != 0 THEN n / d ELSE NULL END >> >>I guess it's not the end of the world if that only works

Re: [HACKERS] Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)

2017-01-18 Thread Tom Lane
Robert Haas writes: > So, one of the big reasons I use CASE is to avoid evaluating > expressions in cases where they might throw an ERROR. Like, you know: > CASE WHEN d != 0 THEN n / d ELSE NULL END > I guess it's not the end of the world if that only works for > non-set-returning functions, but

Re: [HACKERS] [PATCH] ALTER DEFAULT PRIVILEGES with GRANT/REVOKE ON SCHEMAS

2017-01-18 Thread Petr Jelinek
On 10/01/17 17:33, Matheus de Oliveira wrote: > > On Mon, Jan 9, 2017 at 10:58 AM, Ashutosh Sharma > wrote: > > > Also, should I add translations for that error message in other > languages (I > > can do that without help of tools for pt_BR) or is that a la

Re: [HACKERS] [PATCH] ALTER DEFAULT PRIVILEGES with GRANT/REVOKE ON SCHEMAS

2017-01-18 Thread Stephen Frost
* Petr Jelinek (petr.jeli...@2ndquadrant.com) wrote: > On 10/01/17 17:33, Matheus de Oliveira wrote: > > > > On Mon, Jan 9, 2017 at 10:58 AM, Ashutosh Sharma > > wrote: > > > > > Also, should I add translations for that error message in other > > languages (I >

Re: [HACKERS] Re: Clarifying "server starting" messaging in pg_ctl start without --wait

2017-01-18 Thread Ryan Murphy
> > > Ryan try to run 'make install-world' then 'make -i installcheck-world', -i > option will ignore the error and proceed. You can check if any other tests > fails. This is a separate issue, unrelated to this patch. I do not think > we should stop from changing the status because of this. > > Bee

Re: [HACKERS] Re: Clarifying "server starting" messaging in pg_ctl start without --wait

2017-01-18 Thread Ryan Murphy
> > Jim Nasby said I shouldn't necessarily need to build the docs / the whole > world in order to review patches. But the Review form needs a `make > installworld-check`. Do I need to install the whole world in order to meet > this requirement? Happy to do so if required, but in that case, I won

Re: [HACKERS] smallint out of range EXECUTEing prepared statement

2017-01-18 Thread Andrew Gierth
> "Justin" == Justin Pryzby writes: Justin> Is this expected behavior ? Justin> ts=# SELECT * FROM t WHERE site_id=32768 LIMIT 1; Justin> (0 rows) Justin> ts=# PREPARE x AS SELECT * FROM t WHERE site_id=$1 LIMIT 1; Justin> PREPARE Justin> ts=# EXECUTE x(32768); Justin> ERROR: smalli

Re: [HACKERS] Re: Clarifying "server starting" messaging in pg_ctl start without --wait

2017-01-18 Thread Tom Lane
Ryan Murphy writes: > So I ran "make -i installcheck-world" and it ran to completion. This is on > a freshly "git pull"ed postgres source tree. Certain tests failed, but > most succeeded. Those results look pretty broken :-( > There was no "overall" indication of success or failure at > the ve

Re: [HACKERS] macaddr 64 bit (EUI-64) datatype support

2017-01-18 Thread Haribabu Kommi
On Sat, Jan 14, 2017 at 6:28 PM, Kuntal Ghosh wrote: > On Mon, Jan 9, 2017 at 1:45 PM, Haribabu Kommi > wrote: > > Updated patch is attached. > > > I've a few comments about the patch. > Thanks for the review. + This type can accept both 6 and 8 bytes length MAC addresses. > A 6 bytes leng

Re: [HACKERS] Patch to implement pg_current_logfile() function

2017-01-18 Thread Michael Paquier
On Thu, Jan 19, 2017 at 6:56 AM, Karl O. Pinc wrote: > On Wed, 18 Jan 2017 15:08:09 -0600 > "Karl O. Pinc" wrote: > >> I would like to see index entries for "current_logfiles" >> so this stuff is findable. > > Attached is a v27 of the patch. > > I polished some of the sentences in the documentati

Re: [HACKERS] Re: Clarifying "server starting" messaging in pg_ctl start without --wait

2017-01-18 Thread Ryan Murphy
> The on-screen output isn't all that helpful for diagnosing what went > wrong. You might learn more by looking at the regression.diffs files. > Remember that errors tend to cascade, so the first one(s) in any > particular test suite are the most important --- the rest might just > be fallout. > >

Re: [HACKERS] PoC: Grouped base relation

2017-01-18 Thread Ashutosh Bapat
On Thu, Jan 19, 2017 at 12:02 AM, Robert Haas wrote: > On Tue, Jan 17, 2017 at 11:33 PM, Ashutosh Bapat > wrote: >> I don't think aggcombinefn isn't there because we couldn't write it >> for array_agg() or string_agg(). I guess, it won't be efficient to >> have those aggregates combined across pa

Re: [HACKERS] Parallel Index Scans

2017-01-18 Thread Haribabu Kommi
On Wed, Jan 18, 2017 at 6:55 PM, Rahila Syed wrote: > >+ /* Check if the scan for current scan keys is finished */ > >+ if (so->arrayKeyCount < btscan->btps_arrayKeyCount) > >+ *status = false; > > >I didn't clearly understand, in which scenario the arrayKeyCount is less > >than btps_arrayKeyCoun

Re: [HACKERS] postgres_fdw bug in 9.6

2017-01-18 Thread Ashutosh Bapat
On Thu, Jan 19, 2017 at 2:14 AM, Robert Haas wrote: > On Fri, Jan 13, 2017 at 6:22 AM, Etsuro Fujita > wrote: >> My biggest concern about GetExistingLocalJoinPath is that might not be >> extendable to the case of foreign-join paths with parameterization; in which >> case, fdw_outerpath for a give

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-18 Thread Michael Paquier
On Wed, Jan 18, 2017 at 4:11 PM, Haribabu Kommi wrote: > updated patch attached. Thanks for the new version. > Added tap tests patch also attached. This begins to look really nice. I am having fun torturing it :) Here are I think my last comments: + linecxt = tokenize_file(HbaFileName, file

  1   2   >