Re: Oddity in tuple routing for foreign partitions

2018-05-01 Thread Etsuro Fujita
(2018/05/02 10:10), Amit Langote wrote: On 2018/05/02 6:09, Andres Freund wrote: On 2018-05-01 13:41:32 -0400, Robert Haas wrote: Committed. Thank you. Thanks for committing, Robert! There's still an open items entry for this thread - has that been resolved by this commit Afaik, yes. S

Re: Remove mention in docs that foreign keys on partitioned tables are not supported

2018-05-01 Thread Amit Langote
On 2018/05/02 14:17, Ashutosh Bapat wrote: > On Tue, May 1, 2018 at 5:20 PM, Peter Eisentraut > wrote: >> On 4/26/18 05:03, Amit Langote wrote: >>> On 2018/04/26 13:01, David Rowley wrote: The attached small patch removes the mention that partitioned tables cannot have foreign keys defin

Re: [SPAM] Re: Local partitioned indexes and pageinspect

2018-05-01 Thread Michael Paquier
On Wed, May 02, 2018 at 01:38:22PM +0900, Amit Langote wrote: > Perhaps, I'm just repeating what's already been said, but I think it might > be better to have the word "partitioned" in the message. That's what Peter is pointing to upthread and what the v1 of upthread was doing. I would tend to th

Re: A few warnings on Windows

2018-05-01 Thread Thomas Munro
On Wed, May 2, 2018 at 4:28 PM, Tom Lane wrote: > Thomas Munro writes: >> That compiles and runs the main checks (except tablespace which I >> suppress) cleanly for me and I assume it really is using >> stdbool.h this time. Hopefully plperl will be happier this way. > > Pushed. I was slightly t

Re: Remove mention in docs that foreign keys on partitioned tables are not supported

2018-05-01 Thread Ashutosh Bapat
On Tue, May 1, 2018 at 5:20 PM, Peter Eisentraut wrote: > On 4/26/18 05:03, Amit Langote wrote: >> On 2018/04/26 13:01, David Rowley wrote: >>> The attached small patch removes the mention that partitioned tables >>> cannot have foreign keys defined on them. >>> >>> This has been supported since 3

Re: Local partitioned indexes and pageinspect

2018-05-01 Thread Amit Langote
On 2018/05/02 13:38, Amit Langote wrote: > --- a/contrib/amcheck/expected/check_btree.out > +++ b/contrib/amcheck/expected/check_btree.out > > +-- verify partitioned tables are rejected (error) > +SELECT bt_index_check('bttest_partitioned'); > +ERROR: "bttest_partitioned" is not an index > > Per

Re: [SPAM] Re: Local partitioned indexes and pageinspect

2018-05-01 Thread Amit Langote
Hi. On 2018/05/02 11:05, Michael Paquier wrote: > On Tue, May 01, 2018 at 12:30:44PM -0400, Robert Haas wrote: >> However, backing up a minute, I don't think "relation \"%s\" is not a >> btree index" is such a terrible message. These modules are intended >> to be intended by people who Know What

Re: Is a modern build system acceptable for older platforms

2018-05-01 Thread Andres Freund
On May 1, 2018 9:26:27 PM PDT, Yuriy Zhuravlev wrote: >After small check I found next: >we need gcc 4.8 anyway for libjit and it means RHEL 7 and newer: >https://access.redhat.com/solutions/19458 >because 4.8 needed to build LLVM. We don't use libjit. As for the llvm stuff - that's an optional

Re: A few warnings on Windows

2018-05-01 Thread Tom Lane
Thomas Munro writes: > On Wed, May 2, 2018 at 12:51 PM, Thomas Munro > wrote: >> Perhaps that's what Peter E meant when he said "Windows could use some >> manual adjustments in pg_config.h.win32 if anyone >> cares"[1]. Should we just change this to 1? I'm going to go and test >> that now. From

Re: Is a modern build system acceptable for older platforms

2018-05-01 Thread Yuriy Zhuravlev
After small check I found next: we need gcc 4.8 anyway for libjit and it means RHEL 7 and newer: https://access.redhat.com/solutions/19458 because 4.8 needed to build LLVM.

Re: Is a modern build system acceptable for older platforms

2018-05-01 Thread Yuriy Zhuravlev
> > No tons of hacks. > And functions too https://bitbucket.org/adunstan/pg-closed-ranges/raw/0475b50ff793ce876a78c96d72903c9793a98fc1/cmake/FindPostgreSQL.cmake I mean things like HAVE_LONG_LONG_INT you can't figure out on "configure" stage without parsing config.h in CMake. Also, maybe I am wron

Re: A few warnings on Windows

2018-05-01 Thread Tom Lane
Andres Freund writes: > On 2018-05-01 22:55:47 -0400, Peter Eisentraut wrote: >> On 5/1/18 16:48, Tom Lane wrote: >>> ... Perhaps at some point we should have configure turn that >>> warning on if available? >> I think it's useful, but I have found it a bit fickle at times. Yeah, I noticed sever

Re: pgsql: Clean up warnings from -Wimplicit-fallthrough.

2018-05-01 Thread Tom Lane
Andres Freund writes: > On 2018-05-01 23:35:18 +, Tom Lane wrote: >> Clean up warnings from -Wimplicit-fallthrough. > I found one more oddity with the current committed state: ... > It seems that gcc gets confused by the #ifdef ECONNRESET. Yeah, there's a gcc bug or three about that: https:

Re: A few warnings on Windows

2018-05-01 Thread Andres Freund
On 2018-05-01 22:55:47 -0400, Peter Eisentraut wrote: > On 5/1/18 16:48, Tom Lane wrote: > > On more or less the same topic, I just scraped all the compiler warnings > > for HEAD from the buildfarm database, and there seem to be a few other > > things worth cleaning up. One that I'm looking at is

Re: Global snapshots

2018-05-01 Thread Peter Eisentraut
On 5/1/18 12:27, Stas Kelvich wrote: > Clock-SI is described in [5] and here I provide a small overview, which > supposedly should be enough to catch the idea. Assume that each node runs > Commit > Sequence Number (CSN) based visibility: database tracks one counter for each > transaction start (xi

Re: A few warnings on Windows

2018-05-01 Thread Peter Eisentraut
On 5/1/18 16:48, Tom Lane wrote: > On more or less the same topic, I just scraped all the compiler warnings > for HEAD from the buildfarm database, and there seem to be a few other > things worth cleaning up. One that I'm looking at is that recent gcc > has a -Wimplicit-fallthrough warning for swi

Re: pgsql: Clean up warnings from -Wimplicit-fallthrough.

2018-05-01 Thread Andres Freund
On 2018-05-01 17:32:39 -0700, Andres Freund wrote: > Hi, > > On 2018-05-01 23:35:18 +, Tom Lane wrote: > > Clean up warnings from -Wimplicit-fallthrough. > > > > Recent gcc can warn about switch-case fall throughs that are not > > explicitly labeled as intentional. This seems like a good thi

doc fixes: vacuum_cleanup_index_scale_factor

2018-05-01 Thread Justin Pryzby
Introduced 857f9c36cda520030381bd8c2af20adf0ce0e1d4 The "minimal version" should probably be "minimum version", but I didn't include it here. Also, the documentation doesn't indicate the default value of -1 (or its special meaning). Also, my understanding of this feature changed when I read this

Re: Local partitioned indexes and pageinspect

2018-05-01 Thread Michael Paquier
On Tue, May 01, 2018 at 12:30:44PM -0400, Robert Haas wrote: > That's probably going to cause some translation problems. The form of > "a" that you need will vary: "a" vs. "an" in English, "un" vs. "una" > in Spanish, etc. And it wouldn't be surprising if there are problems > in some languages ev

Re: stats_ext test fails with -DCATCACHE_FORCE_RELEASE

2018-05-01 Thread Amit Langote
On 2018/05/02 0:33, Tom Lane wrote: > Amit Langote writes: >> While playing around with a -DCATCACHE_FORCE_RELEASE build, I noticed that >> stats_ext test failed with errors for multiple statements that looked like >> this: >> ERROR: invalid ndistinct magic 7f7f7f7f (expected a352bfa4) > > Inter

Re: Is a modern build system acceptable for older platforms

2018-05-01 Thread Andrew Dunstan
On Tue, May 1, 2018 at 8:20 PM, Yuriy Zhuravlev wrote: >> Indeed. It's possibly today to use CMake without a huge amount of > difficulty to build extensions out of tree against MSVC-built > postgres. > > > How? All builds what I saw was with tons of hacks. There is a simple example here:

Re: A few warnings on Windows

2018-05-01 Thread Thomas Munro
On Wed, May 2, 2018 at 12:51 PM, Thomas Munro wrote: > On Wed, May 2, 2018 at 11:39 AM, Tom Lane wrote: >> We'll soon find out. > > Nope -- and I think that's because we only actually use stdbool.h > instead of our own macros if we think sizeof(bool) is exactly 1. But > we don't because pg_confi

Re: Remove mention in docs that foreign keys on partitioned tables are not supported

2018-05-01 Thread Amit Langote
On 2018/05/01 20:50, Peter Eisentraut wrote: > On 4/26/18 05:03, Amit Langote wrote: >> On 2018/04/26 13:01, David Rowley wrote: >>> The attached small patch removes the mention that partitioned tables >>> cannot have foreign keys defined on them. >>> >>> This has been supported since 3de241db >> >

Re: Oddity in tuple routing for foreign partitions

2018-05-01 Thread Amit Langote
On 2018/05/02 6:09, Andres Freund wrote: > On 2018-05-01 13:41:32 -0400, Robert Haas wrote: >> On Thu, Apr 26, 2018 at 9:23 PM, Amit Langote >> wrote: > Thanks for reviewing! I'm happy if it helps you. >>> >>> Thank you both for reviewing. >> >> Committed. Thank you. > There's stil

Re: A few warnings on Windows

2018-05-01 Thread Thomas Munro
On Wed, May 2, 2018 at 11:39 AM, Tom Lane wrote: > Thomas Munro writes: >> Here's a patch that builds warning-free for me. Result: >> https://ci.appveyor.com/project/macdice/postgres/build/1.0.139 > > LGTM, pushed. Thanks. The first two warnings I mentioned are fixed. >> Unfortunately my scri

Re: pgsql: Clean up warnings from -Wimplicit-fallthrough.

2018-05-01 Thread Andres Freund
Hi, On 2018-05-01 23:35:18 +, Tom Lane wrote: > Clean up warnings from -Wimplicit-fallthrough. > > Recent gcc can warn about switch-case fall throughs that are not > explicitly labeled as intentional. This seems like a good thing, > so clean up the warnings exposed thereby by labeling all su

Re: Is a modern build system acceptable for older platforms

2018-05-01 Thread Yuriy Zhuravlev
> Indeed. It's possibly today to use CMake without a huge amount of difficulty to build extensions out of tree against MSVC-built postgres. How? All builds what I saw was with tons of hacks. On windows, Postgres can build against Mingw, many versions of MSVC and etc Also, you can build Postgres w

Re: lazy detoasting

2018-05-01 Thread Andrew Gierth
> "Andrew" == Andrew Gierth writes: Andrew> ERROR: no known snapshots Andrew> CONTEXT: PL/pgSQL function inline_code_block line 1 at RAISE Andrew> This is another issue that was mentioned before in relation to Andrew> procedures. See https://www.postgresql.org/message-id/29608.151853

Re: Is a modern build system acceptable for older platforms

2018-05-01 Thread Yuriy Zhuravlev
> > That indeed would be an improvement, but maybe we could fix that specific > pain point without having to throw away twenty years worth of work? Indeed! Only a few thousands of lines of code can generate the whole you manually wrote, it's the perfect result! re-invention of portability hacks

Re: Is a modern build system acceptable for older platforms

2018-05-01 Thread Yuriy Zhuravlev
Hello Geoff! About cmake: 1. You can still use the binary build for your system. 2. You can still build Postgres from source and with old gcc, you need only install cmake (it's very easy) Only most modern versions of CMake depend on modern gcc. I have good experience with old Solaris and AIX. (I m

Re: lazy detoasting

2018-05-01 Thread Andrew Gierth
> "Peter" == Peter Eisentraut writes: Peter> Is there a more self-contained way to test this? I have been Peter> trying with something like Peter> create table test1 (a int, b text); Peter> insert into test1 values (1, repeat('foo', 2000)); That value is no good because it's too compre

Re: A few warnings on Windows

2018-05-01 Thread Tom Lane
Thomas Munro writes: > Here's a patch that builds warning-free for me. Result: > https://ci.appveyor.com/project/macdice/postgres/build/1.0.139 LGTM, pushed. > Unfortunately my scripting for that doesn't actually build the plperl > stuff yet (need to cannibalise more buildfarm scripts...) so I

Re: Should we add GUCs to allow partition pruning to be disabled?

2018-05-01 Thread David Rowley
Hi Amit, Thanks for looking at the patch. On 1 May 2018 at 21:44, Amit Langote wrote: > About the patch in general, it seems like the newly added documentation > talks about "Partition Pruning" as something that *replaces* constraint > exclusion. But, I think "Partition Pruning" is not the thin

Re: [HACKERS] Clock with Adaptive Replacement

2018-05-01 Thread Peter Geoghegan
On Tue, May 1, 2018 at 11:58 AM, Robert Haas wrote: > That's not to say that the total of all usage counts must remain equal > to a constant or something dumb like that -- there's decisions to be > made in terms of how you implement things. For example, you can > imagine a system where every time

Re: A few warnings on Windows

2018-05-01 Thread Thomas Munro
On Wed, May 2, 2018 at 9:29 AM, Thomas Munro wrote: > On Wed, May 2, 2018 at 8:48 AM, Tom Lane wrote: >> Yeah. In the wake of Peter's changes to use on other >> platforms, should we be enabling HAVE_STDBOOL_H for Windows? > > It seems that header arrived in VC 2013. I will find the conditional

Re: Parallel Aggregates for string_agg and array_agg

2018-05-01 Thread David Rowley
On 2 May 2018 at 08:59, Tom Lane wrote: > Robert Haas writes: >> On Mon, Mar 26, 2018 at 4:27 PM, Tom Lane wrote: >>> I fear that what will happen, if we commit this, is that something like >>> 0.01% of the users of array_agg and string_agg will be pleased, another >>> maybe 20% will be unaffect

Re: Parallel Aggregates for string_agg and array_agg

2018-05-01 Thread Andres Freund
On 2018-05-01 14:35:46 -0700, Mark Dilger wrote: > > > On May 1, 2018, at 2:11 PM, Andres Freund wrote: > > > > Hi, > > > > On 2018-05-01 14:09:39 -0700, Mark Dilger wrote: > >> I don't care which order the data is in, as long as x[i] and y[i] are > >> matched correctly. It sounds like this pa

Re: Parallel Aggregates for string_agg and array_agg

2018-05-01 Thread Mark Dilger
> On May 1, 2018, at 2:11 PM, Andres Freund wrote: > > Hi, > > On 2018-05-01 14:09:39 -0700, Mark Dilger wrote: >> I don't care which order the data is in, as long as x[i] and y[i] are >> matched correctly. It sounds like this patch would force me to write >> that as, for example: >> >> selec

Re: Remove mention in docs that foreign keys on partitioned tables are not supported

2018-05-01 Thread David Rowley
On 1 May 2018 at 23:50, Peter Eisentraut wrote: > committed both Thanks! -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

Re: A few warnings on Windows

2018-05-01 Thread Thomas Munro
On Wed, May 2, 2018 at 8:48 AM, Tom Lane wrote: > Yeah. In the wake of Peter's changes to use on other > platforms, should we be enabling HAVE_STDBOOL_H for Windows? It seems that header arrived in VC 2013. I will find the conditional macrology for that. https://blogs.msdn.microsoft.com/vcblo

Re: Format base - Code contribution

2018-05-01 Thread Miles Elam
Hi Chris, thanks for the reply. On Wed, Apr 25, 2018 at 8:03 PM, Craig Ringer wrote: > Personally, I think this is a better candidate for being incorporated > directly rather than as a contrib. This sort of utility is much less > useful if you cannot rely on it being present. > I guess I've got

Re: Should we add GUCs to allow partition pruning to be disabled?

2018-05-01 Thread David Rowley
On 2 May 2018 at 09:14, David Rowley wrote: > It might be worth running a series of benchmarks to test where the worst case > performance hit is with partition pruning. I just did this: Setup: create table parttable (a int, b int) partition by list (a); create table parttable1 partition of par

Re: Parallel Aggregates for string_agg and array_agg

2018-05-01 Thread Andres Freund
On 2018-05-01 17:16:16 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2018-05-01 14:09:39 -0700, Mark Dilger wrote: > >> I don't care which order the data is in, as long as x[i] and y[i] are > >> matched correctly. It sounds like this patch would force me to write > >> that as, for example

Re: Parallel Aggregates for string_agg and array_agg

2018-05-01 Thread Tom Lane
Andres Freund writes: > On 2018-05-01 14:09:39 -0700, Mark Dilger wrote: >> I don't care which order the data is in, as long as x[i] and y[i] are >> matched correctly. It sounds like this patch would force me to write >> that as, for example: >> >> select array_agg(a order by a, b) AS x, array_a

Re: Should we add GUCs to allow partition pruning to be disabled?

2018-05-01 Thread David Rowley
On 2 May 2018 at 07:24, Robert Haas wrote: > On Tue, Apr 24, 2018 at 5:59 PM, Alvaro Herrera > wrote: > > Constraint > > exclusion was pretty easy to get wrong, hence the need for a separate > > section, and I suppose the new partition pruning may be prey to the same > > problems, so it seems wo

Re: Parallel Aggregates for string_agg and array_agg

2018-05-01 Thread Andres Freund
Hi, On 2018-05-01 14:09:39 -0700, Mark Dilger wrote: > I don't care which order the data is in, as long as x[i] and y[i] are > matched correctly. It sounds like this patch would force me to write > that as, for example: > > select array_agg(a order by a, b) AS x, array_agg(b order by a, b) AS y

Re: Parallel Aggregates for string_agg and array_agg

2018-05-01 Thread Mark Dilger
> On Mar 27, 2018, at 7:58 AM, Tom Lane wrote: > > David Rowley writes: >> On 27 March 2018 at 13:26, Alvaro Herrera wrote: >>> synchronized_seqscans is another piece of precedent in the area, FWIW. > >> This is true. I guess the order of aggregation could be made more >> certain if we remove

Re: Oddity in tuple routing for foreign partitions

2018-05-01 Thread Andres Freund
On 2018-05-01 13:41:32 -0400, Robert Haas wrote: > On Thu, Apr 26, 2018 at 9:23 PM, Amit Langote > wrote: > >>> Thanks for reviewing! > >> > >> I'm happy if it helps you. > > > > Thank you both for reviewing. > > Committed. There's still an open items entry for this thread - has that been resolv

Re: Global snapshots

2018-05-01 Thread Stas Kelvich
> On 1 May 2018, at 22:43, Robert Haas wrote: > > I'm concerned about the provisioning aspect of this problem. Suppose > I have two existing database systems with, perhaps, wildly different > XID counters. On a certain date, I want to start using this system. Yes, that totally possible. On b

Re: Parallel Aggregates for string_agg and array_agg

2018-05-01 Thread Tom Lane
Robert Haas writes: > On Mon, Mar 26, 2018 at 4:27 PM, Tom Lane wrote: >> I fear that what will happen, if we commit this, is that something like >> 0.01% of the users of array_agg and string_agg will be pleased, another >> maybe 20% will be unaffected because they wrote ORDER BY which prevents >

Re: Explain buffers wrong counter with parallel plans

2018-05-01 Thread Andres Freund
Hi, On 2018-04-29 20:40:43 +0530, Amit Kapila wrote: > On Wed, Mar 28, 2018 at 12:07 AM, Adrien Nayrat > > QUERY PLAN > > > > ---

Re: A few warnings on Windows

2018-05-01 Thread Tom Lane
Michael Paquier writes: > On Tue, May 01, 2018 at 05:40:18PM +1200, Thomas Munro wrote: >> src/backend/replication/basebackup.c(1470): warning C4146: unary minus >> operator applied to unsigned type, result still unsigned >> ... where cnt is size_t. Perhaps we should use (or cast to) off_t? > So

Re: wal_consistency_checking reports an inconsistency on master branch

2018-05-01 Thread Andres Freund
On 2018-04-30 22:08:46 -0700, Andres Freund wrote: > On 2018-04-23 07:58:30 -0700, Andres Freund wrote: > > On 2018-04-23 13:22:21 +0300, Heikki Linnakangas wrote: > > > On 13/04/18 13:08, Michael Paquier wrote: > > > > On Fri, Apr 13, 2018 at 02:15:35PM +0530, amul sul wrote: > > > > > I have look

Re: Support Python 3 tests under MSVC

2018-05-01 Thread Andrew Dunstan
On Mon, Apr 30, 2018 at 4:52 PM, Peter Eisentraut wrote: > On 4/30/18 15:52, Andrew Dunstan wrote: >> I'd like to apply these - they only affect the testing script >> vcregress.pl, so they should be very low risk. > > In case there are concerns about maintaining a second copy of the > "mangle" scr

Re: Is a modern build system acceptable for older platforms

2018-05-01 Thread Andrew Dunstan
On Tue, May 1, 2018 at 12:46 PM, Tom Lane wrote: > Andres Freund writes: >> On 2018-05-01 12:19:28 -0400, Robert Haas wrote: >>> I found your brain dump an interesting read, and I have to say that it >>> leaves me rather uninspired about making a change. It sounds to me >>> like if we change, so

Re: Parallel Aggregates for string_agg and array_agg

2018-05-01 Thread Robert Haas
On Mon, Mar 26, 2018 at 4:27 PM, Tom Lane wrote: > I do not think it is accidental that these aggregates are exactly the ones > that do not have parallelism support today. Rather, that's because you > just about always have an interest in the order in which the inputs get > aggregated, which is s

Re: power() function in Windows: "value out of range: underflow"

2018-05-01 Thread David G. Johnston
On Tue, May 1, 2018 at 12:08 PM, Robert Haas wrote: > > > But I don't think > > we should discount the existence of the former category. Deploying > > to production on an older release of $system than you develop on > > is hardly an unusual scenario. > > That's probably true, but making dev, tes

Re: Global snapshots

2018-05-01 Thread Robert Haas
On Tue, May 1, 2018 at 12:27 PM, Stas Kelvich wrote: > Here proposed a set of patches that allow achieving proper snapshot isolation > semantics in the case of cross-node transactions. Provided infrastructure to > synchronize snapshots between different Postgres instances and a way to > atomically

Re: Should we add GUCs to allow partition pruning to be disabled?

2018-05-01 Thread Robert Haas
On Tue, Apr 24, 2018 at 5:59 PM, Alvaro Herrera wrote: > Constraint > exclusion was pretty easy to get wrong, hence the need for a separate > section, and I suppose the new partition pruning may be prey to the same > problems, so it seems worth to document them specially. But not sure > about the

Re: power() function in Windows: "value out of range: underflow"

2018-05-01 Thread Robert Haas
On Tue, May 1, 2018 at 1:49 PM, Tom Lane wrote: > The point here, I think, is that you get behavior X on approximately 100% > of modern platforms, but (without this patch) behavior Y on some number of > older platforms. People who have tested their app on a modern platform > and then find that it

Re: [HACKERS] Clock with Adaptive Replacement

2018-05-01 Thread Robert Haas
On Sat, Apr 28, 2018 at 7:16 PM, Peter Geoghegan wrote: > There could very easily be an enormous range of usefulness among > buffers in shared_buffers. And yet, we only recognize the increments > that usage_count can represent (this is before we even think about the > actual problems with how usag

Re: Fsync request queue

2018-05-01 Thread Andres Freund
On 2018-05-01 13:43:14 -0400, Robert Haas wrote: > On Tue, May 1, 2018 at 1:41 PM, Andres Freund wrote: > > I unfortunately don't have access to the relevant reports anymore, so > > it's only by memory. What I do remember is that a few I saw > > pg_stat_bgwriter.buffers_backend_fsync values that w

Re: power() function in Windows: "value out of range: underflow"

2018-05-01 Thread Tom Lane
Robert Haas writes: > On Sun, Apr 29, 2018 at 7:24 PM, David Rowley > wrote: >> I think we should back patch and try to be consistent about the >> power(float8 1.0, 'NaN') and power('NaN', float8 0.0) cases. The >> archives don't show any complaints about power() with NaN until this >> one, so I

Re: Fsync request queue

2018-05-01 Thread Robert Haas
On Tue, May 1, 2018 at 1:41 PM, Andres Freund wrote: > I unfortunately don't have access to the relevant reports anymore, so > it's only by memory. What I do remember is that a few I saw > pg_stat_bgwriter.buffers_backend_fsync values that we a pretty sizable > fraction of the buffers written by b

Re: Fsync request queue

2018-05-01 Thread Andres Freund
On 2018-05-01 13:21:21 -0400, Robert Haas wrote: > On Mon, Apr 30, 2018 at 7:08 PM, Andres Freund wrote: > >> True, but has anyone ever actually observed a non-zero > >> pg_stat_bgwriter.buffers_backend_fsync in the wild after the > >> compaction queue stuff was added/backpatched? > > > > Yes. >

Re: Oddity in tuple routing for foreign partitions

2018-05-01 Thread Robert Haas
On Thu, Apr 26, 2018 at 9:23 PM, Amit Langote wrote: >>> Thanks for reviewing! >> >> I'm happy if it helps you. > > Thank you both for reviewing. Committed. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: power() function in Windows: "value out of range: underflow"

2018-05-01 Thread Robert Haas
On Sun, Apr 29, 2018 at 7:24 PM, David Rowley wrote: > I think we should back patch and try to be consistent about the > power(float8 1.0, 'NaN') and power('NaN', float8 0.0) cases. The > archives don't show any complaints about power() with NaN until this > one, so I imagine the number of people

Re: Fsync request queue

2018-05-01 Thread Robert Haas
On Mon, Apr 30, 2018 at 7:08 PM, Andres Freund wrote: >> True, but has anyone ever actually observed a non-zero >> pg_stat_bgwriter.buffers_backend_fsync in the wild after the >> compaction queue stuff was added/backpatched? > > Yes. Care to elaborate? -- Robert Haas EnterpriseDB: http://www.en

Re: Is a modern build system acceptable for older platforms

2018-05-01 Thread Tom Lane
Andres Freund writes: > On 2018-05-01 12:19:28 -0400, Robert Haas wrote: >> I found your brain dump an interesting read, and I have to say that it >> leaves me rather uninspired about making a change. It sounds to me >> like if we change, some things will be better and others will not be >> as go

Re: Is a modern build system acceptable for older platforms

2018-05-01 Thread Robert Haas
On Tue, May 1, 2018 at 12:31 PM, Andres Freund wrote: > How is being able to build extensions on windows reasonably not an > improvement? It's really hard to build pgxs like stuff on windows right > now. Also not having to maintain a fair amount of visual studio project > generation code? And ge

Re: Is a modern build system acceptable for older platforms

2018-05-01 Thread Geoff Winkless
I'd like to add my 2c that, as a user who has to support postgres running on some fairly old systems, changing to a modern build mechanism (with all the resultant dependency hell that it would likely introduce) would be likely to cause me much grief. At the moment I can still log in to the old RH

Re: Usage of pg_waldump

2018-05-01 Thread David G. Johnston
On Tue, May 1, 2018 at 9:26 AM, Andres Freund wrote: > Hi, > > On 2018-05-01 16:41:04 +0900, Dang Minh Huong wrote: > > The syntax is known as, > > > > pg_waldump [OPTION]... [STARTSEG [ENDSEG]] > > > > Mean that, it could work with no arguments. > > But the "no arguments specified" ERROR will

Re: Postgres, fsync, and OSs (specifically linux)

2018-05-01 Thread Andres Freund
Hi, On 2018-04-27 15:28:42 -0700, Andres Freund wrote: > I went to LSF/MM 2018 to discuss [0] and related issues. Overall I'd say > it was a very productive discussion. I'll first try to recap the > current situation, updated with knowledge I gained. Secondly I'll try to > discuss the kernel chan

Re: Is a modern build system acceptable for older platforms

2018-05-01 Thread Andres Freund
On 2018-05-01 12:19:28 -0400, Robert Haas wrote: > On Fri, Apr 27, 2018 at 5:46 AM, Hartmut Holzgraefe > wrote: > > I could probably continue with this brain dump forever, ... > > I found your brain dump an interesting read, and I have to say that it > leaves me rather uninspired about making a c

Re: Local partitioned indexes and pageinspect

2018-05-01 Thread Robert Haas
On Mon, Apr 30, 2018 at 2:50 AM, Michael Paquier wrote: > On Sun, Apr 29, 2018 at 06:20:02PM -0700, Peter Geoghegan wrote: >> What about amcheck? I did change the example query in the docs to >> account for this, so anyone that generalizes from that won't have a >> problem, but it would be nice if

Re: Usage of pg_waldump

2018-05-01 Thread Andres Freund
Hi, On 2018-05-01 16:41:04 +0900, Dang Minh Huong wrote: > The syntax is known as, > > pg_waldump [OPTION]... [STARTSEG [ENDSEG]] > > Mean that, it could work with no arguments. > But the "no arguments specified" ERROR will be returned in that case. > > $ pg_waldump > pg_waldump: no argum

Re: Postgres, fsync, and OSs (specifically linux)

2018-05-01 Thread Catalin Iacob
On Sat, Apr 28, 2018 at 12:28 AM, Andres Freund wrote: > Before linux v4.13 errors in kernel writeback would be reported at most > once, without a guarantee that that'd happen (IIUC memory pressure could > lead to the relevant information being evicted) - but it was pretty > likely. After v4.13 (

Re: Is a modern build system acceptable for older platforms

2018-05-01 Thread Robert Haas
On Fri, Apr 27, 2018 at 5:46 AM, Hartmut Holzgraefe wrote: > I could probably continue with this brain dump forever, ... I found your brain dump an interesting read, and I have to say that it leaves me rather uninspired about making a change. It sounds to me like if we change, some things will b

Re: Patch missing from back branches

2018-05-01 Thread Tom Lane
Stephen Frost writes: > * Michael Paquier (mich...@paquier.xyz) wrote: >> There is dory in the buildfarm which compiles using VS 2015, but it runs >> only 9.6 and newer versions. > That would be specifically because compiling 9.5 didn't work.. We'd be > happy to have dory running on older major

Re: Is there a memory leak in commit 8561e48?

2018-05-01 Thread Tom Lane
Peter Eisentraut writes: > The memory leak can be fixed by adding a pfree(). That seems like an odd way to approach this. Why not just remove the reset of _SPI_stack and _SPI_stack_depth, so as to subtract code rather than adding it --- that is, make it actually work like you mistakenly thought

Re: stats_ext test fails with -DCATCACHE_FORCE_RELEASE

2018-05-01 Thread Tom Lane
Amit Langote writes: > While playing around with a -DCATCACHE_FORCE_RELEASE build, I noticed that > stats_ext test failed with errors for multiple statements that looked like > this: > ERROR: invalid ndistinct magic 7f7f7f7f (expected a352bfa4) Interesting. How come the buildfarm hasn't noticed

Re: "could not reattach to shared memory" on buildfarm member dory

2018-05-01 Thread Tom Lane
Well, at this point the only thing that's entirely clear is that none of the ideas I had work. I think we are going to be forced to pursue Noah's idea of doing an end-to-end retry. Somebody else will need to take point on that; I lack a Windows environment and have already done a lot more blind p

Re: lazy detoasting

2018-05-01 Thread Peter Eisentraut
On 4/25/18 07:50, Andrew Gierth wrote: > do $$ > declare a text; > begin > select f1.a into a from f1; > delete from f1; > commit; > perform pg_sleep(10); -- vacuum f1 in another session while it sleeps > call p1(a); > end; $$; > INFO: a: (t,t,f,"missing chunk number 0",

Re: Is there a memory leak in commit 8561e48?

2018-05-01 Thread Michael Paquier
On Mon, Apr 30, 2018 at 05:10:14PM -0400, Peter Eisentraut wrote: > The memory leak can be fixed by adding a pfree(). > > The example you show can be fixed by doing SPI cleanup in both > transaction abort and exception return to main loop, similar to other > cases that now have to handle these sep

Re: Remove mention in docs that foreign keys on partitioned tables are not supported

2018-05-01 Thread Peter Eisentraut
On 4/26/18 05:03, Amit Langote wrote: > On 2018/04/26 13:01, David Rowley wrote: >> The attached small patch removes the mention that partitioned tables >> cannot have foreign keys defined on them. >> >> This has been supported since 3de241db > > I noticed also that the item regarding row triggers

Re: Expression errors with "FOR UPDATE" and postgres_fdw with partition wise join enabled.

2018-05-01 Thread Etsuro Fujita
(2018/04/27 14:40), Ashutosh Bapat wrote: Here's updated patch set. Thanks for updating the patch! Here are my review comments on patch 0003-postgres_fdw-child-join-with-ConvertRowtypeExprs-cau.patch: * This assertion in deparseConvertRowtypeExpr wouldn't always be true because of cases li

Re: minor fix for acquire_inherited_sample_rows

2018-05-01 Thread Amit Langote
On 2018/04/27 22:42, Ashutosh Bapat wrote: > On Thu, Apr 26, 2018 at 7:08 PM, Amit Langote wrote: >> On Thu, Apr 26, 2018 at 9:54 PM, Ashutosh Bapat >> wrote: >>> On Thu, Apr 26, 2018 at 1:08 AM, Robert Haas wrote: +1. I think we're really abusing equalTupleDescs() for purposes for wh

Re: Should we add GUCs to allow partition pruning to be disabled?

2018-05-01 Thread Amit Langote
On 2018/04/26 16:29, David Rowley wrote: > On 25 April 2018 at 09:59, Alvaro Herrera wrote: >> Amit Langote wrote: >>> Although the config.sgml coverage of the new capabilities seems pretty >>> good, some may find their being mentioned in 5.10 Table Partitioning >>> helpful. Or if we don't want t

Re: [GENERAL] huge RAM use in multi-command ALTER of table heirarchy

2018-05-01 Thread Amit Langote
On 2018/04/29 1:00, Justin Pryzby wrote: > On Tue, Jul 18, 2017 at 07:26:30PM -0400, Tom Lane wrote: >>> It's probably a bit late in the v10 cycle to be taking any risks in >>> this area, but I'd vote for ripping out RememberToFreeTupleDescAtEOX >>> as soon as the v11 cycle opens, unless someone ca

Re: A few warnings on Windows

2018-05-01 Thread Michael Paquier
On Tue, May 01, 2018 at 05:40:18PM +1200, Thomas Munro wrote: > src/backend/replication/basebackup.c(1470): warning C4146: unary minus > operator applied to unsigned type, result still unsigned > > Yeah, we have: if (fseek(fp, -(cnt - BLCKSZ * i), SEEK_CUR) == -1) > > ... where cnt is size_t. Pe

Usage of pg_waldump

2018-05-01 Thread Dang Minh Huong
Hi, I am confused with the Usage of pg_waldump (or pg_xlogdump). The syntax is known as, pg_waldump [OPTION]... [STARTSEG [ENDSEG]] Mean that, it could work with no arguments. But the "no arguments specified" ERROR will be returned in that case. $ pg_waldump pg_waldump: no arguments spec

Re: Protecting sensitive data over NetApp

2018-05-01 Thread Craig Ringer
This doesn't seem to be commentary on the documentation its self. Please post to pgsql-general for advice and discussion about PostgreSQL, or use one of the Stack Overflow sites or another appropriate forum.

Protecting sensitive data over NetApp

2018-05-01 Thread Liran's Lab
PostgreSQL 9.4 Current setup is one standalone server with disk mount on NetApp. Data should be protected from access by other sources. For example - if for some reason one of the Netapp admins mount the Postgres LUN to another server. One option is to stored data locally - but then it is limited

stats_ext test fails with -DCATCACHE_FORCE_RELEASE

2018-05-01 Thread Amit Langote
Hi. While playing around with a -DCATCACHE_FORCE_RELEASE build, I noticed that stats_ext test failed with errors for multiple statements that looked like this: ERROR: invalid ndistinct magic 7f7f7f7f (expected a352bfa4) I figured it's because statext_dependencies_load() and statext_ndistinct_bu