RE: [Bug Fix]ECPG: cancellation of significant digits on ECPG

2018-11-07 Thread Higuchi, Daisuke
From: Dmitry Dolgov [mailto:9erthali...@gmail.com] >Also what's strange for me is that after applying your patches I still got the >same output, not sure why: Hmm... In my environment, the output was changed. I also updated regression test and cfbot.cputube.org reports no problem now. Do you us

Re: csv format for psql

2018-11-07 Thread Michael Paquier
On Tue, Nov 06, 2018 at 02:57:15PM +0100, Daniel Verite wrote: > Here's a rebased version following these changes. Thanks for doing a rebase. First, it seems to me that it is necessary to overcomplicate the interface of psql for that. Most of the other formats don't have their own switch, and it

RE: Performance improvements of INSERTs to a partitioned table

2018-11-07 Thread Kato, Sho
AFAIK, When CREATE INDEX on a partition and INSERT to a parent table are executed at the same time, this patch causes deadlock. * partitions information Partition key: RANGE (a) Partitions: a_1 FOR VALUES FROM (1) TO (100), a_2 FOR VALUES FROM (100) TO (200) T1: create index a_1_ix

Re: csv format for psql

2018-11-07 Thread Fabien COELHO
Bonjour Michaël, First, it seems to me that it is necessary to overcomplicate the interface of psql for that. Most of the other formats don't have their own switch, and it is perfectly possible to use CSV format with just --pset=format=csv. Although this work, it is not very user friendly no

Re: [Patch] pg_rewind: options to use restore_command from recovery.conf or command line

2018-11-07 Thread Alexey Kondratov
On 30.10.2018 06:01, Michael Paquier wrote: On Mon, Oct 29, 2018 at 12:09:21PM +0300, Alexey Kondratov wrote: Currently in the patch, with dry-run option (-n) pg_rewind only fetches missing WALs to be able to build file map, while doesn't touch any data files. So I guess it behaves exactly as y

Connection limit doesn't work for superuser

2018-11-07 Thread Evgeniy Efimkin
Connection limit doesn't work for superuser Hi hackers! It would be nice if ALTER USER ... WITH CONNECTION LIMIT will work for superuser. It would protect against connection leaks. e.g. we have two superusers, one of them reached connection limit but not max_connections, the other is still possi

Re: BUG #15449: file_fdw using program cause exit code error when using LIMIT

2018-11-07 Thread Etsuro Fujita
(2018/11/07 9:22), Kyotaro HORIGUCHI wrote: At Tue, 06 Nov 2018 21:07:37 +0900, Etsuro Fujita wrote in<5be18409.2070...@lab.ntt.co.jp> (2018/11/06 12:53), Kyotaro HORIGUCHI wrote: At Fri, 02 Nov 2018 22:05:36 +0900, Etsuro Fujita wrote in<5bdc4ba0.7050...@lab.ntt.co.jp> (2018/10/29 15:58),

RE: Issue with v11.0 within jsonb_plperl tests in 32bit on AIX

2018-11-07 Thread REIX, Tony
Hi Alvaro, Thanks for your help. Here is the regression.diffs file. About the root cause, I noticed that, for the 2nd error: < ERROR: cannot convert infinity to jsonb < CONTEXT: PL/Perl function "roundtrip" --- >

Re: Connection slots reserved for replication

2018-11-07 Thread Masahiko Sawada
On Tue, Nov 6, 2018 at 9:16 PM Kyotaro HORIGUCHI wrote: > > Hello. Thank you for the new version. > > At Thu, 1 Nov 2018 11:58:52 +0100, Alexander Kukushkin > wrote in > > Hi, > > > > Attached rebased version patch to the current HEAD and created commit fest > > entry > > On Fri, 21 Sep 2018 a

Re: Speeding up INSERTs and UPDATEs to partitioned tables

2018-11-07 Thread David Rowley
On 5 November 2018 at 20:17, Amit Langote wrote: > On 2018/11/04 19:07, David Rowley wrote: >> Perhaps a better design would be to instead of having random special >> partitioned-table-only fields in ResultRelInfo, just have an extra >> struct there that contains the extra partition information wh

Re: Connection limit doesn't work for superuser

2018-11-07 Thread Andrey Borodin
Hi! > 7 нояб. 2018 г., в 11:48, Evgeniy Efimkin написал(а): > It would be nice if ALTER USER ... WITH CONNECTION LIMIT will work for > superuser. It would protect against connection leaks. e.g. we have two > superusers, one of them reached connection limit but not max_connections, the > other

Re: pread() and pwrite()

2018-11-07 Thread Jesper Pedersen
Hi Thomas, On 11/6/18 4:04 PM, Thomas Munro wrote: On Wed, Nov 7, 2018 at 4:42 AM Jesper Pedersen Thanks! Pushed. I'll keep an eye on the build farm to see if anything breaks on Cygwin or some other frankenOS. There is [1] on Andres' skink setup. Looking. [1] https://buildfarm.postgresql.

Re: pread() and pwrite()

2018-11-07 Thread Andrew Dunstan
On 11/7/18 7:26 AM, Jesper Pedersen wrote: Hi Thomas, On 11/6/18 4:04 PM, Thomas Munro wrote: On Wed, Nov 7, 2018 at 4:42 AM Jesper Pedersen Thanks!  Pushed.  I'll keep an eye on the build farm to see if anything breaks on Cygwin or some other frankenOS. There is [1] on Andres' skink setup

Re: plruby: rb_iterate symbol clash with libruby.so

2018-11-07 Thread Pavel Raiskup
On Tuesday, November 6, 2018 7:28:21 PM CET Tom Lane wrote: > I wrote: > > Yeah. The long and short of this is that we're trampling on namespace > > that reasonably belongs to Ruby --- if they had some functions named > > "pg_something" and complained about a collision with libpq, would we > > cha

valgrind on initdb

2018-11-07 Thread Jesper Pedersen
Hi, While looking at [1] (included in 23315.log) there are other warnings as well. I ran with valgrind --leak-check=full --show-leak-kinds=all --gen-suppressions=all --suppressions=/path/to/postgresql/src/tools/valgrind.supp --time-stamp=yes --log-file=/tmp/valgrind/%p.log --trace-children=

Re: Support custom socket directory in pg_upgrade

2018-11-07 Thread Daniel Gustafsson
> On 6 Nov 2018, at 09:19, Thomas Munro wrote: > > On Wed, Oct 10, 2018 at 9:27 AM Daniel Gustafsson > wrote: >>> On 9 Oct 2018, at 16:22, Tom Lane wrote: >>> Daniel Gustafsson writes: Having hit the maximum socketdir length error a number of times in pg_upgr

Re: fix psql \conninfo & \connect when using hostaddr

2018-11-07 Thread Pavel Stehule
Hi pá 26. 10. 2018 v 15:55 odesílatel Fabien COELHO napsal: > > Hello, > > This is a follow-up to another patch I posted about libpq confusing > documentation & psql resulting behavior under host/hostaddr settings. > > Although the first mostly documentation patch did not gather much > enthousia

Re: valgrind on initdb

2018-11-07 Thread Jesper Pedersen
On 11/7/18 8:08 AM, Jesper Pedersen wrote: While looking at [1] (included in 23315.log) there are other warnings as well. On 77366d90. Best regards,  Jesper

Re: Support custom socket directory in pg_upgrade

2018-11-07 Thread Daniel Gustafsson
> On 7 Nov 2018, at 08:23, Peter Eisentraut > wrote: > > On 09/10/2018 15:09, Daniel Gustafsson wrote: >> Having hit the maximum socketdir length error a number of times in >> pg_upgrade, >> especially when running tests in a deep directory hierarchy, I figured it was >> time to see if anyone e

Re: valgrind on initdb

2018-11-07 Thread John Naylor
On 11/7/18, Jesper Pedersen wrote: > Hi, > > While looking at [1] (included in 23315.log) there are other warnings as > well. Perhaps it's worth revisiting to make debugging easier, but right now initdb.c has this comment: * Note: * The program has some memory leakage - it isn't worth cl

Re: Connection limit doesn't work for superuser

2018-11-07 Thread Robert Haas
On Wed, Nov 7, 2018 at 7:20 AM Andrey Borodin wrote: > >These clauses determine whether the new role is a “superuser”, who can > >override all access restrictions within the database. > Do we consider connection limit "access restriction"? Superuser can avoid > setting his connection limit if he

Re: ATTACH/DETACH PARTITION CONCURRENTLY

2018-11-07 Thread Robert Haas
On Tue, Nov 6, 2018 at 10:18 PM Alvaro Herrera wrote: > > > Throw tuples destined for that partition away? > > Surely not. (/me doesn't beat straw men anyway.) > > Hmm, apparently this can indeed happen with my patch :-( D'oh. This is a hard problem, especially the part of it that involves hand

Fedora 29 vs linux collation tests

2018-11-07 Thread Andrew Dunstan
Yesterday I did a long overdue upgrade to the machine that runs buildfarm animal crake. After some hiccups it's all working, except for the linux utf8 collation tests. See where you can see this:

Re: pread() and pwrite()

2018-11-07 Thread Jesper Pedersen
Hi, On 11/7/18 7:26 AM, Jesper Pedersen wrote: On 11/6/18 4:04 PM, Thomas Munro wrote: On Wed, Nov 7, 2018 at 4:42 AM Jesper Pedersen Thanks!  Pushed.  I'll keep an eye on the build farm to see if anything breaks on Cygwin or some other frankenOS. There is [1] on Andres' skink setup. Looking

Re: valgrind on initdb

2018-11-07 Thread Tomas Vondra
On 11/7/18 2:47 PM, John Naylor wrote: > On 11/7/18, Jesper Pedersen wrote: >> Hi, >> >> While looking at [1] (included in 23315.log) there are other warnings as >> well. > > Perhaps it's worth revisiting to make debugging easier, but right now > initdb.c has this comment: > > * Note: > *

Re: fix psql \conninfo & \connect when using hostaddr

2018-11-07 Thread Arthur Zakirov
Hello all, On 07.11.2018 16:23, Pavel Stehule wrote: pá 26. 10. 2018 v 15:55 odesílatel Fabien COELHO > napsal: > > This is a follow-up to another patch I posted about libpq confusing > documentation & psql resulting behavior under host/hostaddr settings. >

Re: plruby: rb_iterate symbol clash with libruby.so

2018-11-07 Thread Tom Lane
Pavel Raiskup writes: > On Tuesday, November 6, 2018 7:28:21 PM CET Tom Lane wrote: >> Done. I realized that the immediate problem, rb_iterate(), was only >> added as of PG v10, which may explain why we hadn't heard complaints >> about this till now. So I've made the change only as far back as v

Re: pread() and pwrite()

2018-11-07 Thread Tom Lane
Andrew Dunstan writes: > On 11/7/18 7:26 AM, Jesper Pedersen wrote: >> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=skink&dt=2018-11-07%2001%3A01%3A01 > And lousyjack, which uses a slightly different way of calling valgrind, > and thus got past initdb, found a bunch more: >

Re: valgrind on initdb

2018-11-07 Thread Andrew Dunstan
On 11/7/18 9:11 AM, Tomas Vondra wrote: On 11/7/18 2:47 PM, John Naylor wrote: On 11/7/18, Jesper Pedersen wrote: Hi, While looking at [1] (included in 23315.log) there are other warnings as well. Perhaps it's worth revisiting to make debugging easier, but right now initdb.c has this comm

Re: Connection limit doesn't work for superuser

2018-11-07 Thread Tom Lane
Robert Haas writes: > I don't think we should consider something that prevents you from > connecting to the database to be in the same category as something > that limits what you can do once you are connected. IOW, +1 to the > original proposal from me. I'd vote against. I think there are way

Re: Connection limit doesn't work for superuser

2018-11-07 Thread Dmitriy Sarafannikov
What about LOGIN option? It is a similar access restriction, but it works for superuser. =# create role nologin_role superuser nologin unencrypted password '1234'; CREATE ROLE Time: 1.230 ms ~ $ psql postgres -U nologin_role -h localhost Password for user nologin_role: psql: FATAL: role "nologin

Re: pread() and pwrite()

2018-11-07 Thread Andrew Dunstan
On 11/7/18 9:30 AM, Tom Lane wrote: Andrew Dunstan writes: On 11/7/18 7:26 AM, Jesper Pedersen wrote: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=skink&dt=2018-11-07%2001%3A01%3A01 And lousyjack, which uses a slightly different way of calling valgrind, and thus got past initdb,

Re: move PartitionBoundInfo creation code

2018-11-07 Thread Alvaro Herrera
On 2018-Nov-07, Michael Paquier wrote: > On Wed, Nov 07, 2018 at 03:34:38PM +0900, Amit Langote wrote: > > On 2018/11/05 16:21, Michael Paquier wrote: > >> On Thu, Nov 01, 2018 at 01:03:00PM +0900, Amit Langote wrote: > >>> Done a few moments ago. :) > >> > >> From the file size this move is actu

Re: pread() and pwrite()

2018-11-07 Thread Jesper Pedersen
Hi Tom, On 11/7/18 9:30 AM, Tom Lane wrote: I'm confused by this. Surely the pwrite-based code is writing exactly the same data as before. Do we have to conclude that valgrind is complaining about passing uninitialized data to pwrite() when it did not complain about exactly the same thing for

Re: [HACKERS] [PATCH] Generic type subscripting

2018-11-07 Thread Dmitry Dolgov
> On Fri, 12 Oct 2018 at 07:52, Pavel Stehule wrote: > >> > postgres=# insert into test(v) values( '[]'); >> > INSERT 0 1 >> > postgres=# update test set v[1000] = 'a'; >> > UPDATE 1 >> > postgres=# update test set v[1000] = 'a'; >> > UPDATE 1 >> > postgres=# update test set v[1000] = 'a'; >> > UP

Re: pread() and pwrite()

2018-11-07 Thread Andrew Dunstan
On 11/7/18 10:05 AM, Jesper Pedersen wrote: Hi Tom, On 11/7/18 9:30 AM, Tom Lane wrote: I'm confused by this.  Surely the pwrite-based code is writing exactly the same data as before.  Do we have to conclude that valgrind is complaining about passing uninitialized data to pwrite() when it d

Re: plruby: rb_iterate symbol clash with libruby.so

2018-11-07 Thread Pavel Raiskup
On Wednesday, November 7, 2018 3:25:31 PM CET Tom Lane wrote: > Pavel Raiskup writes: > > On Tuesday, November 6, 2018 7:28:21 PM CET Tom Lane wrote: > >> Done. I realized that the immediate problem, rb_iterate(), was only > >> added as of PG v10, which may explain why we hadn't heard complaints

Re: partitioned indexes and tablespaces

2018-11-07 Thread Alvaro Herrera
On 2018-Nov-04, Michael Paquier wrote: > On Sat, Nov 03, 2018 at 12:30:15PM -0700, Andres Freund wrote: > > On 2018-11-03 16:24:28 -0300, Alvaro Herrera wrote: > >> On 2018-Nov-03, Robert Haas wrote: > >>> Well, you've guaranteed that already. Now 11 will be different from > >>> 11.1, and tables

Re: plruby: rb_iterate symbol clash with libruby.so

2018-11-07 Thread Tom Lane
Pavel Raiskup writes: > On Wednesday, November 7, 2018 3:25:31 PM CET Tom Lane wrote: >> Yeah, I'm now mighty confused about this as well. PL/Ruby is pretty old >> too, so how come nobody noticed this before? Is its rb_iterate call in >> someplace that hardly gets any use? > ... I reproduced th

Re: ATTACH/DETACH PARTITION CONCURRENTLY

2018-11-07 Thread Robert Haas
On Tue, Nov 6, 2018 at 5:09 PM Robert Haas wrote: > - get_partition_dispatch_recurse and ExecCreatePartitionPruneState > both call RelationGetPartitionDesc. Presumably, this means that if > the partition descriptor gets updated on the fly, the tuple routing > and partition dispatch code could end

Re: [HACKERS] [PATCH] Generic type subscripting

2018-11-07 Thread Pavel Stehule
st 7. 11. 2018 v 16:25 odesílatel Dmitry Dolgov <9erthali...@gmail.com> napsal: > > On Fri, 12 Oct 2018 at 07:52, Pavel Stehule > wrote: > > > >> > postgres=# insert into test(v) values( '[]'); > >> > INSERT 0 1 > >> > postgres=# update test set v[1000] = 'a'; > >> > UPDATE 1 > >> > postgres=# up

Re: Connection limit doesn't work for superuser

2018-11-07 Thread Robert Haas
On Wed, Nov 7, 2018 at 9:45 AM Tom Lane wrote: > Robert Haas writes: > > I don't think we should consider something that prevents you from > > connecting to the database to be in the same category as something > > that limits what you can do once you are connected. IOW, +1 to the > > original pr

Re: plruby: rb_iterate symbol clash with libruby.so

2018-11-07 Thread Pavel Raiskup
On Wednesday, November 7, 2018 4:55:13 PM CET Tom Lane wrote: > Pavel Raiskup writes: > > On Wednesday, November 7, 2018 3:25:31 PM CET Tom Lane wrote: > >> Yeah, I'm now mighty confused about this as well. PL/Ruby is pretty old > >> too, so how come nobody noticed this before? Is its rb_iterate

Re: First-draft release notes for back-branch releases

2018-11-07 Thread Jonathan S. Katz
On 11/7/18 1:59 AM, Amit Langote wrote: > * Ensure that automatically created child indexes are created in the same Thanks, that is much clearer. I have made that update. Thanks again for your help! Jonathan 2018-11-08 Cumulative Update The PostgreSQL Global Develop

Re: Connection limit doesn't work for superuser

2018-11-07 Thread Tom Lane
Robert Haas writes: > On Wed, Nov 7, 2018 at 9:45 AM Tom Lane wrote: >> I'd vote against. I think there are way more cases where this would >> create a problem than where it would fix one. > Like what? alter user postgres connection limit 0; ... oops ... I'm not buying the argument that ther

Re: partitioned indexes and tablespaces

2018-11-07 Thread Robert Haas
On Wed, Nov 7, 2018 at 10:46 AM Alvaro Herrera wrote: > I think 11.0 is ready for testing that a migration from a production > running 10.x, but not for just blindly migrating. If you wanted to take > such a leap of faith, surely you'd wait for 11.1 at the very least. I think that's an irrespons

Re: Connection limit doesn't work for superuser

2018-11-07 Thread Robert Haas
On Wed, Nov 7, 2018 at 11:19 AM Tom Lane wrote: > > Like what? > > alter user postgres connection limit 0; > > ... oops ... Sure. If you have no other superusers that's going to be sad. Hopefully single-user mode lets you recover, though. And, anyway, there are plenty of ways for a superuser to

Re: Connection limit doesn't work for superuser

2018-11-07 Thread Tomas Vondra
On 11/7/18 5:19 PM, Tom Lane wrote: > > ... > > I think this proposal boils down to asking for support for an > incredibly bad application design, and equipping every database with > an additional foot-gun in order to have that. > I'm not sure about that. IMHO being able to restrict the number

Re: Fedora 29 vs linux collation tests

2018-11-07 Thread Andrew Dunstan
On 11/7/18 9:01 AM, Andrew Dunstan wrote: Yesterday I did a long overdue upgrade to the machine that runs buildfarm animal crake. After some hiccups it's all working, except for the linux utf8 collation tests. See

Re: csv format for psql

2018-11-07 Thread Daniel Verite
Michael Paquier wrote: > -C could also be useful for other things, say compression. The patch does not grab any short letter, as the consensus went that way. > + pset.popt.topt.fieldSepCsv = pg_strdup(","); > Let's store that in a variable instead of hardcoding it. I guess it could go

Re: partitioned indexes and tablespaces

2018-11-07 Thread Andres Freund
On 2018-11-07 11:19:53 -0500, Robert Haas wrote: > On Wed, Nov 7, 2018 at 10:46 AM Alvaro Herrera > wrote: > > I think 11.0 is ready for testing that a migration from a production > > running 10.x, but not for just blindly migrating. If you wanted to take > > such a leap of faith, surely you'd w

Re: Connection limit doesn't work for superuser

2018-11-07 Thread David G. Johnston
On Wed, Nov 7, 2018 at 9:22 AM Robert Haas wrote: > > On Wed, Nov 7, 2018 at 11:19 AM Tom Lane wrote: > > I'm not buying the argument that there are realistic use-cases where > > you need a connection limit on a superuser role, either. Whatever > > you're doing that might merit a connection limi

Re: valgrind on initdb

2018-11-07 Thread Andres Freund
On 2018-11-07 09:37:37 -0500, Andrew Dunstan wrote: > > On 11/7/18 9:11 AM, Tomas Vondra wrote: > > > > On 11/7/18 2:47 PM, John Naylor wrote: > > > On 11/7/18, Jesper Pedersen wrote: > > > > Hi, > > > > > > > > While looking at [1] (included in 23315.log) there are other warnings as > > > > we

Re: fix psql \conninfo & \connect when using hostaddr

2018-11-07 Thread Pavel Stehule
st 7. 11. 2018 v 15:11 odesílatel Arthur Zakirov napsal: > Hello all, > > On 07.11.2018 16:23, Pavel Stehule wrote: > > pá 26. 10. 2018 v 15:55 odesílatel Fabien COELHO > > napsal: > > > > > > This is a follow-up to another patch I posted about libpq confusing > >

Re: Calculate total_table_pages after set_base_rel_sizes()

2018-11-07 Thread Tom Lane
David Rowley writes: > [ v2-0001-Calculate-total_table_pages-after-set_base_rel_si.patch ] Pushed with cosmetic adjustments. The reason it's okay to not check for appendrels in this loop is now quite different from the reason it was okay before, so I didn't like the fact that you'd just cut-and-

Re: file cloning in pg_upgrade and CREATE DATABASE

2018-11-07 Thread Peter Eisentraut
On 19/10/2018 01:50, Michael Paquier wrote: > On Thu, Oct 18, 2018 at 11:59:00PM +0200, Peter Eisentraut wrote: >> New patch that removes all the various reflink modes and adds a new >> option --clone that works similar to --link. I think it's much cleaner now. > > Thanks Peter for the new versio

Does slot_deform_tuple need to care about dropped columns?

2018-11-07 Thread Andres Freund
Hi, Currently functions like slot_getattr() first check if the attribute is already deformed: Datum slot_getattr(TupleTableSlot *slot, int attnum, bool *isnull) { ... /* * fast path if desired attribute already cached */ if (attnum <= slot->tts_nvalid) {

Re: ATTACH/DETACH PARTITION CONCURRENTLY

2018-11-07 Thread Alvaro Herrera
On 2018-Nov-06, Robert Haas wrote: > - get_partition_dispatch_recurse and ExecCreatePartitionPruneState > both call RelationGetPartitionDesc. My patch deals with this by caching descriptors in the active snapshot. So those two things would get the same partition descriptor. There's no RelationGe

Re: Does slot_deform_tuple need to care about dropped columns?

2018-11-07 Thread Tom Lane
Andres Freund writes: > ... in the case the attribute isn't already deformed, the > following hunk exists: > /* >* If the attribute's column has been dropped, we force a NULL result. >* This case should not happen in normal use, but it could happen if we >* are execu

Re: file cloning in pg_upgrade and CREATE DATABASE

2018-11-07 Thread Tom Lane
Peter Eisentraut writes: > Committed, thanks. It seems unfortunate that there is no test coverage in the committed patch. I realize that it may be hard to test given the filesystem dependency, but how will we know if it works at all? regards, tom lane

Re: Connection limit doesn't work for superuser

2018-11-07 Thread Tom Lane
"David G. Johnston" writes: > On the accept side, which I'm leaning toward, is that superuser is > already constrained by max_connections and, in addition, the > implications of setting this value are straight-forward and it obvious > requires intent on the part of the user. Its not a "foot-gun"

Re: partitioned indexes and tablespaces

2018-11-07 Thread Alvaro Herrera
On 2018-Nov-07, Robert Haas wrote: > On Wed, Nov 7, 2018 at 10:46 AM Alvaro Herrera > wrote: > > I think 11.0 is ready for testing that a migration from a production > > running 10.x, but not for just blindly migrating. If you wanted to take > > such a leap of faith, surely you'd wait for 11.1

Re: [HACKERS] [PATCH] Generic type subscripting

2018-11-07 Thread Dmitry Dolgov
> On Wed, 7 Nov 2018 at 17:09, Pavel Stehule wrote: > > I don't agree. If we use a same syntax for some objects types, we should to > enforce some consistency. Just to make it clear, consistency between what? > I don't think so you should to introduce nulls for JSONs. In this case, the > most

Re: ATTACH/DETACH PARTITION CONCURRENTLY

2018-11-07 Thread Robert Haas
On Wed, Nov 7, 2018 at 12:58 PM Alvaro Herrera wrote: > On 2018-Nov-06, Robert Haas wrote: > > - get_partition_dispatch_recurse and ExecCreatePartitionPruneState > > both call RelationGetPartitionDesc. > > My patch deals with this by caching descriptors in the active snapshot. > So those two thing

Re: partitioned indexes and tablespaces

2018-11-07 Thread Robert Haas
On Wed, Nov 7, 2018 at 1:22 PM Alvaro Herrera wrote: > > But maybe you've adopted that policy already. You back-patched a > > behavior change 2 days before a minor release when the vote was 2-3 > > against the change. > > It was? This is my count: > For: Alvaro, Andrew, Tom > Against: Michael, R

Re: Connection limit doesn't work for superuser

2018-11-07 Thread Robert Haas
On Wed, Nov 7, 2018 at 1:14 PM Tom Lane wrote: > I think that having superusers be immune to datconnlimit is actually > the right thing; for one reason, because datconnlimit can be set by > database owners, who should not be able to lock superusers out of > their database. Yeah, that's a reasonab

Re: Connection limit doesn't work for superuser

2018-11-07 Thread Joshua D. Drake
On 11/7/18 10:49 AM, Robert Haas wrote: On Wed, Nov 7, 2018 at 1:14 PM Tom Lane wrote: I think that having superusers be immune to datconnlimit is actually the right thing; for one reason, because datconnlimit can be set by database owners, who should not be able to lock superusers out of their

Re: [HACKERS] Surjective functional indexes

2018-11-07 Thread Tom Lane
Robert Haas writes: > On Fri, May 11, 2018 at 11:01 AM, Simon Riggs wrote: I have no problem if you want to replace this with an even better design in a later release. >>> Meh. The author / committer should get a patch into the right shape >> They have done, at length. Claiming otherw

Re: partitioned indexes and tablespaces

2018-11-07 Thread Tomas Vondra
On 11/7/18 7:41 PM, Robert Haas wrote: > On Wed, Nov 7, 2018 at 1:22 PM Alvaro Herrera > wrote: >>> But maybe you've adopted that policy already. You back-patched a >>> behavior change 2 days before a minor release when the vote was 2-3 >>> against the change. >> >> It was? This is my count:

Re: Speeding up INSERTs and UPDATEs to partitioned tables

2018-11-07 Thread Jesper Pedersen
Hi David, On 11/7/18 6:46 AM, David Rowley wrote: I've attached a patch which does this. It adds a new struct named PartitionRoutingInfo into ResultRelInfo and pulls 3 of the 4 arrays out of PartitionTupleRouting. There are fields for each of what these arrays used to store inside the Partition

Re: partitioned indexes and tablespaces

2018-11-07 Thread Robert Haas
On Wed, Nov 7, 2018 at 2:33 PM Tomas Vondra wrote: > FWIW, it was mentioned that "your only concurring vote came from someone > with whom you share an employer" which kind suggests opinions/votes from > people working for the same company are somehow less honest/valuable. I > find that annoying an

Re: Connections hang indefinitely while taking a gin index's LWLock buffer_content lock

2018-11-07 Thread Peter Geoghegan
On Tue, Nov 6, 2018 at 10:05 AM chenhj wrote: > I analyzed the btree block where lwlock deadlock occurred, as follows: Thank you for doing this important work. You're using Postgres 10.2. While that version isn't current with all GIN bug fixes, it does have this important one: "Ensure that vac

Re: PostgreSQL Limits and lack of documentation about them.

2018-11-07 Thread Robert Haas
On Tue, Nov 6, 2018 at 6:01 AM John Naylor wrote: > On 11/1/18, David Rowley wrote: > > I've attached an updated patch, again it's just intended as an aid for > > discussions at this stage. Also included the rendered html. > > Looks good so far. Based on experimentation with toasted columns, it >

Re: fix psql \conninfo & \connect when using hostaddr

2018-11-07 Thread Robert Haas
On Fri, Oct 26, 2018 at 9:54 AM Fabien COELHO wrote: > About updating psql's behavior, without this patch: > >sh> psql "host=foo hostaddr=127.0.0.1" > >psql> \conninfo >You are connected to database "fabien" as user "fabien" on host "foo" at > port "5432". > # NOPE, I'm really con

Re: Calculate total_table_pages after set_base_rel_sizes()

2018-11-07 Thread David Rowley
On 8 November 2018 at 06:17, Tom Lane wrote: > Pushed with cosmetic adjustments. Thanks for adjusting and pushing. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

Re: Tid scan improvements

2018-11-07 Thread Edmund Horner
On Tue, 6 Nov 2018 at 16:52, Alvaro Herrera wrote: > On 2018-Nov-06, David Rowley wrote: > > 14. we pass 'false' to what? > > > > + * save the tuple and the buffer returned to us by the access methods in > > + * our scan tuple slot and return the slot. Note: we pass 'false' because > > + * tuples

Re: pread() and pwrite()

2018-11-07 Thread Thomas Munro
On Thu, Nov 8, 2018 at 4:27 AM Andrew Dunstan wrote: > On 11/7/18 10:05 AM, Jesper Pedersen wrote: > > On 11/7/18 9:30 AM, Tom Lane wrote: > >> I'm confused by this. Surely the pwrite-based code is writing > >> exactly the > >> same data as before. Do we have to conclude that valgrind is > >> co

Re: Connections hang indefinitely while taking a gin index's LWLock buffer_content lock

2018-11-07 Thread Peter Geoghegan
On Mon, Oct 29, 2018 at 12:04 PM chenhj wrote: > #4 0x007095ac in LWLockAcquire (lock=0x2aaab4009564, > mode=LW_EXCLUSIVE) at lwlock.c:1233 > #5 0x00490a32 in ginStepRight (buffer=6713826, index= out>, lockmode=lockmode@entry=2) at ginbtree.c:174 > #6 0x0049

Should new partitions inherit their tablespace from their parent?

2018-11-07 Thread David Rowley
Dear Hackers, I've just read the thread in [1] where there was a discussion on a bug fix regarding index partitions not being created in the same tablespace as the partitioned index was created. One paragraph that stood out when reading the thread was: On 8 November 2018 at 09:00, Robert Haas w

Re: ATTACH/DETACH PARTITION CONCURRENTLY

2018-11-07 Thread David Rowley
On 8 November 2018 at 05:05, Robert Haas wrote: > That seems OK at present, because no new partitions can have appeared > since ExecSetupPartitionTupleRouting() acquired locks. But if we > allow new partitions to be added with only ShareUpdateExclusiveLock, > then I think there would be a problem

Inadequate executor locking of indexes

2018-11-07 Thread Tom Lane
I discovered that it's possible to trigger relation_open's new assertion about having a lock on the relation by the simple expedient of running the core regression tests with plan_cache_mode = force_generic_plan. (This doesn't give me a terribly warm feeling about how thoroughly we've exercised the

RE: Small performance tweak to run-time partition pruning

2018-11-07 Thread Imai, Yoshikazu
On Mon, Oct 22, 2018 at 8:31 PM, David Rowley wrote: > On 18 October 2018 at 16:13, Imai, Yoshikazu > wrote: > > The patch improves the performance about 1.3% which is less than > > David's result, but it seems still improves the performance. > > Thanks for doing these benchmarks. > > The speedu

Re: Connections hang indefinitely while taking a gin index's LWLock buffer_content lock

2018-11-07 Thread Peter Geoghegan
On Mon, Oct 29, 2018 at 12:04 PM chenhj wrote: > ## stack of autovacuum:Acquire lock 0x2aaab670dfe4 and hold 0x2aaab4009564 > -- > (gdb) bt > #0 0x7fe11552379b in do_futex_wait.constprop.1 () from > /lib64/libpthread.so.0 > #1 0x7fe1155238

Re: Connections hang indefinitely while taking a gin index's LWLock buffer_content lock

2018-11-07 Thread Peter Geoghegan
On Wed, Nov 7, 2018 at 5:46 PM Peter Geoghegan wrote: > I think that you have to be doing a multi-level delete for a deadlock > to take place, which isn't particularly likely to coincide with a > concurrent insertion in general. That may explain why it's taken a > year to get a high-quality bug re

Re: BUG #15449: file_fdw using program cause exit code error when using LIMIT

2018-11-07 Thread Thomas Munro
On Wed, Nov 7, 2018 at 11:03 PM Etsuro Fujita wrote: > (2018/11/07 9:22), Kyotaro HORIGUCHI wrote: > > At Tue, 06 Nov 2018 21:07:37 +0900, Etsuro > > Fujita wrote > > in<5be18409.2070...@lab.ntt.co.jp> > >> (2018/11/06 12:53), Kyotaro HORIGUCHI wrote: > >>> even if it comes from another pipe, w

Re: jsonpath

2018-11-07 Thread Tomas Vondra
On 11/6/18 4:48 PM, Tomas Vondra wrote: > On 11/6/18 3:31 PM, Nikita Glukhov wrote: >> On 29.10.2018 2:20, Tomas Vondra wrote:> >> >> ... >>> >>> 9) It's generally a good idea to make the individual pieces committable >>> separately, but that means e.g. the regression tests have to pass after >>>

Re: jsonpath

2018-11-07 Thread Tomas Vondra
BTW is the v19 really just a rebase of the preceding version? I'm asking because v18 was adding two types into pg_type.dat, namely jsonpath (6050) and _jsonpath (6051), while v19 only adds jsonpath (6050). I've noticed because v18 was missing a comma between the two entries, which I'd say is a bug

Re: ATTACH/DETACH PARTITION CONCURRENTLY

2018-11-07 Thread Robert Haas
On Wed, Nov 7, 2018 at 7:06 PM David Rowley wrote: > While the find_all_inheritors() call is something I'd like to see > gone, I assume it was done that way since an UPDATE might route a > tuple to a partition that there is no subplan for and due to INSERT > with VALUES not having any RangeTblEntr

Re: ATTACH/DETACH PARTITION CONCURRENTLY

2018-11-07 Thread David Rowley
On 8 November 2018 at 15:01, Robert Haas wrote: > Honestly, I *think* that the reason that find_all_inheritors() call is > there is because I had the idea that it was important to try to lock > partition hierarchies in the same order in all cases so as to avoid > spurious deadlocks. However, I do

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

2018-11-07 Thread Thomas Munro
On Fri, Oct 19, 2018 at 6:42 PM Craig Ringer wrote: > On Fri, 19 Oct 2018 at 07:27, Thomas Munro > wrote: >> 2. I am +1 on back-patching Craig's PANIC-on-failure logic. Doing >> nothing is not an option I like. I have some feedback and changes to >> propose though; see attached. > > Thanks ve

Re: Should new partitions inherit their tablespace from their parent?

2018-11-07 Thread Michael Paquier
On Thu, Nov 08, 2018 at 12:50:40PM +1300, David Rowley wrote: > How about we record the tablespace option for the partitioned table in > reltablespace instead of saving it as 0. Newly created partitions > which don't have a TABLESPACE mentioned in the CREATE TABLE command > should be created in th

Re: move PartitionBoundInfo creation code

2018-11-07 Thread Michael Paquier
On Wed, Nov 07, 2018 at 12:04:27PM -0300, Alvaro Herrera wrote: > On 2018-Nov-07, Michael Paquier wrote: > This is interesting. I don't think the current interface is so bad that > we can't make a few tweaks later; IOW let's focus on the current patch > for now, and we can improve later. You (and

Re: POC: Cleaning up orphaned files using undo logs

2018-11-07 Thread Thomas Munro
On Tue, Nov 6, 2018 at 12:42 AM Kuntal Ghosh wrote: > On Thu, Nov 1, 2018 at 8:53 AM Thomas Munro > wrote: > > It passes make check on Unix and Windows, though currently it's > > failing some of the TAP tests for reasons I'm looking into (possibly > > due to bugs in the lower level patches, not s

Re: PostgreSQL Limits and lack of documentation about them.

2018-11-07 Thread David Rowley
On 8 November 2018 at 10:02, Robert Haas wrote: > IMHO, documenting that you can get up to 1600 integer columns but only > 1002 bigint columns doesn't really help anybody, because nobody has a > table with only one type of column, and people usually want to have > some latitude to run ALTER TABLE

Re: move PartitionBoundInfo creation code

2018-11-07 Thread Amit Langote
On 2018/11/08 11:48, Michael Paquier wrote: >>> Thinking crazy, we could also create a subfolder partitioning/bounds/ >>> which includes three files with this refactoring:x >>> - range.c >>> - values.c >>> - hash.c >>> Then we keep partbounds.c which is the entry point used by partcache.c, >>> and

Re: ATTACH/DETACH PARTITION CONCURRENTLY

2018-11-07 Thread Amit Langote
On 2018/11/08 11:01, Robert Haas wrote: > On Wed, Nov 7, 2018 at 7:06 PM David Rowley > wrote: >> While the find_all_inheritors() call is something I'd like to see >> gone, I assume it was done that way since an UPDATE might route a >> tuple to a partition that there is no subplan for and due to I

Re: move PartitionBoundInfo creation code

2018-11-07 Thread Amit Langote
On 2018/11/08 0:04, Alvaro Herrera wrote: >> On Wed, Nov 07, 2018 at 03:34:38PM +0900, Amit Langote wrote: >>> I think we can design the interface of partition_bounds_create such that >>> it returns information needed to re-arrange OIDs to be in the canonical >>> partition bound order, so the actua

Adding a TAP test checking data consistency on standby with minRecoveryPoint

2018-11-07 Thread Michael Paquier
Hi all, While working on a fix for c186ba13 which fixes the way minRecoveryPoint is updated for other processes than the startup process, I was struggling about being able to get that into a reproducible test case. I have been thinking what Andrew Gierth has mentioned yesterday, and roughly desig

Re: file cloning in pg_upgrade and CREATE DATABASE

2018-11-07 Thread Michael Paquier
On Wed, Nov 07, 2018 at 06:42:00PM +0100, Peter Eisentraut wrote: > -n is often used for something like "dry run", so it didn't go for that > here. I suspect the cloning will remain a marginal option for some > time, so having only a long option is acceptable. Good point. I didn't consider this,

Re: csv format for psql

2018-11-07 Thread Michael Paquier
On Wed, Nov 07, 2018 at 05:36:54PM +0100, Daniel Verite wrote: > I guess it could go into a #define in psql/settings.h, along with > these: > #define DEFAULT_FIELD_SEP "|" > #define DEFAULT_RECORD_SEP "\n" Yes. > Yes, since we support column names with embedded newlines (even > though it's hard t

  1   2   >