Re: Timeout parameters

2019-03-13 Thread Kyotaro HORIGUCHI
At Thu, 14 Mar 2019 03:33:20 +, "Tsunakawa, Takayuki" wrote in <0A3221C70F24FB45833433255569204D1FBC4191@G01JPEXMBYT05> > From: Robert Haas [mailto:robertmh...@gmail.com] > > But that's not what it will do. As long as the server continues to > > dribble out protocol messages from time to

Re: Sparse bit set data structure

2019-03-13 Thread Andrey Borodin
Hi! > 14 марта 2019 г., в 0:18, Heikki Linnakangas написал(а): > <0001-Add-SparseBitset-to-hold-a-large-set-of-64-bit-ints-.patch><0002-Andrey-Borodin-s-test_blockset-tool-adapted-for-Spar.patch> That is very interesting idea. Basically, B-tree and radix tree is a tradeoff between space and

Re: pgsql: Add support for hyperbolic functions, as well as log10().

2019-03-13 Thread Tom Lane
Dean Rasheed writes: > I'm amazed that jacana's asinh() returned -0 for an input of +0. Even more amusingly, it returns NaN for acosh('infinity'), cf https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=jacana=2019-03-14%2003%3A00%3A34 Presumably that means they calculated "infinity -

Re: Offline enabling/disabling of data checksums

2019-03-13 Thread Michael Paquier
On Wed, Mar 13, 2019 at 08:56:33PM +0900, Michael Paquier wrote: > On Wed, Mar 13, 2019 at 12:09:24PM +0100, Michael Banck wrote: > > The attached patch should do the above, on top of Michael's last > > patchset. > > What you are doing here looks like a good defense in itself. More thoughts on

Proposal to suppress errors thrown by to_reg*()

2019-03-13 Thread Takuma Hoshiai
Hi, hackers, According to the document, "to_reg* functions return null rather than throwing an error if the name is not found", but this is not the case if the arguments to those functions are schema qualified and the caller does not have access permission of the schema even if the table (or

Re: BUG #15668: Server crash in transformPartitionRangeBounds

2019-03-13 Thread Michael Paquier
On Wed, Mar 13, 2019 at 03:17:47PM +0900, Amit Langote wrote: > but on HEAD, you get: > > create table foo (a int default (avg(foo.a))); > ERROR: aggregate functions are not allowed in DEFAULT expressions I actually think that what you propose here makes more sense than what HEAD does because

Re: current_logfiles not following group access and instead follows log_file_mode permissions

2019-03-13 Thread Michael Paquier
On Tue, Mar 12, 2019 at 04:08:53PM -0400, Robert Haas wrote: > Anybody who has permission to read the log files but not the data > directory will presumably hit the directory-level permissions on > $PGDATA before the issue of the permissions on current_logfiles() per > se become relevant, except

Re: Progress reporting for pg_verify_checksums

2019-03-13 Thread Michael Paquier
On Thu, Mar 14, 2019 at 11:54:17AM +0900, Kyotaro HORIGUCHI wrote: > Why this patch changes the behavior for temprary directories? It > seems like a bug fix of pg_checksums. Oops, that's a thinko from 5c995139, so fixed. Note this has no actual consequence though as PG_TEMP_FILE_PREFIX and

Re: Timeout parameters

2019-03-13 Thread Fabien COELHO
Hello Robert, wrote: The main purpose of this parameter is to avoid client's waiting for DB server infinitely, not reducing the server's burden. This results in not waiting end-user, which is most important. +1. If the server fails to detect that the client has gone away, that's the

Re: Progress reporting for pg_verify_checksums

2019-03-13 Thread Michael Paquier
On Wed, Mar 13, 2019 at 07:22:28AM +0100, Fabien COELHO wrote: > Does not apply because of the renaming committed by Michaël. > > Could you rebase? This stuff touches pg_checksums.c, so you may want to wait one day or two to avoid extra work... I think that I'll be able to finish the addition

Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits

2019-03-13 Thread Masahiko Sawada
On Tue, Mar 12, 2019 at 4:54 PM Pavan Deolasee wrote: > > > On Mon, Mar 11, 2019 at 1:37 PM Masahiko Sawada wrote: >> >> >> >> I might be missing something but why do we need to recheck whether >> each pages is all-frozen after insertion? I wonder if we can set >> all-frozen without checking all

Re: pg_rewind : feature to rewind promoted standby is broken!

2019-03-13 Thread Michael Paquier
On Tue, Mar 12, 2019 at 06:23:01PM +0900, Michael Paquier wrote: > And you are pointing out to the correct commit. The issue is that > process_target_file() has added a call to check_file_excluded(), and > this skips all the folders which it thinks can be skipped. One > problem though is that we

Re: [HACKERS] PATCH: multivariate histograms and MCV lists

2019-03-13 Thread David Rowley
On Wed, 13 Mar 2019 at 17:20, Kyotaro HORIGUCHI wrote: > bms_member_index seems working differently than maybe expected. > > bms_member_index((2, 4), 0) => 0, (I think) should be -1 > bms_member_index((2, 4), 1) => 0, should be -1 > bms_member_index((2, 4), 2) => 0, should be 0 >

Re: Introduce timeout capability for ConditionVariableSleep

2019-03-13 Thread Kyotaro HORIGUCHI
Hello. At Tue, 12 Mar 2019 17:53:43 -0700, Shawn Debnath wrote in <20190313005342.ga8...@f01898859afd.ant.amazon.com> > Hi Thomas, > > Thanks for reviewing! > > On Wed, Mar 13, 2019 at 12:40:57PM +1300, Thomas Munro wrote: > > Can we just refer to the other function's documentation for this?

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

2019-03-13 Thread Michael Paquier
On Tue, Mar 12, 2019 at 01:16:14PM +0300, Arthur Zakirov wrote: > On my environment installcheck passes as well as check. Also I ran tests > with reverted c186ba13, 016_min_consistency.pl doesn't pass as expected. Thanks all for the feedback! I have done an extra pass on the new, tweaking some

Re: Progress reporting for pg_verify_checksums

2019-03-13 Thread Fabien COELHO
Hallo Michael, I would bother rounding down < 100% to 100, because then you would get 1560/1492 MB (100\%, X MB/s) which is kind of silly. No, we cap the total_size to current_size so you won't see that (but total_size will potentially gradually increase). pg_basebackup has the same

Re: ToDo: show size of partitioned table

2019-03-13 Thread Amit Langote
On 2019/02/22 1:41, Pavel Stehule wrote: > čt 21. 2. 2019 v 0:56 odesílatel Justin Pryzby > napsal: > >> On Sat, Feb 16, 2019 at 10:52:35PM +0100, Pavel Stehule wrote: >>> I like your changes. I merged all - updated patch is attached >> >> I applied and tested your v10 patch. >> >> Find attached

RE: Timeout parameters

2019-03-13 Thread Nagaura, Ryohei
Hello Robert-san. > From: Robert Haas > So this says that it works on systems that have TCP_USER_TIMEOUT or an > equivalent socket option and that it also works on Windows, and then a few > lines > later > > + This parameter is not supported on Windows, and must be zero. > > This

RE: Timeout parameters

2019-03-13 Thread Nagaura, Ryohei
Hello Mikalai-san. > From: mikalaike...@ibagroup.eu > The main idea of my comment was to avoid handling logical errors ( > "client-side > timeout") in advance to the detection of network problems > Therefore, I suggested setting "client-side timeout" greater of equal to the >

Re: WIP: BRIN multi-range indexes

2019-03-13 Thread Alexander Korotkov
On Tue, Mar 12, 2019 at 8:15 PM Tomas Vondra wrote: > > 0001. Pass all keys to BRIN consistent function at once. > > > > I think that changing the signature of consistent function is bad, because > > then > > the authors of existing BRIN opclasses will need to maintain two variants of > > the

Re: BUG #15668: Server crash in transformPartitionRangeBounds

2019-03-13 Thread Amit Langote
On 2019/03/13 14:15, Amit Langote wrote: > On 2019/03/11 16:21, Michael Paquier wrote: >> On Mon, Mar 11, 2019 at 03:44:39PM +0900, Amit Langote wrote: >>> We could make the error message more meaningful depending on the context, >>> but maybe it'd better be pursue it as a separate project. >> >>

Re: [PATCH] remove repetitive characters in fdwhandler.sgml

2019-03-13 Thread Andres Freund
On 2019-03-13 14:55:59 +0900, Etsuro Fujita wrote: > (2019/03/13 14:02), Michael Paquier wrote: > > On Tue, Mar 12, 2019 at 01:37:04AM +, Zhang, Jie wrote: > > > Here is a tiny patch removing repetitive characters [if] in > > > fdwhandler.sgml. > > > > > > - This function should

Re: Offline enabling/disabling of data checksums

2019-03-13 Thread Fabien COELHO
Bonjour Michaël, Yes, that would be nice, for now I have focused. For pg_resetwal yes we could do it easily. Would you like to send a patch? I probably can do that before next Monday. I'll prioritize reviewing the latest instance of this patch, though. This seem contradictory to me:

Re: Offline enabling/disabling of data checksums

2019-03-13 Thread Michael Paquier
On Wed, Mar 13, 2019 at 07:18:32AM +0100, Fabien COELHO wrote: > I probably can do that before next Monday. I'll prioritize reviewing the > latest instance of this patch, though. Thanks. The core code of the feature has not really changed with the last reviews, except for the tweaks in the

Re: Use nanosleep(2) in pg_usleep, if available?

2019-03-13 Thread Magnus Hagander
On Tue, Mar 12, 2019 at 6:13 PM Tom Lane wrote: > Robert Haas writes: > > On Mon, Mar 11, 2019 at 8:03 PM Tom Lane wrote: > >> While the WaitLatch alternative avoids the problem, I doubt > >> we're ever going to remove pg_usleep entirely, so it'd be > >> good if it had fewer sharp edges.

Re: performance issue in remove_from_unowned_list()

2019-03-13 Thread Robert Haas
On Tue, Mar 12, 2019 at 6:54 PM Tomas Vondra wrote: > Attached is a patch adopting the dlist approach - it seems to be working > quite fine, and is a bit cleaner than just slapping another pointer into > the SMgrRelationData struct. So I'd say this is the way to go. What about using a data

Re: CPU costs of random_zipfian in pgbench

2019-03-13 Thread Georgios Kokolatos
The following review has been posted through the commitfest application: make installcheck-world: not tested Implements feature: not tested Spec compliant: not tested Documentation:not tested For whatever it is worth, the patch looks good to me. A minor nitpick would

Re: Offline enabling/disabling of data checksums

2019-03-13 Thread Michael Paquier
On Wed, Mar 13, 2019 at 10:08:33AM +0100, Fabien COELHO wrote: > I'm not sure of the punctuation logic on the help line: the first sentence > does not end with a ".". I could not find an instance of this style in other > help on pg commands. I'd suggest "check data checksums (default)" would work

Re: Offline enabling/disabling of data checksums

2019-03-13 Thread Michael Paquier
On Wed, Mar 13, 2019 at 10:44:03AM +0100, Fabien COELHO wrote: > Yep. That is the issue I think is preventable by fsyncing updated data > *then* writing & syncing the control file, and that should be done by > pg_checksums. Well, pg_rewind works similarly: control file gets updated and then the

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

2019-03-13 Thread John Naylor
On Fri, Mar 8, 2019 at 7:43 PM Amit Kapila wrote: > Have you done any performance testing of this patch? I mean to say > now that we added a new stat call for each table, we should see if > that has any impact. Ideally, that should be compensated by the fact > that we are now not transferring

RE: SQL statement PREPARE does not work in ECPG

2019-03-13 Thread Matsumura, Ryo
Hi Meskes-san cc: Takahashi-san, Kuroda-san, Ideriha-san I attach a new patch. Please review it. Excuse: It doesn't include regression tests and pass them. Because I must reset all expected C program of regression. # I add an argument to ECPGdo(). I explain the patch as follows: 1.

Re: Using condition variables to wait for checkpoints

2019-03-13 Thread Robert Haas
On Tue, Mar 12, 2019 at 7:12 PM Andres Freund wrote: > Having useful infrastructure is sure cool. Yay! -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: Offline enabling/disabling of data checksums

2019-03-13 Thread Michael Paquier
On Wed, Mar 13, 2019 at 02:43:39PM +0300, Sergei Kornilov wrote: > Seems good. And I think we need backpath this check to pg11. similar > to cross-version compatibility checks Good point raised, a backpatch looks adapted. It would be nice to get into something more dynamic, but

Re: What to name the current heap after pluggable storage / what to rename?

2019-03-13 Thread Robert Haas
On Tue, Mar 12, 2019 at 8:39 PM Andres Freund wrote: > > I like that option. > > In that vein, does anybody have an opinion about the naming of > a) HeapUpdateFailureData, which will be used for different AMs > b) HTSU_Result itself, which'll be the return parameter for >update/delete via

Re: Fix volatile vs. pointer confusion

2019-03-13 Thread Peter Eisentraut
On 2019-03-11 12:57, Alvaro Herrera wrote: > Looking at recently committed 2e616dee9e60, we have introduced this: > > + volatile xmlBufferPtr buf = NULL; > + volatile xmlNodePtr cur_copy = NULL; > > where the pointer-ness nature of the object is inside the typedef. I > *suppose*

Re: Fix volatile vs. pointer confusion

2019-03-13 Thread Peter Eisentraut
On 2019-03-11 09:31, Michael Paquier wrote: > On Mon, Mar 11, 2019 at 08:23:39AM +0100, Peter Eisentraut wrote: >> Attached patch fixes a couple of cases of that. Most instances were >> already correct. > > It seems to me that you should look at that: >

Re: CPU costs of random_zipfian in pgbench

2019-03-13 Thread Fabien COELHO
For whatever it is worth, the patch looks good to me. A minor nitpick would be to use a verb in the part: `cost when the parameter in (0, 1)` maybe: `cost when the parameter's value is in (0, 1)` or similar. Looks ok. Apart from that, I would suggest it that the patch could be moved

RE: speeding up planning with partitions

2019-03-13 Thread Imai, Yoshikazu
Amit-san, On Tue, Mar 12, 2019 at 2:34 PM, Amit Langote wrote: > Thanks for the heads up. > > On Tue, Mar 12, 2019 at 10:23 PM Jesper Pedersen > wrote: > > After applying 0004 check-world fails with the attached. CFBot agrees > [1]. > > Fixed. I had forgotten to re-run postgres_fdw tests

Re: Offline enabling/disabling of data checksums

2019-03-13 Thread Michael Banck
Am Mittwoch, den 13.03.2019, 18:31 +0900 schrieb Michael Paquier: > On Wed, Mar 13, 2019 at 10:08:33AM +0100, Fabien COELHO wrote: > > I'm not sure of the punctuation logic on the help line: the first sentence > > does not end with a ".". I could not find an instance of this style in other > >

Re: Offline enabling/disabling of data checksums

2019-03-13 Thread Fabien COELHO
Hello, Yep. That is the issue I think is preventable by fsyncing updated data *then* writing & syncing the control file, and that should be done by pg_checksums. Well, pg_rewind works similarly: control file gets updated and then the whole data directory gets flushed. So it is basically

Re: Offline enabling/disabling of data checksums

2019-03-13 Thread Michael Banck
Hi, Am Mittwoch, den 13.03.2019, 11:47 +0100 schrieb Magnus Hagander: > On Wed, Mar 13, 2019 at 11:41 AM Michael Banck > wrote: > > I propose we re-read the control file for the enable case after we > > finished operating on all files and (i) check the instance is still > > offline and (ii)

Re: WIP: BRIN multi-range indexes

2019-03-13 Thread Alexander Korotkov
On Wed, Mar 13, 2019 at 12:52 PM Tomas Vondra wrote: > On 3/13/19 9:15 AM, Alexander Korotkov wrote: > > On Tue, Mar 12, 2019 at 8:15 PM Tomas Vondra > > wrote: > >>> 0001. Pass all keys to BRIN consistent function at once. > >>> > >>> I think that changing the signature of consistent function

Re: Offline enabling/disabling of data checksums

2019-03-13 Thread Michael Banck
Hi, Am Mittwoch, den 13.03.2019, 12:24 +0100 schrieb Magnus Hagander: > > Also we support ./configure --with-blocksize=(not equals 8)? make > > check on HEAD fails for me. If we support this - i think we need > > recheck BLCKSZ between compiled pg_checksum and used in PGDATA > > You mean if the

Re: Offline enabling/disabling of data checksums

2019-03-13 Thread Magnus Hagander
On Wed, Mar 13, 2019 at 12:40 PM Sergei Kornilov wrote: > Hi > > >> One new question from me: how about replication? > >> Case: primary+replica, we shut down primary and enable checksum, and > "started streaming WAL from primary" without any issue. I have master with > checksums, but replica

Re: Offline enabling/disabling of data checksums

2019-03-13 Thread Sergei Kornilov
Hi, >>  > Also we support ./configure --with-blocksize=(not equals 8)? make >>  > check on HEAD fails for me. If we support this - i think we need >>  > recheck BLCKSZ between compiled pg_checksum and used in PGDATA >> >>  You mean if the backend and pg_checksums is built with different >>  

Fix handling of unlogged tables in FOR ALL TABLES publications

2019-03-13 Thread Peter Eisentraut
If a FOR ALL TABLES publication exists, unlogged tables are ignored for publishing changes. But CheckCmdReplicaIdentity() would still check in that case that such a table has a replica identity set before accepting updates. That is useless, so check first whether the given table is publishable

Re: GSOC Application

2019-03-13 Thread Andrey Borodin
Hi, Pavan! > 12 марта 2019 г., в 12:01, pavan gudivada > написал(а): > > I am Pavan_Gudivada.I have good knowledge in HTML, CSS,JAVASCRIPT,PYTHON and > SQL.After i know about PostgreSQL and its contributions through open source > .i am also intersted to take part in Read/write

Re: [PATCH] Remove stray comma from heap_page_item_attrs() docs

2019-03-13 Thread Magnus Hagander
On Wed, Mar 13, 2019 at 1:26 PM Christoph Berg wrote: > (This seems to be the only occurrence of this error, after about 2 > minutes of git-grep-ing.) > Thanks, pushed! -- Magnus Hagander Me: https://www.hagander.net/ Work: https://www.redpill-linpro.com/

Re: Offline enabling/disabling of data checksums

2019-03-13 Thread Sergei Kornilov
Hi >> One new question from me: how about replication? >> Case: primary+replica, we shut down primary and enable checksum, and >> "started streaming WAL from primary" without any issue. I have master with >> checksums, but replica without. >> Or cluster with checksums, then disable checksums on

Re: Offline enabling/disabling of data checksums

2019-03-13 Thread Fabien COELHO
Michaël-san, Now the set of patches is: - 0001, add --enable and --disable. I have tweaked a bit the patch so as "action" is replaced by "mode" which is more consistent with other tools like pg_ctl. pg_indent was also complaining about one of the new enum structures. Patch applies cleanly,

Re: WIP: BRIN multi-range indexes

2019-03-13 Thread Tomas Vondra
On 3/13/19 9:15 AM, Alexander Korotkov wrote: > On Tue, Mar 12, 2019 at 8:15 PM Tomas Vondra > wrote: >>> 0001. Pass all keys to BRIN consistent function at once. >>> >>> I think that changing the signature of consistent function is bad, because >>> then >>> the authors of existing BRIN

Re: Offline enabling/disabling of data checksums

2019-03-13 Thread Magnus Hagander
On Wed, Mar 13, 2019 at 11:41 AM Michael Banck wrote: > Am Mittwoch, den 13.03.2019, 18:31 +0900 schrieb Michael Paquier: > > On Wed, Mar 13, 2019 at 10:08:33AM +0100, Fabien COELHO wrote: > > > I'm not sure of the punctuation logic on the help line: the first > sentence > > > does not end with

Re: Offline enabling/disabling of data checksums

2019-03-13 Thread Fabien COELHO
Hallo Michael, I propose we re-read the control file for the enable case after we finished operating on all files and (i) check the instance is still offline and (ii) update the checksums version from there. That should be a small but worthwhile change that could be done anyway. That looks

Re: Offline enabling/disabling of data checksums

2019-03-13 Thread Sergei Kornilov
Hi One new question from me: how about replication? Case: primary+replica, we shut down primary and enable checksum, and "started streaming WAL from primary" without any issue. I have master with checksums, but replica without. Or cluster with checksums, then disable checksums on primary, but

[PATCH] Remove stray comma from heap_page_item_attrs() docs

2019-03-13 Thread Christoph Berg
(This seems to be the only occurrence of this error, after about 2 minutes of git-grep-ing.) >From 42b2a82f8e06beb0de3b3b15ded85fc905fb9edd Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Wed, 13 Mar 2019 13:24:22 +0100 Subject: [PATCH] Remove stray comma from heap_page_item_attrs() docs ---

Re: Inadequate executor locking of indexes

2019-03-13 Thread Amit Langote
Hi David, On 2019/03/13 10:38, David Rowley wrote: > I had another go at this patch and fixed the problem by just setting > the idxlockmode inside the planner just before the call to > expand_inherited_tables(). This allows the lockmode to be copied into > child RTEs. I have one question about

Re: Unified logging system for command-line programs

2019-03-13 Thread Arthur Zakirov
Hello, On 22.02.2019 11:39, Peter Eisentraut wrote: Here is an updated patch. I've finished the functionality to the point where I'm content with it. I fixed up some of the remaining special cases in pg_dump that I hadn't sorted out last time. I also moved the scattered setvbuf(stderr, ...)

Re: Offline enabling/disabling of data checksums

2019-03-13 Thread Fabien COELHO
I do not think it is a good thing that two commands can write to the data directory at the same time, really. We don't prevent either a pg_resetwal and a pg_basebackup to run in parallel. That would be... Interesting. Yep, I'm trying again to suggest that this kind of thing should be

Re: CPU costs of random_zipfian in pgbench

2019-03-13 Thread Georgios Kokolatos
The following review has been posted through the commitfest application: make installcheck-world: not tested Implements feature: not tested Spec compliant: not tested Documentation:not tested Version 3 of the patch looks ready for committer. Thank you for taking the

Re: Compressed TOAST Slicing

2019-03-13 Thread Tomas Vondra
On 3/13/19 3:19 AM, Michael Paquier wrote: > On Tue, Mar 12, 2019 at 07:01:17PM -0700, Andres Freund wrote: >> I don't think this is even close to popular enough to incur the >> maybe of a separate function / more complicated interface. By this >> logic we can change basically no APIs anymore. >

RE: [PATCH] remove repetitive characters in fdwhandler.sgml

2019-03-13 Thread Zhang, Jie
> This function should store the tuple into the provided slot, no? Yes, this modification is easier to understand. -Original Message- From: Michael Paquier [mailto:mich...@paquier.xyz] Sent: Wednesday, March 13, 2019 1:02 PM To: Zhang, Jie/张 杰 Cc: pgsql-hack...@postgresql.org Subject:

Re: Offline enabling/disabling of data checksums

2019-03-13 Thread Magnus Hagander
On Wed, Mar 13, 2019 at 11:54 AM Sergei Kornilov wrote: > Hi > > One new question from me: how about replication? > Case: primary+replica, we shut down primary and enable checksum, and > "started streaming WAL from primary" without any issue. I have master with > checksums, but replica without.

Re: Offline enabling/disabling of data checksums

2019-03-13 Thread Michael Paquier
On Wed, Mar 13, 2019 at 12:09:24PM +0100, Michael Banck wrote: > The attached patch should do the above, on top of Michael's last > patchset. What you are doing here looks like a good defense in itself. -- Michael signature.asc Description: PGP signature

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

2019-03-13 Thread Amit Kapila
On Wed, Mar 13, 2019 at 4:57 PM John Naylor wrote: > > On Fri, Mar 8, 2019 at 7:43 PM Amit Kapila wrote: > > > Have you done any performance testing of this patch? I mean to say > > now that we added a new stat call for each table, we should see if > > that has any impact. Ideally, that should

Re: PATCH: Include all columns in default names for foreign key constraints.

2019-03-13 Thread Peter Eisentraut
On 2019-03-09 22:27, Paul Martinez wrote: > Yikes, sorry about that. Some tests are failing on my machine because of > dynamic > linking issues and I totally missed all the foreign key failures. I think I've > fixed all the tests. I changed the test I added to test the 63-character > limit. > >

Re: Special role for subscriptions

2019-03-13 Thread Evgeniy Efimkin
Hi! Thanks for comments! > Just letting the superuser decide who gets to create subscriptions > seems good enough from here. I've prepare patch with new system role, i'm not sure about name, called it "pg_subscription_users". In that patch we don't check permissions on target tables, i don't

Re: using index or check in ALTER TABLE SET NOT NULL

2019-03-13 Thread Sergei Kornilov
Hi > The buildfarm thinks additional nitpicking is needed. hm. Patch was committed with debug1 level tests and many animals uses log_statement = 'all'. Therefore they have additional line in result: LOG: statement: alter table pg_class alter column relname drop not null; and similar for

Re: Compressed TOAST Slicing

2019-03-13 Thread Paul Ramsey
> On Mar 13, 2019, at 3:09 AM, Tomas Vondra > wrote: > > On 3/13/19 3:19 AM, Michael Paquier wrote: >> On Tue, Mar 12, 2019 at 07:01:17PM -0700, Andres Freund wrote: >>> I don't think this is even close to popular enough to incur the >>> maybe of a separate function / more complicated

Re: using index or check in ALTER TABLE SET NOT NULL

2019-03-13 Thread Sergei Kornilov
Wow, thank you! 13.03.2019, 15:57, "Robert Haas" : > On Tue, Mar 12, 2019 at 4:27 PM Sergei Kornilov wrote: >>  Agreed, in attached new version ... > > Committed with a little more nitpicking. > > -- > Robert Haas > EnterpriseDB: http://www.enterprisedb.com > The Enterprise PostgreSQL Company

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

2019-03-13 Thread Robert Haas
On Tue, Mar 12, 2019 at 7:28 PM David Rowley wrote: > I think I've done that in the attached patch. Cool, thanks. > However, do think the > just saying "excessive memory usage" seems strange without prefixing > it with "can result in" and dropping the "especially". I'm fairly > used to having

Re: Special role for subscriptions

2019-03-13 Thread Robert Haas
On Mon, Mar 11, 2019 at 10:39 PM Michael Paquier wrote: > On Mon, Mar 11, 2019 at 06:32:10PM -0700, Jeff Davis wrote: > > * Is the original idea of a special role still viable? > > In my opinion, that part may be valuable. The latest patches proposed > change the way tables are filtered and

Show a human-readable n_distinct in pg_stats view

2019-03-13 Thread Maxence Ahlouche
Hi, It seems to me that since the pg_stats view is supposed to be human-readable, it would make sense to show a human-readable version of n_distinct. Currently, when the stats collector estimates that the number of distinct values is more than 10% of the total row count, what is stored in

Re: using index or check in ALTER TABLE SET NOT NULL

2019-03-13 Thread Tom Lane
Robert Haas writes: > On Tue, Mar 12, 2019 at 4:27 PM Sergei Kornilov wrote: >> Agreed, in attached new version ... > Committed with a little more nitpicking. The buildfarm thinks additional nitpicking is needed. regards, tom lane

Re: using index or check in ALTER TABLE SET NOT NULL

2019-03-13 Thread Robert Haas
On Tue, Mar 12, 2019 at 4:27 PM Sergei Kornilov wrote: > Agreed, in attached new version ... Committed with a little more nitpicking. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

Re: Minimal logical decoding on standbys

2019-03-13 Thread tushar
Hi , I am getting a server crash on standby while executing pg_logical_slot_get_changes function   , please refer this scenario Master cluster( ./initdb -D master) set wal_level='hot_standby in master/postgresql.conf file start the server , connect to  psql terminal and create a physical

Re: REINDEX CONCURRENTLY 2.0

2019-03-13 Thread Sergei Kornilov
Hello Patch is marked as target version 12, but is inactive few weeks long. I think many users want this feature and patch is in good shape. We have open questions on this thread? Latest patch still can be aplied cleanly; it builds and pass tests. regards, Sergei

Re: [WIP] CREATE SUBSCRIPTION with FOR TABLES clause (table filter)

2019-03-13 Thread Robert Haas
On Mon, Mar 4, 2019 at 1:55 AM Michael Paquier wrote: > - To create a subscription, the user must be a superuser. > + To add tables to a subscription, the user must have ownership rights on > the > + table. > [...] > + /* must have CREATE privilege on database */ > + aclresult =

Re: performance issue in remove_from_unowned_list()

2019-03-13 Thread Tomas Vondra
On 3/13/19 1:12 PM, Robert Haas wrote: > On Tue, Mar 12, 2019 at 6:54 PM Tomas Vondra > wrote: >> Attached is a patch adopting the dlist approach - it seems to be working >> quite fine, and is a bit cleaner than just slapping another pointer into >> the SMgrRelationData struct. So I'd say this is

Re: performance issue in remove_from_unowned_list()

2019-03-13 Thread Robert Haas
On Wed, Mar 13, 2019 at 9:47 AM Tomas Vondra wrote: > AFAICS we already maintain a hash table of the smgr relations, and we > look them up in this table. We don't need to look them up in the list of > unowned relations - the whole problem is that with the current > single-linked list, we need to

GIN indexes on an = ANY(array) clause

2019-03-13 Thread Corey Huinker
(moving this over from pgsql-performance) A client had an issue with a where that had a where clause something like this: WHERE 123456 = ANY(integer_array_column) I was surprised that this didn't use the pre-existing GIN index on integer_array_column, whereas recoding as WHERE ARRAY[123456]

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

2019-03-13 Thread John Naylor
On Wed, Mar 13, 2019 at 8:18 PM Amit Kapila wrote: > > First, I had a problem: On MacOS with their "gcc" wrapper around > > clang, I got a segfault 11 when compiled with no debugging symbols. > > > > Did you get this problem with the patch or both with and without the > patch? If it is only with

Re: [Patch] Log10 and hyperbolic functions for SQL:2016 compliance

2019-03-13 Thread Lætitia Avrot
Thanks, Tom ! Thank you everyone for your help and patience. Cheers, Lætitia Le mar. 12 mars 2019 à 20:57, Tom Lane a écrit : > =?UTF-8?Q?L=C3=A6titia_Avrot?= writes: > > So, as you're asking that too, maybe my reasons weren't good enough. > You'll > > find enclosed a new version of the

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

2019-03-13 Thread Amit Kapila
On Wed, Mar 13, 2019 at 7:42 PM John Naylor wrote: > > On Wed, Mar 13, 2019 at 8:18 PM Amit Kapila wrote: > > > First, I had a problem: On MacOS with their "gcc" wrapper around > > > clang, I got a segfault 11 when compiled with no debugging symbols. > > > > > > > Did you get this problem with

Re: Offline enabling/disabling of data checksums

2019-03-13 Thread Michael Banck
Hi, Am Mittwoch, den 13.03.2019, 12:24 +0100 schrieb Magnus Hagander: > On Wed, Mar 13, 2019 at 11:54 AM Sergei Kornilov wrote: > > One new question from me: how about replication? > > Case: primary+replica, we shut down primary and enable checksum, and > > "started streaming WAL from primary"

Re: Compressed TOAST Slicing

2019-03-13 Thread Andrey Borodin
> 13 марта 2019 г., в 21:05, Paul Ramsey написал(а): > > Here is a new (final?) patch ... > > This check @@ -744,6 +748,8 @@ pglz_decompress(const char *source, int32 slen, char *dest, { *dp = dp[-off];

Re: [HACKERS] PATCH: multivariate histograms and MCV lists

2019-03-13 Thread Robert Haas
On Wed, Mar 13, 2019 at 12:20 AM Kyotaro HORIGUCHI wrote: > +Multivariate MCV (most-common values) lists are a straightforward extension > of > > "lists are *a*" is wrong? No, that's correct. Not sure exactly what your concern is, but it's probably related to the fact that the first parent

Re: hyrax vs. RelationBuildPartitionDesc

2019-03-13 Thread Robert Haas
On Wed, Mar 13, 2019 at 12:42 PM Alvaro Herrera wrote: > I remember going over this code's memory allocation strategy a bit to > avoid the copy while not incurring potential leaks CacheMemoryContext; > as I recall, my idea was to use two contexts, one of which is temporary > and used for any

Re: Using the return value of strlcpy() and strlcat()

2019-03-13 Thread Tom Lane
ilm...@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) writes: > [ let's convert > + strlcpy(buf + buflen, name, NAMEDATALEN); > + buflen += strlen(buf + buflen); > to > + buflen += strlcpy(buf + buflen, name, NAMEDATALEN); > ] I don't think that's a

Re: using index or check in ALTER TABLE SET NOT NULL

2019-03-13 Thread Tom Lane
Sergei Kornilov writes: >> Ugh, I guess so. Or how about changing the message itself to use >> INFO, like we already do in QueuePartitionConstraintValidation? > Fine for me. But year ago this was implemented in my patch and Tom voted > against using INFO level for such purpose: >

Re: hyrax vs. RelationBuildPartitionDesc

2019-03-13 Thread Tom Lane
I wrote: > I recall having noticed someplace where I thought the relcache partition > support was simply failing to make provisions for cleaning up a cached > structure at relcache entry drop, but I didn't have time to pursue it > right then. Let me see if I can reconstruct what I was worried

Using the return value of strlcpy() and strlcat()

2019-03-13 Thread Dagfinn Ilmari Mannsåker
Hi hackers, Over in the "Include all columns in default names for foreign key constraints" thread[1], I noticed the patch added the following: + strlcpy(buf + buflen, name, NAMEDATALEN); + buflen += strlen(buf + buflen); Seeing as strlcpy() returns the copied length,

hyrax vs. RelationBuildPartitionDesc

2019-03-13 Thread Robert Haas
Hi, Amit Kapila pointed out to be that there are some buidfarm failures on hyrax which seem to have started happening around the time I committed 898e5e3290a72d288923260143930fb32036c00c. It failed like this once: 2019-03-07 19:57:40.231 EST [28073:11] DETAIL: Failed process was running: /*

Re: GIN indexes on an = ANY(array) clause

2019-03-13 Thread Tom Lane
Corey Huinker writes: > A client had an issue with a where that had a where clause something like > this: > WHERE 123456 = ANY(integer_array_column) > I was surprised that this didn't use the pre-existing GIN index on > integer_array_column, whereas recoding as > WHERE ARRAY[123456] <@

Re: using index or check in ALTER TABLE SET NOT NULL

2019-03-13 Thread Sergei Kornilov
Hi > Ugh, I guess so. Or how about changing the message itself to use > INFO, like we already do in QueuePartitionConstraintValidation? Fine for me. But year ago this was implemented in my patch and Tom voted against using INFO level for such purpose:

Re: Offline enabling/disabling of data checksums

2019-03-13 Thread Magnus Hagander
On Wed, Mar 13, 2019 at 4:46 PM Michael Banck wrote: > Hi, > > Am Mittwoch, den 13.03.2019, 12:24 +0100 schrieb Magnus Hagander: > > On Wed, Mar 13, 2019 at 11:54 AM Sergei Kornilov wrote: > > > One new question from me: how about replication? > > > Case: primary+replica, we shut down primary

Re: hyrax vs. RelationBuildPartitionDesc

2019-03-13 Thread Tom Lane
Robert Haas writes: > On Wed, Mar 13, 2019 at 12:42 PM Alvaro Herrera > wrote: >> I remember going over this code's memory allocation strategy a bit to >> avoid the copy while not incurring potential leaks CacheMemoryContext; >> as I recall, my idea was to use two contexts, one of which is

Re: hyrax vs. RelationBuildPartitionDesc

2019-03-13 Thread Alvaro Herrera
On 2019-Mar-13, Robert Haas wrote: > On Wed, Mar 13, 2019 at 12:42 PM Alvaro Herrera > wrote: > > I remember going over this code's memory allocation strategy a bit to > > avoid the copy while not incurring potential leaks CacheMemoryContext; > > as I recall, my idea was to use two contexts, one

Re: hyrax vs. RelationBuildPartitionDesc

2019-03-13 Thread Robert Haas
On Wed, Mar 13, 2019 at 1:38 PM Alvaro Herrera wrote: > A bit, yes, but not overly so, and it's less fragile that not having > such a protection. Anything that allocates in CacheMemoryContext needs > to be very careful anyway. True, but I think it's more fragile than either of the options I

Re: Offline enabling/disabling of data checksums

2019-03-13 Thread Michael Banck
Hi, Am Mittwoch, den 13.03.2019, 12:43 +0100 schrieb Magnus Hagander: > I think this is dangerous enough that it needs to be enforced and not > documented. Changing the cluster ID might have some other side-effects, I think there are several cloud-native 3rd party solutions that use the cluster

Re: Compressed TOAST Slicing

2019-03-13 Thread Paul Ramsey
On Mar 13, 2019, at 8:25 AM, Paul Ramsey wrote:On Mar 13, 2019, at 3:09 AM, Tomas Vondra wrote:On 3/13/19 3:19 AM, Michael Paquier wrote:On Tue, Mar 12, 2019 at 07:01:17PM -0700, Andres Freund wrote:I don't think this is even close to

  1   2   >