Re: [HACKERS] postgres_fdw super user checks

2017-09-16 Thread Andreas Karlsson
On 09/14/2017 08:33 PM, Jeff Janes wrote:> Attached is a new patch which fixes the style issue you mentioned. Thanks, the patch looks good no,w and as far as I can tell there was no need to update the comments or the documentation so I am setting this as ready for committer. Andreas --

Re: [HACKERS] [PATCH]make pg_rewind to not copy useless WAL files

2017-09-16 Thread Michael Paquier
On Sun, Sep 17, 2017 at 3:19 AM, Alexander Korotkov wrote: > Hi! > > On Sat, Sep 16, 2017 at 5:56 PM, chenhj wrote: >> >> This patch optimizes the above mentioned issues, as follows: >> 1. In the target data directory, do not delete the WAL files

Re: [HACKERS] Add Roman numeral conversion to to_number

2017-09-16 Thread Douglas Doole
I finally figured out why docs weren't building on my machine so I was able to take a look at your doc patch too. I think it's fine. Reading it did suggest a couple extra negative tests to confirm that when 'rn' is specified, all other elements are ignored: select to_number('vii7', 'rn9');

Re: [HACKERS] Add Roman numeral conversion to to_number

2017-09-16 Thread Douglas Doole
Oliver, I took a look at your tests and they look thorough to me. One recommendation, instead of having 3999 separate selects to test every legal roman numeral, why not just do something like this: do $$ declare i int; rn text; rn_val int; begin for i in 1..3999 loop rn

[HACKERS] ICU locales and text/char(n) SortSupport on Windows

2017-09-16 Thread Peter Geoghegan
varstr_sortsupport() only allows Windows to use SortSupport with a non-C-locale (when the server encoding happens to be UTF-8, which I assume is the common case). This is because we (quite reasonably) don't want to have to duplicate the ugly UTF-8 to UTF-16 conversion hack from varstr_cmp() for

Re: [HACKERS] [PATCH] Generic type subscripting

2017-09-16 Thread Dmitry Dolgov
> On 17 September 2017 at 00:04, Arthur Zakirov wrote: > > In my opinion, 'DEPENDS ON' syntax is not actually appropriate here. It > also looks like a not very good hack to me. Hm...why do you think about it as a hack? > Moreover user can implement subscripting to its

Re: [HACKERS] [PATCH] Generic type subscripting

2017-09-16 Thread Arthur Zakirov
On Fri, Sep 15, 2017 at 10:02:00PM +0200, Dmitry Dolgov wrote: > > So, I've implemented a patch for that in form of a `DEPENDS ON` syntax for > creating a function. In my opinion, 'DEPENDS ON' syntax is not actually appropriate here. It also looks like a not very good hack to me. Moreover user

Re: [HACKERS] Pre-existing bug in trigger.c

2017-09-16 Thread Tom Lane
I wrote: > While fooling with the transition-tables bug, I noticed a problem > in trigger.c that has been there a very long time. > ... > I think possibly the best solution is to change the query_stack > data structure enough so that pre-existing entries don't get > moved during an enlargement.

Re: [HACKERS] Clarification in pg10's pgupgrade.html step 10 (upgrading standby servers)

2017-09-16 Thread Andreas Joseph Krogh
På lørdag 16. september 2017 kl. 18:34:51, skrev Bruce Momjian >: On Sat, Sep 16, 2017 at 06:11:17PM +0200, Andreas Joseph Krogh wrote: > I'm a little unsure what scenario we're trying to describe here. Copying the > pg_wal separately (for which

Re: [HACKERS] [GENERAL] Remove useless joins (VARCHAR vs TEXT)

2017-09-16 Thread David Rowley
On 17 September 2017 at 08:07, Kim Rose Carlsen wrote: > It seems there are some difference in VARCHAR vs TEXT when postgres tries to > decide if a LEFT JOIN is useful or not. I can't figure out if this is > intentional because there are some difference between TEXT and VARCHAR

Re: [HACKERS] valgrind vs. shared typmod registry

2017-09-16 Thread Thomas Munro
On Sun, Sep 17, 2017 at 7:42 AM, Thomas Munro wrote: > On Sun, Sep 17, 2017 at 12:30 AM, Tomas Vondra > wrote: >> I've been running some regression tests under valgrind, and it seems >> select_parallel triggers some uses of

Re: [HACKERS] Re: [COMMITTERS] pgsql: Perform only one ReadControlFile() during startup.

2017-09-16 Thread Andres Freund
On 2017-09-16 15:59:01 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2017-09-16 14:30:21 -0400, Tom Lane wrote: > >> I wonder whether we shouldn't just revert this patch altogether. > > > The problem is that the patch that makes the segment size configurable > > also

Re: [HACKERS] Re: [COMMITTERS] pgsql: Perform only one ReadControlFile() during startup.

2017-09-16 Thread Tom Lane
Andres Freund writes: > On 2017-09-16 14:30:21 -0400, Tom Lane wrote: >> I wonder whether we shouldn't just revert this patch altogether. > The problem is that the patch that makes the segment size configurable > also adds a bunch more ordering constraints due to the fact

Re: [HACKERS] valgrind vs. shared typmod registry

2017-09-16 Thread Peter Geoghegan
On Sat, Sep 16, 2017 at 5:30 AM, Tomas Vondra wrote: > I've been running tests under valgrind not too long ago and I don't > recall such failures, so perhaps something broke it in the past few days. That's what we have the buildfarm animal Skink for. It has indeed

Re: [HACKERS] valgrind vs. shared typmod registry

2017-09-16 Thread Thomas Munro
On Sun, Sep 17, 2017 at 12:30 AM, Tomas Vondra wrote: > I've been running some regression tests under valgrind, and it seems > select_parallel triggers some uses of uninitialized values in dshash. If > I'm reading the reports right, it complains about

Re: [HACKERS] Re: [COMMITTERS] pgsql: Perform only one ReadControlFile() during startup.

2017-09-16 Thread Andres Freund
On 2017-09-16 14:30:21 -0400, Tom Lane wrote: > Andres Freund writes: > > Looking into it. > > I wonder whether we shouldn't just revert this patch altogether. > Certainly, extra reads of pg_control are not a noticeable performance > problem. The problem is that the patch

Re: [HACKERS] Re: [COMMITTERS] pgsql: Perform only one ReadControlFile() during startup.

2017-09-16 Thread Tom Lane
Andres Freund writes: > Looking into it. I wonder whether we shouldn't just revert this patch altogether. Certainly, extra reads of pg_control are not a noticeable performance problem. I'm now quite worried about whether we aren't introducing hazards of using stale values

[HACKERS] Re: [COMMITTERS] pgsql: Perform only one ReadControlFile() during startup.

2017-09-16 Thread Andres Freund
Hi, On 2017-09-16 10:32:29 -0400, Tom Lane wrote: > It's dying at "pfree(localControlFile)". localControlFile seems to > be pointing at a region of memory that's entirely zeroes; certainly > the data that it just moved into shared memory is all zeroes. > It looks like someone didn't think hard

Re: [HACKERS] [PATCH]make pg_rewind to not copy useless WAL files

2017-09-16 Thread Alexander Korotkov
Hi! On Sat, Sep 16, 2017 at 5:56 PM, chenhj wrote: > This patch optimizes the above mentioned issues, as follows: > 1. In the target data directory, do not delete the WAL files before the > divergence. > 2. When copying files from the source server, do not copy the WAL files >

[HACKERS] Sync BEFORE STATEMENT trigger behavior with AFTER STATEMENT

2017-09-16 Thread Tom Lane
The just-committed patch 0f79440fb arranges to suppress extra firings of AFTER STATEMENT triggers that historically have occurred when several FK enforcement trigger firings affect the same target table. This leaves us in a situation where you may get more BEFORE STATEMENT trigger firings than

Re: [HACKERS] A design for amcheck heapam verification

2017-09-16 Thread Peter Geoghegan
On Wed, Sep 6, 2017 at 7:26 PM, Peter Geoghegan wrote: > On Wed, Aug 30, 2017 at 9:29 AM, Peter Geoghegan wrote: >> On Wed, Aug 30, 2017 at 5:02 AM, Alvaro Herrera >> wrote: >>> Eh, if you want to optimize it for the case where debug output

Re: [HACKERS] DROP SUBSCRIPTION hangs if sub is disabled in the same transaction

2017-09-16 Thread Masahiko Sawada
On Sat, Sep 16, 2017 at 9:52 PM, Peter Eisentraut wrote: > On 9/15/17 13:35, Arseny Sher wrote: >> Peter Eisentraut writes: >> >>> Here is a simple patch that fixes this, based on my original proposal >>> point #4. >> >> I

Re: [HACKERS] PoC plpgsql - possibility to force custom or generic plan

2017-09-16 Thread Bruce Momjian
On Wed, Sep 6, 2017 at 10:43:39AM -0400, Robert Haas wrote: > helps. I don't think we can just indefinitely continue to resist > providing manual control over this behavior on the theory that some > day we'll fix it. It's been six years and we haven't made any > significant progress. In some

Re: [HACKERS] Clarification in pg10's pgupgrade.html step 10 (upgrading standby servers)

2017-09-16 Thread Bruce Momjian
On Sat, Sep 16, 2017 at 06:11:17PM +0200, Andreas Joseph Krogh wrote: > I'm a little unsure what scenario we're trying to describe here. Copying the > pg_wal separately (for which there's no need optimizing for) is only needed if > you've moved it out of $PGDATA _after_ running pg_upgrade, IIUC.

Re: [HACKERS] Clarification in pg10's pgupgrade.html step 10 (upgrading standby servers)

2017-09-16 Thread Bruce Momjian
On Thu, Sep 14, 2017 at 03:12:50PM -0400, Bruce Momjian wrote: > I talked with Stephen about this on IM. The issue is that if you don't > do --delete, and there are files in the primary that are not in the > standby, they are copied, but files in the standby and not in the > primary are kept.

Re: [HACKERS] Clarification in pg10's pgupgrade.html step 10 (upgrading standby servers)

2017-09-16 Thread Andreas Joseph Krogh
På lørdag 16. september 2017 kl. 17:24:14, skrev Bruce Momjian >: On Fri, Sep 15, 2017 at 01:23:45AM +0200, Andreas Joseph Krogh wrote: > I tested upgrading from 9.6 to 10 now, using pg_upgrade, and pg_upgrade creates > the new data-dir with pg_wal

Re: [HACKERS] Clarification in pg10's pgupgrade.html step 10 (upgrading standby servers)

2017-09-16 Thread Bruce Momjian
On Fri, Sep 15, 2017 at 01:23:45AM +0200, Andreas Joseph Krogh wrote: > I tested upgrading from 9.6 to 10 now, using pg_upgrade, and pg_upgrade > creates > the new data-dir with pg_wal "in it" (just like regular initdb), so pg_upgrade > seems not to care about where the old version's pg_xlog was.

[HACKERS] [PATCH]make pg_rewind to not copy useless WAL files

2017-09-16 Thread chenhj
Hi all, Currently, pg_rewind copies all WAL files from the source server, whether or not they are needed. In some circumstances, will bring a lot of unnecessary network and disk IO consumption, and also increase the execution time of pg_rewind. Such as when wal_keep_segments or max_wal_size is

Re: [HACKERS] [COMMITTERS] pgsql: Perform only one ReadControlFile() during startup.

2017-09-16 Thread Tom Lane
Andres Freund writes: > Perform only one ReadControlFile() during startup. This patch or something closely related to it has broken the postmaster's ability to recover from a backend crash. For example, after exercising the backend crash Andreas just reported: regression=#

Re: [HACKERS] Variable substitution in psql backtick expansion

2017-09-16 Thread Gerdan Santos
The following review has been posted through the commitfest application: make installcheck-world: not tested Implements feature: not tested Spec compliant: not tested Documentation:tested, passed When i try apply this patch he failed with a following messenger: File

Re: [HACKERS] Setting pd_lower in GIN metapage

2017-09-16 Thread Michael Paquier
On Fri, Sep 15, 2017 at 4:22 PM, Amit Langote wrote: > On 2017/09/14 16:00, Michael Paquier wrote: >> On Wed, Sep 13, 2017 at 4:43 PM, Amit Langote >> wrote: >>> Sure, no problem. >> >> OK, I took a closer look at all patches, but did

Re: [HACKERS] psql: new help related to variables are not too readable

2017-09-16 Thread Pavel Stehule
2017-09-14 16:35 GMT+02:00 Pavel Stehule : > > > 2017-09-14 15:17 GMT+02:00 Alvaro Herrera : > >> Tom Lane wrote: >> > "David G. Johnston" writes: >> > >​If I was going to try and read it like a book I'd want the extra

Re: [HACKERS] DROP SUBSCRIPTION hangs if sub is disabled in the same transaction

2017-09-16 Thread Peter Eisentraut
On 9/15/17 13:35, Arseny Sher wrote: > Peter Eisentraut writes: > >> Here is a simple patch that fixes this, based on my original proposal >> point #4. > > I checked, it passes the tests and solves the problem. However, isn't > this > > + if

Re: [HACKERS] taking stdbool.h into use

2017-09-16 Thread Peter Eisentraut
On 9/14/17 22:35, Tom Lane wrote: > Peter Eisentraut writes: >> 0005-Make-casting-between-bool-and-GinTernaryValue-more-r.patch >> 0008-Use-stdbool.h-if-available.patch > >> These need some more work based on Tom's feedback. > >> Attached is a new patch set.

[HACKERS] valgrind vs. shared typmod registry

2017-09-16 Thread Tomas Vondra
Hi, I've been running some regression tests under valgrind, and it seems select_parallel triggers some uses of uninitialized values in dshash. If I'm reading the reports right, it complains about hashtable->size_log2 being not being initialized in ensure_valid_bucket_pointers. I've been running

Re: [HACKERS] additional contrib test suites

2017-09-16 Thread David Steele
On 9/15/17 6:52 PM, Michael Paquier wrote: > On Sat, Sep 16, 2017 at 5:15 AM, Tom Lane wrote: >> >> Noting that mandrill is showing yet a different failure, one that I think >> is inherent to chkpass: >> >> CREATE TABLE test (i int, p chkpass); >> INSERT INTO test VALUES

Re: [HACKERS] path toward faster partition pruning

2017-09-16 Thread Dilip Kumar
On Fri, Sep 15, 2017 at 2:20 PM, Amit Langote wrote: > On 2017/09/15 11:16, Amit Langote wrote: Thanks for the updated patch. I was going through the logic of get_rel_partitions in 0002 as almost similar functionality will be required by runtime partition pruning

Re: [HACKERS] Parallel Append implementation

2017-09-16 Thread Amit Kapila
On Thu, Sep 14, 2017 at 8:30 PM, Amit Khandekar wrote: > On 11 September 2017 at 18:55, Amit Kapila wrote: >>> >> >> How? See, if you have four partial subpaths and two non-partial >> subpaths, then for parallel-aware append it considers all six