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

2018-11-08 Thread Thomas Munro
On Fri, Nov 9, 2018 at 6:39 PM Kyotaro HORIGUCHI wrote: > Mmm..I didn't get an error at hand on both CentOS7 and High Sierra. > > | $ perl -e 'for (my $i=0; $i< 100; $i++) { print "$i\n"; }' | head -5 > ... > | 4 > | $ echo $? > | 0 That's the exit code from head. You can see python or perl'

Re: csv format for psql

2018-11-08 Thread Pavel Stehule
pá 9. 11. 2018 v 6:57 odesílatel Michael Paquier napsal: > On Thu, Nov 08, 2018 at 01:58:34PM +0900, Michael Paquier wrote: > > Anyway, I am still going through the patch, so no need to send a new > > version for now. > > Okay, I have done a round of more in-depth review, and the patch looks > to

Re: Speeding up INSERTs and UPDATEs to partitioned tables

2018-11-08 Thread Amit Langote
On 2018/11/08 20:28, David Rowley wrote: > On 8 November 2018 at 20:15, Amit Langote > wrote: >> Actually, as I also proposed upthread, we should move root_tuple_slot from >> PartitionTupleRouting to ModifyTableState as mt_root_tuple_slot, because >> it's part of the first step described above th

Re: csv format for psql

2018-11-08 Thread Michael Paquier
On Thu, Nov 08, 2018 at 01:58:34PM +0900, Michael Paquier wrote: > Anyway, I am still going through the patch, so no need to send a new > version for now. Okay, I have done a round of more in-depth review, and the patch looks to be in pretty good shape. Relying on tuples_only to decide if the hea

Re: Performance improvements of INSERTs to a partitioned table

2018-11-08 Thread Amit Langote
On 2018/11/09 11:19, David Rowley wrote: > On 7 November 2018 at 21:31, Kato, Sho wrote: >> 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

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

2018-11-08 Thread Kyotaro HORIGUCHI
At Thu, 08 Nov 2018 21:52:31 +0900, Etsuro Fujita wrote in <5be4318f.4040...@lab.ntt.co.jp> > (2018/11/08 10:50), Thomas Munro wrote: > > I take back what I said earlier about false positives from other > > pipes. I think it's only traditional Unix programs designed for use > > in pipelines and

Re: using expression syntax for partition bounds

2018-11-08 Thread Amit Langote
Rebased due to change in addRangeTableEntryForRelation's API. Thanks, Amit >From 2c9bd7d17abea93001c923ac200c560417cd39a1 Mon Sep 17 00:00:00 2001 From: Kyotaro Horiguchi Date: Fri, 6 Jul 2018 14:05:22 +0900 Subject: [PATCH v6] Allow generalized expression syntax for partition bounds Authors: Ky

Re: BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation

2018-11-08 Thread Amit Langote
On 2018/11/09 14:04, Amit Langote wrote: > On 2018/11/09 4:39, Alvaro Herrera wrote: >> and if somebody has it, a change to how defaults are applied >> when routing tuples. > > I haven't written such a patch yet. Do we want such a feature? Or is it a *bug* of tuple-routing that it doesn't substi

Re: BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation

2018-11-08 Thread Amit Langote
On 2018/11/09 4:39, Alvaro Herrera wrote: > Pushed. Thank you for committing. I've closed the CF entry. > I included the test case for collations to the three branches, but no > code changes. We can patch master for the handling of collations per > your patch, Okay, but should we back-patch it

Re: Resetting PGPROC atomics in ProcessInit()

2018-11-08 Thread Amit Kapila
On Thu, Nov 8, 2018 at 4:38 PM Amit Kapila wrote: > On Sun, Nov 4, 2018 at 6:30 AM Robert Haas wrote: > > On Sat, Oct 27, 2018 at 6:41 AM Andres Freund wrote: > > > I just noticed, while working on a patch adding things to PGPROC, that > > > the group clearning patches for the proc array and clo

Re: BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation

2018-11-08 Thread Amit Langote
On 2018/11/09 1:38, Alvaro Herrera wrote: > On 2018-Nov-09, Amit Langote wrote: > >> On Fri, Nov 9, 2018 at 1:03 AM Alvaro Herrera >> wrote: >>> On 2018-Nov-07, Amit Langote wrote: > >>> Hmm, I'm thinking perhaps we shouldn't backpatch this part. It's >>> obviously a bug, but we might break so

Re: Strange corruption in psql output on mereswine

2018-11-08 Thread Clarence Ho
Thanks for the heads up. Just saw "gull" has issue with the build too. https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=gull&dt=2018-11-09%2003%3A10%3A06 Both "gull" and "mereswine" run on the same machine. Probably wear out the SD card. Will stop these two animals and do a disk check. On

Re: notice processors for isolationtester

2018-11-08 Thread Haribabu Kommi
On Thu, Oct 25, 2018 at 8:35 AM Alvaro Herrera wrote: > Recently while testing a patch I found it immensely useful to > distinguish which session each WARNING message came from, when bespoke > tests were run under isolationtester. Current code does not show that, > so I developed this patch addi

Re: PostgreSQL vs SQL/XML Standards

2018-11-08 Thread Pavel Stehule
čt 8. 11. 2018 v 15:18 odesílatel Markus Winand napsal: > > > On 2018-11-6, at 15:23 , Pavel Stehule wrote: > > > > > > > > po 29. 10. 2018 v 11:45 odesílatel Pavel Stehule < > pavel.steh...@gmail.com> napsal: > > > > > > po 29. 10. 2018 v 10:11 odesílatel Pavel Stehule < > pavel.steh...@gmail.c

Re: Cache relation sizes?

2018-11-08 Thread David Rowley
On 7 November 2018 at 11:46, Andres Freund wrote: > Hi, > > On 2018-11-07 11:40:22 +1300, Thomas Munro wrote: >> PostgreSQL likes to probe the size of relations with lseek(SEEK_END) a >> lot. For example, a fully prewarmed pgbench -S transaction consists >> of recvfrom(), lseek(SEEK_END), lseek(S

Re: Strange corruption in psql output on mereswine

2018-11-08 Thread Tom Lane
Thomas Munro writes: > The last two runs show strange but identical (?) corruption in psql > output on mereswine (Debian on ARMv7): > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=mereswine&dt=2018-11-08%2009%3A10%3A14 > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=mereswine&

Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query

2018-11-08 Thread Amit Kapila
On Thu, Nov 8, 2018 at 10:56 PM Magnus Hagander wrote: > > On Thu, Nov 8, 2018 at 3:53 PM Sergei Kornilov wrote: >> >> Hi >> >> >> Sure, but what are we going to achieve with that number? What >> >> information user is going to get by that? If it can help us to ensure >> >> that it has reset t

Removal of unnecessary CommandCounterIncrement() when doing ON COMMIT DELETE ROWS

2018-11-08 Thread Michael Paquier
Hi all, When doing a set of ON COMMIT DELETE ROWS actions for relations, there is a CCI happening after each truncation: @@ -13334,10 +13334,8 @@ PreCommit_on_commit_actions(void) * exists at truncation time. */ if (oids_to_truncate != NIL) - { heap_truncate(oids_to_truncate)

Re: Performance improvements of INSERTs to a partitioned table

2018-11-08 Thread David Rowley
On 7 November 2018 at 21:31, Kato, Sho wrote: > 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), >

Re: Copy data to DSA area

2018-11-08 Thread Thomas Munro
On Fri, Nov 9, 2018 at 2:19 PM Ideriha, Takeshi wrote: > From: Thomas Munro [mailto:thomas.mu...@enterprisedb.com] > >I know of 3 ideas that would make your idea C work, so that you could share > >something as complicated as a query plan directly without having to > >deserialise it to > >use it:

Re: Tid scan improvements

2018-11-08 Thread Edmund Horner
On Tue, 6 Nov 2018 at 16:40, David Rowley wrote: > I've been looking over 0001 to 0003. I ran out of steam before 0004. Hi David, thanks for another big review with lots of improvements. > I like the design of the new patch. From what I threw so far at the > selectivity estimation code, it seems

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

2018-11-08 Thread Michael Paquier
On Thu, Nov 08, 2018 at 04:00:26PM +0900, Michael Paquier wrote: > Yes, I don't disagree with you and I thought about it. Fetching the > value from the control file is easy, doing the comparison between two > LSNs is also simple by doing it directly with pg_lsn in the database > (and I don't want

Re: Cache relation sizes?

2018-11-08 Thread Edmund Horner
On Wed, 7 Nov 2018 at 11:41, Thomas Munro wrote: > > Hello, > > PostgreSQL likes to probe the size of relations with lseek(SEEK_END) a > lot. For example, a fully prewarmed pgbench -S transaction consists > of recvfrom(), lseek(SEEK_END), lseek(SEEK_END), sendto(). I think > lseek() is probably

RE: Copy data to DSA area

2018-11-08 Thread Ideriha, Takeshi
Hi, thank you for all the comment. It's really helpful. >From: Thomas Munro [mailto:thomas.mu...@enterprisedb.com] >Sent: Wednesday, November 7, 2018 1:35 PM > >On Wed, Nov 7, 2018 at 3:34 PM Ideriha, Takeshi > >wrote: >> Related to my development (putting relcache and catcache onto shared >> me

Strange corruption in psql output on mereswine

2018-11-08 Thread Thomas Munro
Hi, The last two runs show strange but identical (?) corruption in psql output on mereswine (Debian on ARMv7): https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=mereswine&dt=2018-11-08%2009%3A10%3A14 https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=mereswine&dt=2018-11-07%2011%3A58%3

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

2018-11-08 Thread Michael Paquier
On Thu, Nov 08, 2018 at 12:13:31PM -0300, Alvaro Herrera wrote: > On 2018-Nov-08, Tom Lane wrote: >> Visually, however, I think this is better off with braces because >> it *looks* like a multi-line if-block. The braces also make it >> clear that your intent was not, say, >> >> while (some-m

Re: ON COMMIT actions and inheritance

2018-11-08 Thread Michael Paquier
On Thu, Nov 08, 2018 at 12:53:18PM -0500, Robert Haas wrote: > On Thu, Nov 8, 2018 at 4:04 AM Michael Paquier wrote: >> Even if the style gets heavier, I have also the following in my box: >> When used on a partitioned table, this action drops its partitions and >> when used on tables with inherit

Re: Connection slots reserved for replication

2018-11-08 Thread Masahiko Sawada
On Thu, Nov 8, 2018 at 9:30 PM Kyotaro HORIGUCHI wrote: > > Hello. > > At Wed, 7 Nov 2018 19:31:00 +0900, Masahiko Sawada > wrote in > > On Tue, Nov 6, 2018 at 9:16 PM Kyotaro HORIGUCHI > > wrote: > > > InitializeMaxBackends() > > > MaxBackends = MaxConnections + autovacuum_max_workers

ALTER DEFAULT PRIVILEGES is buggy, and so is its testing

2018-11-08 Thread Tom Lane
Buildfarm members crake and xenodermus recently fell over with very similar symptoms in the pg_upgrade test: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=crake&dt=2018-11-07%2021%3A47%3A29 pg_restore: [archiver (db)] Error while PROCESSING TOC: pg_restore: [archiver (db)] Error from TO

Re: Connection limit doesn't work for superuser

2018-11-08 Thread David G. Johnston
On Wed, Nov 7, 2018 at 11:14 AM Tom Lane wrote: > If people are okay with having rolconnlimit act > differently from datconnlimit in this respect, then I'll withdraw > my objection. Since the rolconnlimit specifically and precisely targets the superuser in a narrow manner it makes sense on its fa

Re: [HACKERS] Surjective functional indexes

2018-11-08 Thread Tom Lane
I wrote: > The bigger picture here, and the reason for my skepticism about having > any intelligence in the enabling logic, is that there is no scenario > in which this code can be smarter than the user about what to do. > We have no insight today, and are unlikely to have any in future, about > wh

Re: Disallow setting client_min_messages > ERROR?

2018-11-08 Thread Jonah H. Harris
On Thu, Nov 8, 2018 at 5:37 PM Tom Lane wrote: > > My patch used the check hook, but works either way. > > I was deliberately not getting into the detail of which hook to use ;-). > > Anyway, pushed with some adjustments and work on the documentation. > Notably, I thought the warning message was

Re: [HACKERS] Surjective functional indexes

2018-11-08 Thread Tom Lane
Alvaro Herrera writes: > On 2018-Nov-08, Konstantin Knizhnik wrote: >> Before doing any other refactoring of projection indexes I want to attach >> small bug fix patch which >> fixes the original problem (SIGSEGV) and also disables recheck_on_update by >> default. >> As Laurenz has suggested, I re

Re: Disallow setting client_min_messages > ERROR?

2018-11-08 Thread Tom Lane
"Jonah H. Harris" writes: > On Thu, Nov 8, 2018 at 10:56 AM Tom Lane wrote: >> We could implement the clamp either in elog.c or in a GUC assignment >> hook. If we do the latter, then SHOW and pg_settings would report the >> effective value rather than what you set. That seems a bit cleaner >> t

Re: Speeding up INSERTs and UPDATEs to partitioned tables

2018-11-08 Thread David Rowley
On 9 November 2018 at 00:28, David Rowley wrote: > I've attached v15 and a delta from v14 to ease re-review. I just revived the 0002 patch, which is still just for testing at this stage. There was mention over on [1] about removing the find_all_inheritors() call. Also some benchmarks from v14 wi

Re: ATTACH/DETACH PARTITION CONCURRENTLY

2018-11-08 Thread David Rowley
On 9 November 2018 at 05:34, Robert Haas wrote: > I suspect the only good way of fixing this problem is using a single > snapshot to perform both the scan of pg_inherits and the subsequent > pg_class lookups. That way, you know that you are seeing the state of > the whole partitioning hierarchy a

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

2018-11-08 Thread Robert Haas
On Thu, Nov 8, 2018 at 3:04 PM Thomas Munro wrote: > My reasoning for choosing bms_join() is that it cannot fail, assuming > the heap is not corrupted. It simply ORs the two bit-strings into > whichever is the longer input string, and frees the shorter input > string. (In an earlier version I us

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

2018-11-08 Thread Thomas Munro
On Fri, Nov 9, 2018 at 7:07 AM Robert Haas wrote: > On Wed, Nov 7, 2018 at 9:41 PM Thomas Munro > wrote: > > My plan is do a round of testing and review of this stuff next week > > once the dust is settled on the current minor releases (including > > fixing a few typos I just spotted and some wor

Re: BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation

2018-11-08 Thread Alvaro Herrera
Pushed. I included the test case for collations to the three branches, but no code changes. We can patch master for the handling of collations per your patch, and if somebody has it, a change to how defaults are applied when routing tuples. Thanks to Jürgen for reporting the bug. -- Álvaro Her

Re: [HACKERS] Surjective functional indexes

2018-11-08 Thread Andres Freund
Hi, On 2018-11-07 14:25:54 -0500, Tom Lane wrote: > We need to move forward, either by undertaking a more extensive > clean-out, or by finding a path to a version of the code that is > satisfactory. > [...] > In short, it seems likely to me that large parts of this patch need to > be pulled out, r

Re: Speeding up INSERTs and UPDATEs to partitioned tables

2018-11-08 Thread Robert Haas
On Thu, Nov 8, 2018 at 6:28 AM David Rowley wrote: > I've attached v15 and a delta from v14 to ease re-review. > > I also ran pgindent on this version. That's not part of the delta but > is in the main patch. Did you notice http://postgr.es/m/25C1C6B2E7BE044889E4FE8643A58BA963B5796B@G01JPEXMBKW0

Re: [HACKERS] Surjective functional indexes

2018-11-08 Thread Alvaro Herrera
On 2018-Nov-08, Konstantin Knizhnik wrote: > Before doing any other refactoring of projection indexes I want to attach > small bug fix patch which > fixes the original problem (SIGSEGV) and also disables recheck_on_update by > default. > As Laurenz has suggested, I replaced boolean recheck_on_upda

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

2018-11-08 Thread Robert Haas
On Wed, Nov 7, 2018 at 9:41 PM Thomas Munro wrote: > My plan is do a round of testing and review of this stuff next week > once the dust is settled on the current minor releases (including > fixing a few typos I just spotted and some word-smithing). All going > well, I will then push the resultin

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

2018-11-08 Thread Robert Haas
On Wed, Nov 7, 2018 at 9:43 PM Michael Paquier wrote: > 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

Re: New vacuum option to do only freezing

2018-11-08 Thread Robert Haas
On Thu, Nov 8, 2018 at 4:36 AM Masahiko Sawada wrote: > We already have disable_page_skipping option, not (page_skipping > false). So ISMT disable_index_cleanup would be more natural. Sure. > Also, > since what to do with this option is not only skipping vacuum indexes > but also skipping remove

Re: security release

2018-11-08 Thread Pavel Stehule
čt 8. 11. 2018 v 18:40 odesílatel Robert Haas napsal: > On Thu, Nov 8, 2018 at 12:31 PM Pavel Stehule > wrote: > > Ahoj > > > > dnes byly zverejneny opravne verze viz > https://www.postgresql.org/about/news/1905/ > > > > Pokud si hrajete s PostgreSQL 11, pripadne ji pouzivate produkcne, tak > ne

Re: ON COMMIT actions and inheritance

2018-11-08 Thread Robert Haas
On Thu, Nov 8, 2018 at 4:04 AM Michael Paquier wrote: > Even if the style gets heavier, I have also the following in my box: > When used on a partitioned table, this action drops its partitions and > when used on tables with inheritance children, it drops the depending > children. It should be "d

Re: security release

2018-11-08 Thread Robert Haas
On Thu, Nov 8, 2018 at 12:31 PM Pavel Stehule wrote: > Ahoj > > dnes byly zverejneny opravne verze viz > https://www.postgresql.org/about/news/1905/ > > Pokud si hrajete s PostgreSQL 11, pripadne ji pouzivate produkcne, tak > neodkladejte upgrade. Wrong list? -- Robert Haas EnterpriseDB: http

security release

2018-11-08 Thread Pavel Stehule
Ahoj dnes byly zverejneny opravne verze viz https://www.postgresql.org/about/news/1905/ Pokud si hrajete s PostgreSQL 11, pripadne ji pouzivate produkcne, tak neodkladejte upgrade. Pavel

Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query

2018-11-08 Thread Magnus Hagander
On Thu, Nov 8, 2018 at 3:53 PM Sergei Kornilov wrote: > Hi > > >> Sure, but what are we going to achieve with that number? What > >> information user is going to get by that? If it can help us to ensure > >> that it has reset the expected number of statements, then I can see > >> the clear us

Re: BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation

2018-11-08 Thread Alvaro Herrera
On 2018-Nov-09, Amit Langote wrote: > On Fri, Nov 9, 2018 at 1:03 AM Alvaro Herrera > wrote: > > On 2018-Nov-07, Amit Langote wrote: > > Hmm, I'm thinking perhaps we shouldn't backpatch this part. It's > > obviously a bug, but we might break somebody's working apps. Therefore > > I think I'd

Re: ATTACH/DETACH PARTITION CONCURRENTLY

2018-11-08 Thread Robert Haas
On Wed, Nov 7, 2018 at 1:37 PM Robert Haas wrote: > > Maybe you could give my patch a look. > > I have, a bit. While thinking about this problem a bit more, I realized that what is called RelationBuildPartitionDesc in master and BuildPartitionDesc in Alvaro's patch has a synchronization problem a

Re: BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation

2018-11-08 Thread Amit Langote
On Fri, Nov 9, 2018 at 1:03 AM Alvaro Herrera wrote: > On 2018-Nov-07, Amit Langote wrote: > > > I think the result in this case should be an error, just as it would in > > the regular inheritance case. > > > > create table parent (a text); > > create table child (a text collate "en_US") inherits

Re: Disallow setting client_min_messages > ERROR?

2018-11-08 Thread Jonah H. Harris
On Thu, Nov 8, 2018 at 10:56 AM Tom Lane wrote: > OK, so the consensus seems to be that the back branches should continue > to allow you to set client_min_messages = FATAL/PANIC, but then ignore > that and act as though it were ERROR. > Agreed. > We could implement the clamp either in elog.c o

Re: BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation

2018-11-08 Thread Alvaro Herrera
On 2018-Nov-07, Amit Langote wrote: > I think the result in this case should be an error, just as it would in > the regular inheritance case. > > create table parent (a text); > create table child (a text collate "en_US") inherits (parent); > NOTICE: merging column "a" with inherited definition

Re: Disallow setting client_min_messages > ERROR?

2018-11-08 Thread Andres Freund
Hi, On 2018-11-08 10:56:33 -0500, Tom Lane wrote: > OK, so the consensus seems to be that the back branches should continue > to allow you to set client_min_messages = FATAL/PANIC, but then ignore > that and act as though it were ERROR. Sounds good. > We could implement the clamp either in elog

Re: shared-memory based stats collector

2018-11-08 Thread Alvaro Herrera
On 2018-Nov-08, Tomas Vondra wrote: > I'm not sure splitting the headers like this is needed, actually. It's true > we're replacing pgstat.c with something else, but it's still related to > stats, backing pg_stat_* system views etc. So I'd keep as much of the > definitions in pgstat.h, so that it'

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

2018-11-08 Thread Alvaro Herrera
On 2018-Nov-08, Tom Lane wrote: > For the record --- I just checked, and pgindent will not mess up code like > > if (condition) > /* comment here */ > do_something(); > > at least not as long as the comment is short enough for one line. > (If it's a multiline co

Re: Disallow setting client_min_messages > ERROR?

2018-11-08 Thread Tom Lane
Andres Freund writes: > On 2018-11-06 11:37:40 -0500, Tom Lane wrote: >> Andres Freund writes: >>> Seems reasonable. I do think it's probably sensible to backpatch, >>> although I wonder if we shouldn't clamp the value to ERROR at log >>> emission error time, rather than via guc.c, so we don't pr

Re: [HACKERS] [PATCH] Generic type subscripting

2018-11-08 Thread Dmitry Dolgov
> On Thu, 8 Nov 2018 at 06:14, Pavel Stehule wrote: > >> Now it's my turn to disagree. As an argument I have this thread [1], where >> similar discussion happened about flexibility of jsonb and throwing an errors >> (in this particular case whether or not to throw an error when a non existing >> p

Re: shared-memory based stats collector

2018-11-08 Thread Tomas Vondra
On 11/8/18 12:46 PM, Kyotaro HORIGUCHI wrote: Hello. Thank you for looking this. At Tue, 30 Oct 2018 01:49:59 +0100, Tomas Vondra wrote in <5253d750-890b-069b-031f-2a9b73e47...@2ndquadrant.com> Hi, I've started looking at the patch over the past few days. I don't have any deep insights at

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

2018-11-08 Thread Tom Lane
Alvaro Herrera writes: > On 2018-Nov-08, Arthur Zakirov wrote: >> I just meant something like this (additional "{", "}" braces): > We omit braces when there's an individual statement. (We do add the > braces when we have a comment atop the individual statement, though, to > avoid pgindent from d

proposal: variadic argument support for least, greatest function

2018-11-08 Thread Pavel Stehule
Hi We can pass variadic arguments as a array to any variadic function. But some our old variadic functions doesn't supports this feature. We cannot to write SELECT least(VARIADIC ARRAY[1,2,3]); Attached patch add this possibility to least, greatest functions. Regards Pavel diff --git a/src/ba

Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query

2018-11-08 Thread Sergei Kornilov
Hi >>  Sure, but what are we going to achieve with that number? What >>  information user is going to get by that? If it can help us to ensure >>  that it has reset the expected number of statements, then I can see >>  the clear usage, but without that, the return value doesn't seem to >>  have an

Re: [HACKERS] Surjective functional indexes

2018-11-08 Thread Konstantin Knizhnik
On 08.11.2018 15:23, Laurenz Albe wrote: Tom Lane wrote: I wanted to enumerate my concerns while yesterday's events are still fresh in mind. (Andres or Robert might have more.) * I do not understand why this feature is on-by-default in the first place. It can only be a win for expression in

Re: PostgreSQL vs SQL/XML Standards

2018-11-08 Thread Markus Winand
> On 2018-11-6, at 15:23 , Pavel Stehule wrote: > > > > po 29. 10. 2018 v 11:45 odesílatel Pavel Stehule > napsal: > > > po 29. 10. 2018 v 10:11 odesílatel Pavel Stehule > napsal: > Hi > > čt 25. 10. 2018 v 21:47 odesílatel Alvaro Herrera > napsal: > On 2018-Oct-25, Pavel Stehule wro

Re: Optimze usage of immutable functions as relation

2018-11-08 Thread Antonin Houska
Aleksandr Parfenov wrote: > I fixed a typo and some comments. Please find new version attached. I've checked this verstion too. * is_simple_stable_function() instead of fetching HeapTuple from the syscache manually, you might want to consider using functions from lsyscache.c (get_func_rettype,

Re: Optimze usage of immutable functions as relation

2018-11-08 Thread Antonin Houska
Kyotaro HORIGUCHI wrote: > I had the following error with the following query. > > =# explain select * from pg_stat_get_activity(NULL) a join log(10.0) p on > a.pid = p.p; > ERROR: no relation entry for relid 2 > I think that the problem is that RTE_VALUES is wrapped in a subquery by par

Re: move PartitionBoundInfo creation code

2018-11-08 Thread Alvaro Herrera
On 2018-Nov-08, Amit Langote wrote: > 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 cano

NULL handling in exconfig deconstruction

2018-11-08 Thread Daniel Gustafsson
In extension_config_remove() we first ensure that pg_extension.extconfig cannot contain any NULL values in the array, ERRORing out if so. Later we however ask for NULL values back when deconstructing the array, throwing away the results knowing there wont be any, which seems superfluous (and wrong

Re: New vacuum option to do only freezing

2018-11-08 Thread Alvaro Herrera
On 2018-Nov-08, Masahiko Sawada wrote: > On Tue, Nov 6, 2018 at 2:48 AM Robert Haas wrote: > > > > On Mon, Nov 5, 2018 at 3:12 AM Masahiko Sawada > > wrote: > > > Adding a field-and-value style option might be worth. Or maybe we can > > > add one option for example freeze_without_index_cleanup?

Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query

2018-11-08 Thread Alvaro Herrera
On 2018-Nov-08, Amit Kapila wrote: > Sure, but what are we going to achieve with that number? What > information user is going to get by that? If it can help us to ensure > that it has reset the expected number of statements, then I can see > the clear usage, but without that, the return value d

Re: pg_dump multi VALUES INSERT

2018-11-08 Thread Surafel Temesgen
On Tue, Nov 6, 2018 at 8:18 PM Alvaro Herrera wrote: > On 2018-Nov-06, Surafel Temesgen wrote: > > > hi, > > > > On Sun, Nov 4, 2018 at 1:18 PM Fabien COELHO > wrote: > > > > > Patch does not seem to apply anymore, could you rebase? > > > > > The attached patch is a rebased version and work by ‘

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

2018-11-08 Thread Etsuro Fujita
(2018/11/08 10:50), Thomas Munro wrote: 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 come

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

2018-11-08 Thread Alvaro Herrera
On 2018-Nov-08, Arthur Zakirov wrote: > On 07.11.2018 20:11, Pavel Stehule wrote: > > st 7. 11. 2018 v 15:11 odesílatel Arthur Zakirov > > mailto:a.zaki...@postgrespro.ru>> napsal: > > > I think there is lack of necessary braces here for first if and second > > > else branches. This is tru

Re: Connection slots reserved for replication

2018-11-08 Thread Kyotaro HORIGUCHI
Hello. At Wed, 7 Nov 2018 19:31:00 +0900, Masahiko Sawada wrote in > On Tue, Nov 6, 2018 at 9:16 PM Kyotaro HORIGUCHI > wrote: > > InitializeMaxBackends() > > MaxBackends = MaxConnections + autovacuum_max_workers + 1 + > > - max_worker_processes; > > + max_w

Re: [HACKERS] Surjective functional indexes

2018-11-08 Thread Laurenz Albe
Tom Lane wrote: > I wanted to enumerate my concerns while yesterday's > events are still fresh in mind. (Andres or Robert might have more.) > > * I do not understand why this feature is on-by-default in the first > place. It can only be a win for expression indexes that are many-to-one > mapping

Re: valgrind issues on Fedora 28

2018-11-08 Thread Tomas Vondra
On 11/6/18 6:51 PM, Tomas Vondra wrote: > On 11/6/18 6:35 PM, Alvaro Herrera wrote: >> On 2018-Nov-06, Tomas Vondra wrote: >> >>> Hi, >>> >>> I've recently updated to Fedora 28, and in that environment I get >>> quite a >>> few new valgrind issues (see the attached log). >> >> Hmm, related to >> ht

Re: Connection limit doesn't work for superuser

2018-11-08 Thread Laurenz Albe
Tomas Vondra wrote: > 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 res

Re: PostgreSQL Limits and lack of documentation about them.

2018-11-08 Thread David Rowley
On 8 November 2018 at 22:46, Peter Eisentraut wrote: > Could you adjust this to use fewer capital letters, unless they start > sentences or similar? Yeah. Changed in the attached. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Se

Re: shared-memory based stats collector

2018-11-08 Thread Kyotaro HORIGUCHI
Thank you for the comments. This message contains the whole refactored patch set. At Mon, 29 Oct 2018 15:10:10 +0100, Antonin Houska wrote in <28855.1540822210@localhost> > Kyotaro HORIGUCHI wrote: > > > This is more saner version of previous v5-0008, which didn't pass > > regression test. v6

RE: A typo in partprune.c

2018-11-08 Thread Yuzuko Hosoya
Hi Michael, > From: Michael Paquier [mailto:mich...@paquier.xyz] > Sent: Thursday, November 08, 2018 8:17 PM > > On Thu, Nov 08, 2018 at 07:19:14PM +0900, Yuzuko Hosoya wrote: > > Here is the patch to fix it. > > Thanks, committed. Thank you. Yuzuko Hosoya NTT Open Source Software Center

Re: Special role for subscriptions

2018-11-08 Thread Evgeniy Efimkin
Hi! I think we can add FOR TABLES clause for create/refresh subscription, for example: CREATE SUBSCRIPTION my_sub CONNECTION ... PUBLICATION my_pub [WITH ...] [ FOR TABLES t1, t2 | ALL TABLES ]. ALL TABLES is avalibale only for superuser. FOR TABLES t1, t2 is available to owner of tables and sup

Re: Speeding up INSERTs and UPDATEs to partitioned tables

2018-11-08 Thread David Rowley
On 8 November 2018 at 20:15, Amit Langote wrote: > Actually, as I also proposed upthread, we should move root_tuple_slot from > PartitionTupleRouting to ModifyTableState as mt_root_tuple_slot, because > it's part of the first step described above that has nothing to do with > partition tuple routi

Re: jsonpath

2018-11-08 Thread Tomas Vondra
On 11/8/18 6:12 AM, Tom Lane wrote: > Tomas Vondra writes: >> 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 haven't lo

Re: A typo in partprune.c

2018-11-08 Thread Michael Paquier
On Thu, Nov 08, 2018 at 07:19:14PM +0900, Yuzuko Hosoya wrote: > Here is the patch to fix it. Thanks, committed. -- Michael signature.asc Description: PGP signature

Re: Resetting PGPROC atomics in ProcessInit()

2018-11-08 Thread Amit Kapila
On Sun, Nov 4, 2018 at 6:30 AM Robert Haas wrote: > > On Sat, Oct 27, 2018 at 6:41 AM Andres Freund wrote: > > I just noticed, while working on a patch adding things to PGPROC, that > > the group clearning patches for the proc array and clog reset atomics in > > InitProcess(). > > > > I'm not a b

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

2018-11-08 Thread Fabien COELHO
Hello Robert, psql> \conninfo You are connected to database "fabien" as user "fabien" on host "foo" at port "5432". I remain of the opinion that this is not a bug. You told it that foo has address 127.0.0.1 and it believed you; that's YOUR fault. Hmmm. For me, if a user asks \conninfo

A typo in partprune.c

2018-11-08 Thread Yuzuko Hosoya
Hi, I found a typo in the comment of get_matching_range_bounds. /* - * get_matching_range_datums + * get_matching_range_bounds * Determine the offsets of range bounds matching the specified values, * according to the semantics of the given operator strategy Here is th

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

2018-11-08 Thread Arthur Zakirov
On 07.11.2018 20:11, Pavel Stehule wrote: st 7. 11. 2018 v 15:11 odesílatel Arthur Zakirov mailto:a.zaki...@postgrespro.ru>> napsal: > I think there is lack of necessary braces here for first if and second > else branches. This is true for both patches. ? I just meant something like th

Re: PostgreSQL Limits and lack of documentation about them.

2018-11-08 Thread Peter Eisentraut
On 08/11/2018 04:13, David Rowley wrote: > I added something along those lines in a note below the table. Likely > there are better ways to format all this, but trying to detail out > what the content should be first. > > Hopefully I I've addressed the other things mentioned too. Could you adjust

Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query

2018-11-08 Thread Amit Kapila
On Thu, Nov 8, 2018 at 1:52 PM Haribabu Kommi wrote: > On Thu, Nov 8, 2018 at 4:53 PM Amit Kapila wrote: >> > This patch has changed the pg_stat_statements_reset() function from >> > returning void >> > to number statements that it reset. >> > >> >> What is the motivation of that change? It see

Re: New vacuum option to do only freezing

2018-11-08 Thread Masahiko Sawada
On Tue, Nov 6, 2018 at 2:48 AM Robert Haas wrote: > > On Mon, Nov 5, 2018 at 3:12 AM Masahiko Sawada wrote: > > Adding a field-and-value style option might be worth. Or maybe we can > > add one option for example freeze_without_index_cleanup? > > That seems non-orthogonal. We have an existing fl

Re: ON COMMIT actions and inheritance

2018-11-08 Thread Amit Langote
On 2018/11/08 18:03, Michael Paquier wrote: > On Thu, Nov 08, 2018 at 04:46:46PM +0900, Amit Langote wrote: >> How about: >> When used on tables with inheritance children (including partitioned >> tables), this also drops the children (partitions). > > Even if the style gets heavier, I have also t

Re: ON COMMIT actions and inheritance

2018-11-08 Thread Michael Paquier
On Thu, Nov 08, 2018 at 04:46:46PM +0900, Amit Langote wrote: > How about: > When used on tables with inheritance children (including partitioned > tables), this also drops the children (partitions). Even if the style gets heavier, I have also the following in my box: When used on a partitioned ta

Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query

2018-11-08 Thread Haribabu Kommi
On Thu, Nov 8, 2018 at 4:53 PM Amit Kapila wrote: > On Sun, Nov 4, 2018 at 6:37 AM Haribabu Kommi > wrote: > > > > On Sun, Nov 4, 2018 at 11:17 AM Michael Paquier > wrote: > >> > >> On Sat, Nov 03, 2018 at 03:56:14PM +0530, Amit Kapila wrote: > >> > Before trying out any solution or deciding wh

Re: [HACKERS] Surjective functional indexes

2018-11-08 Thread Konstantin Knizhnik
On 07.11.2018 22:25, Tom Lane wrote: 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