Re: Don't wake up to check trigger file if none is configured

2019-01-30 Thread Michael Paquier
On Wed, Dec 26, 2018 at 03:24:01PM +0900, Michael Paquier wrote: > It seems to me that the comment on top of WaitLatch should be clearer > about that, and that the current state leads to confusion. Another > thing coming to my mind is that I think it would be useful to make the > timeout

Re: Cache lookup errors with functions manipulation object addresses

2019-01-30 Thread Michael Paquier
On Tue, Dec 25, 2018 at 01:34:38PM +0900, Michael Paquier wrote: > With that all the regression tests show a consistent behavior for all > object types when those are undefined. Thoughts? End-of-commit-fest rebase and moved to next CF. -- Michael From 6514d737cef100ea8146b1d6d10fa93e40c6ee9c Mon

Re: Add pg_partition_root to get top-most parent of a partition tree

2019-01-30 Thread Michael Paquier
On Sat, Dec 15, 2018 at 10:16:08AM +0900, Michael Paquier wrote: > Changed in this sense. Please find attached an updated patch. Rebased as per the attached, and moved to next CF. -- Michael diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 4930ec17f6..86ff4e5c9e 100644 ---

Re: Adding a TAP test checking data consistency on standby with minRecoveryPoint

2019-01-30 Thread Michael Paquier
On Mon, Nov 12, 2018 at 01:08:38PM +0900, Michael Paquier wrote: > Thanks! I am stealing that stuff, and I have added an offline check by > comparing the value of minRecoveryPoint in pg_controldata. Again, if > you revert c186ba13 and run the tests, both online and offline failures > are showing

Re: Unused parameters & co in code

2019-01-30 Thread Michael Paquier
On Wed, Jan 30, 2019 at 08:14:05AM -0300, Alvaro Herrera wrote: > On 2019-Jan-30, Michael Paquier wrote: >> ReindexPartitionedIndex => parentIdx > > I'd not change this one, as we will surely want to do something useful > eventually. Not that it matters, but it'd be useless churn. A lot of

Re: Index Skip Scan

2019-01-30 Thread Kyotaro HORIGUCHI
Hello. At Wed, 30 Jan 2019 18:19:05 +0100, Dmitry Dolgov <9erthali...@gmail.com> wrote in > A bit of adjustment after nodes/relation -> nodes/pathnodes. I had a look on this. The name "index skip scan" is a different feature from the feature with the name on other prodcuts, which means "index

Too rigorous assert in reorderbuffer.c

2019-01-30 Thread Arseny Sher
Hi, My colleague Alexander Lakhin has noticed an assertion failure in reorderbuffer.c:1330. Here is a simple snippet reproducing it: SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'test_decoding'); create table t(k int); begin; savepoint a; alter table t alter column

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

2019-01-30 Thread Amit Kapila
On Wed, Jan 30, 2019 at 10:41 PM Masahiko Sawada wrote: > > On Wed, Jan 30, 2019 at 4:33 AM Amit Kapila wrote: > > > > On Tue, Jan 29, 2019 at 8:12 PM John Naylor > > wrote: > > > > > > On Tue, Jan 29, 2019 at 11:56 AM Amit Kapila > > > wrote: > > > > > > > You can find this change in

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

2019-01-30 Thread Amit Kapila
On Wed, Jan 30, 2019 at 8:11 PM John Naylor wrote: > > On Wed, Jan 30, 2019 at 2:11 PM Amit Kapila wrote: > > This is much better than the earlier version of test and there is no > > dependency on the vacuum. However, I feel still there is some > > dependency on how the rows will fit in a page

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

2019-01-30 Thread Noah Misch
On Tue, Jan 29, 2019 at 11:28:56AM -0500, Heath Lord wrote: > On Thu, Jan 17, 2019 at 3:27 AM Noah Misch wrote: > > On Sun, Dec 02, 2018 at 09:35:06PM -0800, Noah Misch wrote: > > > Could one of you having a dory login use > > > https://live.sysinternals.com/Procmon.exe to capture process events

Re: [HACKERS] Removing [Merge]Append nodes which contain a single subpath

2019-01-30 Thread David Rowley
On Sat, 26 Jan 2019 at 13:51, Tom Lane wrote: > > David Rowley writes: > > On Thu, 3 Jan 2019 at 08:01, Tomas Vondra > > wrote: > >> AFAICS the patch essentially does two things: (a) identifies Append > >> paths with a single member and (b) ensures the Vars are properly mapped > >> when the

Re: A few new options for vacuumdb

2019-01-30 Thread Michael Paquier
On Thu, Jan 31, 2019 at 02:28:05AM +, Bossart, Nathan wrote: > It looks good to me. The only thing I noticed is the use of > relfrozenxid instead of relminmxid here: Fixed and committed. So we are finally done here, except for the debate with the relation size. -- Michael signature.asc

Re: psql exit status with multiple -c or -f

2019-01-30 Thread Justin Pryzby
At Tue, 18 Dec 2018 10:24:39 -0600, Justin Pryzby wrote: > I think ON_ERROR_STOP would control whether the script stops, but it should > fail the exit status should reflect any error in the last command. The > shell does that even without set -e. Let me correct my own language: | I think

Re: psql exit status with multiple -c or -f

2019-01-30 Thread David G. Johnston
On Wed, Jan 30, 2019 at 6:38 PM Kyotaro HORIGUCHI wrote: > I guess the reason is that psql is widely used with just a single > -c command and acutually the fix breaks the cases. So it doesn't > seem back-pachable but it is apparently contradicting to > documentation, which seems perfectly

Re: Ordered Partitioned Table Scans

2019-01-30 Thread David Rowley
I've attached a rebased patch which fixes up the recent conflicts. No other changes were made. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services v7-0001-Allow-Append-to-be-used-in-place-of-MergeAppend-f.patch Description:

Re: Proposed refactoring of planner header files

2019-01-30 Thread Tom Lane
I wrote: > ... I didn't work on tightening selfuncs.c's dependencies. > While I don't have a big problem with considering selfuncs.c to be > in bed with the planner, that's risky in that whatever dependencies > selfuncs.c has may well apply to extensions' selectivity estimators too. > What I'm

Re: A few new options for vacuumdb

2019-01-30 Thread Bossart, Nathan
On 1/30/19, 6:04 PM, "Michael Paquier" wrote: > Something which was not correct in the patch is the compatibility of > the query. xid <> xid has been added in 9.6, so the new options will > not be able to work with older versions. The versions marked as > compatible in the last patch came from

Re: [PATCH] Pass COPT and PROFILE to CXXFLAGS as well

2019-01-30 Thread Michael Paquier
On Wed, Jan 30, 2019 at 08:18:31PM -0500, Tom Lane wrote: > This looks a bit copy-and-paste-y to me, in particular no thought > has been taken for the order of flags. We found in configure that > it's better to add user-specified CFLAGS at the *end*, even though > injecting user-specified

Re: A few new options for vacuumdb

2019-01-30 Thread Michael Paquier
On Wed, Jan 30, 2019 at 05:45:58PM +, Bossart, Nathan wrote: > On 1/29/19, 4:47 PM, "Michael Paquier" wrote: >> Oh, OK. This makes sense. It would be nice to add a comment in the >> patch and to document this calculation method in the docs of >> vacuumdb. > > Sure, this is added in v8.

Re: psql exit status with multiple -c or -f

2019-01-30 Thread Kyotaro HORIGUCHI
At Thu, 31 Jan 2019 10:37:28 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI wrote in <20190131.103728.153290385.horiguchi.kyot...@lab.ntt.co.jp> > > I think ON_ERROR_STOP would control whether the script stops, but it should > > fail the exit status should reflect any error in the last command.

Re: psql exit status with multiple -c or -f

2019-01-30 Thread Kyotaro HORIGUCHI
Hello. At Tue, 18 Dec 2018 10:24:39 -0600, Justin Pryzby wrote in <20181218162439.gb8...@telsasoft.com> > On Tue, Dec 18, 2018 at 05:13:40PM +0900, Kyotaro HORIGUCHI wrote: > > $ psql postgres -v ON_ERROR_STOP=0 -f ~/work/y.txt ; echo $? > > $ psql postgres -v ON_ERROR_STOP=0 < ~/work/y.txt ;

Re: [PATCH] Pass COPT and PROFILE to CXXFLAGS as well

2019-01-30 Thread Tom Lane
Michael Paquier writes: > On Wed, Jan 30, 2019 at 02:41:01PM +0100, Christoph Berg wrote: >> Do we still want some CXXOPT flag for the server build? I can write a >> patch, but someone else would need to do the bikeshedding how to name >> it, and which of the existing knobs would set CXXFLAGS

RE: pg_upgrade: Pass -j down to vacuumdb

2019-01-30 Thread Jamison, Kirk
On January 29, 2019 8:19 PM +, Jesper Pedersen wrote: >On 1/29/19 12:08 AM, Michael Paquier wrote: >> I would document the optional VACUUM_OPTS on the page of pg_upgrade. >> If Peter thinks it is fine to not do so, that's fine for me as well. >> .. >I added most of the documentation back, as

Re: [PATCH] Pass COPT and PROFILE to CXXFLAGS as well

2019-01-30 Thread Michael Paquier
On Wed, Jan 30, 2019 at 02:41:01PM +0100, Christoph Berg wrote: > Do we still want some CXXOPT flag for the server build? I can write a > patch, but someone else would need to do the bikeshedding how to name > it, and which of the existing knobs would set CXXFLAGS along. I don't > think I need

Re: backslash-dot quoting in COPY CSV

2019-01-30 Thread Michael Paquier
On Wed, Jan 30, 2019 at 01:20:59PM -0500, Tom Lane wrote: > Given how long we've had COPY CSV support, and the tiny number of > complaints to date, I do not think it's something to panic over. > Disallowing the functionality altogether is surely an overreaction. > > A documentation warning might

Re: Unused parameters & co in code

2019-01-30 Thread Michael Paquier
On Wed, Jan 30, 2019 at 12:33:47PM +0100, Peter Eisentraut wrote: > On 30/01/2019 08:33, Michael Paquier wrote: >> I just got a run with CFLAGS with the following options: >> -Wunused-function -Wunused-variable -Wunused-const-variable > > These are part of -Wall. The ones selected already

Re: [PATCH] Allow anonymous rowtypes in function return column definition

2019-01-30 Thread Tom Lane
Elvis Pranskevichus writes: > On Wednesday, January 30, 2019 5:59:41 PM EST Tom Lane wrote: >> I still found this pretty disjointed. After a bit of thought I >> propose the attached reformulation, which has the callers just tell >> the routines which types to allow explicitly, with the

Re: Unused parameters & co in code

2019-01-30 Thread Michael Paquier
On Wed, Jan 30, 2019 at 09:41:04AM -0500, Tom Lane wrote: > I'd definitely take this on a case-by-case basis. In the planner > functions you mentioned, for instance, I'd be pretty hesitant to remove > the "root" parameter even if it happens not to be needed today. > We'd probably just end up

Re: [PATCH] Allow anonymous rowtypes in function return column definition

2019-01-30 Thread Elvis Pranskevichus
On Wednesday, January 30, 2019 5:59:41 PM EST Tom Lane wrote: > I still found this pretty disjointed. After a bit of thought I > propose the attached reformulation, which has the callers just tell > the routines which types to allow explicitly, with the justification > comments living at the call

Re: Delay locking partitions during query execution

2019-01-30 Thread David Rowley
On Tue, 29 Jan 2019 at 19:42, Amit Langote wrote: > However, I tried the example as you described and the plan *doesn't* > change due to concurrent update of reloptions with master (without the > patch) either. Well, I didn't think to try that. I just assumed had broken it. Could well be

Re: [PATCH] Allow anonymous rowtypes in function return column definition

2019-01-30 Thread Tom Lane
Elvis Pranskevichus writes: > On Sunday, January 13, 2019 4:57:48 PM EST Tom Lane wrote: >> I feel a bit uncomfortable about defining the new flag to >> CheckAttributeNamesTypes as "allow_anonymous_records"; that >> seems pretty short-sighted and single-purpose, especially in >> view of there

Re: pg_dump multi VALUES INSERT

2019-01-30 Thread David Rowley
On Thu, 24 Jan 2019 at 04:45, Fabien COELHO wrote: > >> The feature is not tested anywhere. I still think that there should be a > >> test on empty/small/larger-than-rows-per-insert tables, possibly added to > >> existing TAP-tests. > > > > I was hoping to get away with not having to do that...

Re: [PATCH] Log PostgreSQL version number on startup

2019-01-30 Thread Peter Eisentraut
On 29/01/2019 16:46, Christoph Berg wrote: > Re: Peter Eisentraut 2019-01-16 > <92bfdfdf-4164-aec5-4e32-c26e67821...@2ndquadrant.com> >>> Why don't we start the logging collector before opening the sockets? >> >> Specifically, something like the attached. >> >> This keeps the dynamic module

Re: speeding up planning with partitions

2019-01-30 Thread David Rowley
On Tue, 29 Jan 2019 at 22:32, Amit Langote wrote: > Attached updated patches. I think we could make the 0001 patch a bit smaller if we were to apply the attached first. Details in the commit message. What do you think? -- David Rowley http://www.2ndQuadrant.com/

Re: backslash-dot quoting in COPY CSV

2019-01-30 Thread Tom Lane
Pavel Stehule writes: > st 30. 1. 2019 18:51 odesílatel Bruce Momjian napsal: >> I am wondering if we should just disallow CSV from STDIN, on security >> grounds. How big a problem would that be for people? Would we have to >> disable to STDOUT as well since it could not be restored? Should

Re: backslash-dot quoting in COPY CSV

2019-01-30 Thread Pavel Stehule
st 30. 1. 2019 18:51 odesílatel Bruce Momjian napsal: > On Wed, Jan 30, 2019 at 06:32:11PM +0100, Daniel Verite wrote: > > Bruce Momjian wrote: > > > Well, these all kind of require a change to the COPY format, which > > > hasn't changed in many years. > > > > Not for the first two. As an

Re: backslash-dot quoting in COPY CSV

2019-01-30 Thread Bruce Momjian
On Wed, Jan 30, 2019 at 06:32:11PM +0100, Daniel Verite wrote: > Bruce Momjian wrote: > > Well, these all kind of require a change to the COPY format, which > > hasn't changed in many years. > > Not for the first two. As an example of solution #2, it could look like this: > > =# \set

Re: speeding up planning with partitions

2019-01-30 Thread Amit Langote
On Wed, Jan 30, 2019 at 3:20 AM David Rowley wrote: > > On Tue, 29 Jan 2019 at 22:32, Amit Langote > wrote: > > > > On 2019/01/29 11:23, David Rowley wrote: > > > 7. In set_inherit_target_rel_sizes() I still don't really like the way > > > you're adjusting the EquivalenceClasses. Would it not be

Re: backslash-dot quoting in COPY CSV

2019-01-30 Thread Daniel Verite
Bruce Momjian wrote: > > - the end of data could be expressed as a length (in number of lines > > for instance) instead of an in-data marker. > > > > - the end of data could be configurable, as in the MIME structure of > > multipart mail messages, where a part is ended by a "boundary", >

Re: strange error sequence on parallel btree creation

2019-01-30 Thread Peter Geoghegan
Hi Álvaro, On Wed, Jan 30, 2019 at 5:40 AM Alvaro Herrera wrote: > Note that those come from the same create index: the one on process > 46299 must evidently be a parallel worker. It's weird that two > processes report the index building error. But even if it were correct, > the CONTEXT line

Re: Index Skip Scan

2019-01-30 Thread Dmitry Dolgov
> On Sun, Jan 27, 2019 at 6:17 PM Dmitry Dolgov <9erthali...@gmail.com> wrote: > > > On Sat, Jan 26, 2019 at 6:45 PM Dmitry Dolgov <9erthali...@gmail.com> wrote: > > > > Rebased version after rd_amroutine was renamed. > > And one more to fix the documentation. Also I've noticed few TODOs in the >

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

2019-01-30 Thread Masahiko Sawada
On Wed, Jan 30, 2019 at 4:33 AM Amit Kapila wrote: > > On Tue, Jan 29, 2019 at 8:12 PM John Naylor > wrote: > > > > On Tue, Jan 29, 2019 at 11:56 AM Amit Kapila > > wrote: > > > > > You can find this change in attached patch. Then, I ran the make > > > check in src/bin/pgbench multiple times

Re: [HACKERS] proposal: schema variables

2019-01-30 Thread Pavel Stehule
Hi just rebase Regards Pavel schema-variables-20190130.patch.gz Description: application/gzip

Re: proposal: new polymorphic types - commontype and commontypearray

2019-01-30 Thread Pavel Stehule
st 30. 1. 2019 v 17:00 odesílatel Pavel Stehule napsal: > > > po 28. 1. 2019 v 20:47 odesílatel Robert Haas > napsal: > >> On Fri, Jan 25, 2019 at 7:21 PM Tom Lane wrote: >> > Anyway I think the names need to be any-something. >> >> To me, that seems unnecessarily rigid. Not a bad idea if we

Re: proposal: new polymorphic types - commontype and commontypearray

2019-01-30 Thread Pavel Stehule
po 28. 1. 2019 v 20:47 odesílatel Robert Haas napsal: > On Fri, Jan 25, 2019 at 7:21 PM Tom Lane wrote: > > Anyway I think the names need to be any-something. > > To me, that seems unnecessarily rigid. Not a bad idea if we can come > up with something that is otherwise acceptable. But all of

Fwd: Re: BUG #15589: Due to missing wal, restore ends prematurely and opens database for read/write

2019-01-30 Thread leif
Hi I have reported a bug via PostgreSQL bug report form, but havent got any response so far. This might not be a bug, but a feature not implemented yet. I suggest to make a small addition to StartupXLOG to solve the issue. git diff src/backend/access/transam/xlog.c diff --git

Re: insensitive collations

2019-01-30 Thread Daniel Verite
Peter Eisentraut wrote: > Another patch. +ks key), in order for such such collations to act in a s/such such/such/ + +The pattern matching operators of all three kinds do not support +nondeterministic collations. If required, apply a different collation to +the

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

2019-01-30 Thread John Naylor
On Wed, Jan 30, 2019 at 2:11 PM Amit Kapila wrote: > This is much better than the earlier version of test and there is no > dependency on the vacuum. However, I feel still there is some > dependency on how the rows will fit in a page and we have seen some > related failures due to alignment

Re: Unused parameters & co in code

2019-01-30 Thread Tom Lane
Michael Paquier writes: > ... while this generates a lot of noise for callbacks and depending on > the environment used, this is also pointing to things which could be > simplified: I'd definitely take this on a case-by-case basis. In the planner functions you mentioned, for instance, I'd be

Re: Replication & recovery_min_apply_delay

2019-01-30 Thread Alvaro Herrera
Hi On 2019-Jan-30, Konstantin Knizhnik wrote: > One of our customers was faced with the following problem: he has > setup  physical primary-slave replication but for some reasons > specified very large (~12 hours) recovery_min_apply_delay. We also came across this exact same problem some time

Re: Synchronous replay take III

2019-01-30 Thread Michail Nikolaev
Hello, Sorry, missed email. >> In our case we have implemented some kind of "replication barrier" functionality based on table with counters (one counter per application backend in simple case). >> Each application backend have dedicated connection to each replica. And it selects its counter

Re: [PATCH] Pass COPT and PROFILE to CXXFLAGS as well

2019-01-30 Thread Christoph Berg
Re: Andres Freund 2019-01-30 <20190130015127.hciz36lpmu7pr...@alap3.anarazel.de> > I'm confused - that doesn't allow to inject flags to all in-core built > files? So how does that fix your problem fully? Say > e.g. llvmjit_inline.cpp won't get the flag, and thus not be > reproducible? The

strange error sequence on parallel btree creation

2019-01-30 Thread Alvaro Herrera
Hi While trying out the progress report mechanism for btrees, I noticed this strange chain of errors: 2019-01-29 15:51:55.928 -03 [43789] ERROR: no se pudo crear el índice único «a_generate_series_idx» 2019-01-29 15:51:55.928 -03 [43789] DETALLE: La llave (generate_series)=(152) está

Re: Unused parameters & co in code

2019-01-30 Thread Alvaro Herrera
On 2019-Jan-30, Michael Paquier wrote: > ReindexPartitionedIndex => parentIdx I'd not change this one, as we will surely want to do something useful eventually. Not that it matters, but it'd be useless churn. > blackholeNoticeProcessor => arg This one's signature is enforced by

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

2019-01-30 Thread Amit Kapila
On Wed, Jan 30, 2019 at 3:26 PM John Naylor wrote: > > On Wed, Jan 30, 2019 at 4:33 AM Amit Kapila wrote: > > There are two more failures which we need to something about. > > 1. Make fsm.sql independent of vacuum without much losing on coverage > > of newly added code. John, I guess you have

Re: Control your disk usage in PG: Introduction to Disk Quota Extension

2019-01-30 Thread Hubert Zhang
Hi all, Currently we add hooks in SMGR to detect which table is being modified(disk size change). Inserting rows into existing page with room will not introduce new block, and thus should not be treated as active table. smgrextend is a good position to meet this behavior. We welcome suggestions

Replication & recovery_min_apply_delay

2019-01-30 Thread Konstantin Knizhnik
Hi hackers, One of our customers was faced with the following problem: he has setup  physical primary-slave replication but for some reasons specified very large (~12 hours) recovery_min_apply_delay. I do not know precise reasons for such large gap between master and replica. But everything

Re: Unused parameters & co in code

2019-01-30 Thread Peter Eisentraut
On 30/01/2019 08:33, Michael Paquier wrote: > I just got a run with CFLAGS with the following options: > -Wunused-function -Wunused-variable -Wunused-const-variable These are part of -Wall. > -Wno-unused-result What is the purpose of this? > -Wunused-parameter I think it's worth cleaning

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

2019-01-30 Thread John Naylor
On Wed, Jan 30, 2019 at 4:33 AM Amit Kapila wrote: > There are two more failures which we need to something about. > 1. Make fsm.sql independent of vacuum without much losing on coverage > of newly added code. John, I guess you have an idea, see if you can > take care of it, otherwise, I will

Re: jsonpath

2019-01-30 Thread Alexander Korotkov
On Wed, Jan 30, 2019 at 9:36 AM Andres Freund wrote: > On 2019-01-30 07:34:00 +0300, Alexander Korotkov wrote: > > Thank you for your review! Let me answer some points of your review > > while others will be answered later. > > > > On Wed, Jan 30, 2019 at 5:28 AM Andres Freund wrote: > > > On

Re: Protect syscache from bloating with negative cache entries

2019-01-30 Thread Kyotaro HORIGUCHI
At Wed, 30 Jan 2019 05:06:30 +, "Ideriha, Takeshi" wrote in <4E72940DA2BF16479384A86D54D0988A6F4156D4@G01JPEXMBKW04> > >You don't have a direct control on syscache memory usage. When you find a > >queriy > >slowed by the default cache expiration, you can set cache_memory_taret to > >keep

Re: [BDR] Question on compatibility of Postgres with Open JDK

2019-01-30 Thread Craig Ringer
On Wed, 30 Jan 2019 at 15:28, Pratheej Chandrika < pratheej.chandr...@motorolasolutions.com> wrote: > Criag, > Thanks a lot for the prompt reply. > > From what you mentioned, I assume that other the client side jdbc there > is no Java dependency from Server side. What I mean is I assume there is