Re: [PATCH] Include application_name in "connection authorized" log message

2018-07-02 Thread Peter Eisentraut
On 21.06.18 16:21, Don Seiler wrote: > -                                               (errmsg("connection > authorized: user=%s database=%s", > -                                                              >  port->user_name, port->database_name))); > +                                           

Add a tab-completion for "SELECT INTO" or "SELECT FROM" in psql

2018-07-02 Thread C,C H
Hi, I use tab-completion in psql quite often and I find that I can't complete "FROM" for SELECT query. So I try to create a patch for it. I download the source code from GitHub master branch and modify the file to create the patch. I compile the code and my code change works like follows, -

Re: PANIC during crash recovery of a recently promoted standby

2018-07-02 Thread Kyotaro HORIGUCHI
Hello. At Fri, 22 Jun 2018 15:25:48 +0900, Michael Paquier wrote in <20180622062548.ge5...@paquier.xyz> > On Fri, Jun 22, 2018 at 02:34:02PM +0900, Kyotaro HORIGUCHI wrote: > > Hello, sorry for the absense and I looked the second patch. > > Thanks for the review! > > > At Fri, 22 Jun 2018 13:4

Re: Copy function for logical replication slots

2018-07-02 Thread Masahiko Sawada
On Thu, Jun 28, 2018 at 7:10 PM, Masahiko Sawada wrote: > On Thu, Jun 28, 2018 at 5:37 PM, Peter Eisentraut > wrote: >> On 6/28/18 08:47, Michael Paquier wrote: > There could be some cases where > copying a physical slot also makes sense. I've thought that but I didn't find concrete

Re: buildfarm vs code

2018-07-02 Thread Peter Eisentraut
On 05.06.18 18:09, Andrew Dunstan wrote: > The first should be simple and non-controversial. It allows > src/tools/msvc/build.pl to be called in such a way that it only creates > the project files and then stops. This is a one line addition to the > script and should affect nobody not using the

Re: Server crashed with dense_rank on partition table.

2018-07-02 Thread Amit Langote
On 2018/06/13 16:35, Amit Langote wrote: > Fwiw, I see that the crash can also occur even when using a > non-partitioned table in the query, as shown in the following example > which reuses Rajkumar's test data and query: > > create table foo (a int, b int, c text); > postgres=# insert into foo se

Re: Avoid extra Sort nodes between WindowAggs when sorting can be reused

2018-07-02 Thread Daniel Gustafsson
> On 26 Jun 2018, at 17:11, Alexander Kuzmenkov > wrote: > I took a look at the patch. It applies and compiles, the tests pass. Thanks for reviewing, and apologies for the slow response. > Some thoughts about the code: > > * Postgres lists cache their lengths, so you don't need uniqueLen. Go

Re: CREATE TABLE .. LIKE .. EXCLUDING documentation

2018-07-02 Thread Daniel Gustafsson
> On 29 Jun 2018, at 18:44, Tom Lane wrote: > +1 for shortening it as proposed by Peter. The existing arrangement > made sense when it was first written, when there were only about three > individual options IIRC. Now it's just confusing, especially since you > can't tell very easily whether an

Re: branches_of_interest.txt

2018-07-02 Thread Peter Eisentraut
On 01.07.18 17:41, Tom Lane wrote: > I can see the value of people other than you being able to change it, > but keeping it in the core repo seems like a kluge not a proper solution. > In particular, once it'd been around for awhile so that the master copy > had diverged from the back branches' cop

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

2018-07-02 Thread Sergei Kornilov
Hello I found SELECT pg_stat_statements_reset(NULL,NULL,s.queryid) in tests and it pass tests, but i wonder how it works. Should not we check the NULL through PG_ARGISNULL macro before any PG_GETARG_*? According src/include/fmgr.h > * If function is not marked "proisstrict" in pg_proc, it must

Re: Should contrib modules install .h files?

2018-07-02 Thread Peter Eisentraut
On 01.07.18 20:23, Andrew Gierth wrote: > So I have this immediate problem: a PGXS build of a module, specifically > an hstore transform for a non-core PL, is much harder than it should be > because it has no way to get at hstore.h since that file is never > installed anywhere. > > Should that be

Re: branches_of_interest.txt

2018-07-02 Thread Magnus Hagander
On Mon, Jul 2, 2018 at 10:39 AM, Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > On 01.07.18 17:41, Tom Lane wrote: > > I can see the value of people other than you being able to change it, > > but keeping it in the core repo seems like a kluge not a proper solution. > > In particula

Re: Add a tab-completion for "SELECT INTO" or "SELECT FROM" in psql

2018-07-02 Thread Edmund Horner
On 2 July 2018 at 17:57, C,C H wrote: > I use tab-completion in psql quite often and I find that I can't complete > "FROM" for SELECT query. > > So I try to create a patch for it. > > I download the source code from GitHub master branch and modify the file to > create the patch. > > I compile the

Re: Threat models for DB cryptography (Re: [Proposal] Table-level Transparent Data Encryption (TDE) and Key) Management Service (KMS)

2018-07-02 Thread Masahiko Sawada
On Fri, Jun 22, 2018 at 2:31 PM, Tsunakawa, Takayuki wrote: > From: Nico Williams [mailto:n...@cryptonector.com] >> Let's start with a set of threat models then. I'll go first: > > Thank you so much for summarizing the current situation. I'd appreciate it > if you could write this on the Postgr

Re: Tips on committing

2018-07-02 Thread Michael Paquier
On Fri, Jun 29, 2018 at 06:02:07PM -0400, Bruce Momjian wrote: > On Thu, Jun 28, 2018 at 09:46:17AM -0700, Peter Geoghegan wrote: >> * Don't assume that you haven't broken the doc build if you make even >> a trivial doc change. Removing a GUC can break instances in the >> release notes where they'r

Re: Large Commitfest items

2018-07-02 Thread Peter Eisentraut
On 01.07.18 20:46, Andrew Dunstan wrote: > There has been some discussion around excluding large items from the > current commitfest, for several reasons. I'm not sure how useful that would be. We don't want to deal with the large stuff late in the cycle, so it would seem to be beneficial to deal

How to find the base version cf-bot is using?

2018-07-02 Thread Kyotaro HORIGUCHI
Hello. I found that the CF-bot is complaining on one of my patch. http://cfbot.cputube.org/patch_18_931.log > === applying patch > ./v4-0001-Remove-entries-that-haven-t-been-used-for-a-certain-.patch ... > |Date: Tue, 26 Dec 2017 17:43:09 +0900 ... > Patching file src/backend/utils/cache/plancac

Test-cases for deferred constraints in plpgsql_transaction.sql

2018-07-02 Thread Ashutosh Sharma
Hi All, Currently, I could see only one test-case for deferred constraints in plpgsql_transaction.sql file which tests if the constraint checking is happening during commit time or not with the help of COMMIT statement. Shouldn't we add some more test-cases to test ROLLBACK and SET CONSTRAINTS sta

Re: Expression errors with "FOR UPDATE" and postgres_fdw with partition wise join enabled.

2018-07-02 Thread Etsuro Fujita
(2018/06/22 23:58), Robert Haas wrote: I think this approach is going to run into trouble if the level at which we have to apply the ConvertRowTypeExpr happens not to be a projection-capable node. Actually, the level we have to do that would be a child rel of a partitioned table or a child joi

Re: Global shared meta cache

2018-07-02 Thread Konstantin Knizhnik
On 26.06.2018 09:48, Ideriha, Takeshi wrote: Hi, hackers! My customer created hundreds of thousands of partition tables and tried to select data from hundreds of applications, which resulted in enormous consumption of memory because it consumed # of backend multiplied by # of local memory (

Re: Test-cases for deferred constraints in plpgsql_transaction.sql

2018-07-02 Thread Peter Eisentraut
On 02.07.18 11:46, Ashutosh Sharma wrote: > Currently, I could see only one test-case for deferred constraints in > plpgsql_transaction.sql file which tests if the constraint checking is > happening during commit time or not with the help of COMMIT statement. > Shouldn't we add some more test-cases

Re: Should contrib modules install .h files?

2018-07-02 Thread Andrew Gierth
> "Peter" == Peter Eisentraut writes: >> So I have this immediate problem: a PGXS build of a module, >> specifically an hstore transform for a non-core PL, is much harder >> than it should be because it has no way to get at hstore.h since >> that file is never installed anywhere. >> >>

psql \df option for procedures

2018-07-02 Thread Peter Eisentraut
psql's \df command current has options a/n/t/w to show aggregates/normal/trigger/window functions. Do we want to add something for procedures? -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Re: psql \df option for procedures

2018-07-02 Thread Andrew Gierth
> "Peter" == Peter Eisentraut writes: Peter> psql's \df command current has options a/n/t/w to show Peter> aggregates/normal/trigger/window functions. Do we want to add Peter> something for procedures? yes -- Andrew (irc:RhodiumToad)

Re: How to find the base version cf-bot is using?

2018-07-02 Thread Thomas Munro
On Mon, Jul 2, 2018 at 9:39 PM, Kyotaro HORIGUCHI wrote: >> === applying patch >> ./v4-0001-Remove-entries-that-haven-t-been-used-for-a-certain-.patch > ... >> |Date: Tue, 26 Dec 2017 17:43:09 +0900 > ... >> Patching file src/backend/utils/cache/plancache.c using Plan A... >> Hunk #1 failed at 63

Re: Test-cases for deferred constraints in plpgsql_transaction.sql

2018-07-02 Thread Ashutosh Sharma
On Mon, Jul 2, 2018 at 3:30 PM, Peter Eisentraut wrote: > On 02.07.18 11:46, Ashutosh Sharma wrote: >> Currently, I could see only one test-case for deferred constraints in >> plpgsql_transaction.sql file which tests if the constraint checking is >> happening during commit time or not with the hel

Re: Concurrency bug in UPDATE of partition-key

2018-07-02 Thread Amit Khandekar
On 30 June 2018 at 19:20, Amit Kapila wrote: > On Fri, Jun 29, 2018 at 11:22 PM, Alvaro Herrera > wrote: >> I was a bit surprised by the new epqslot output argument being added, >> and now I think I know why: we already have es_trig_tuple_slot, so >> shouldn't we be using that here instead? See

Re: effect of JIT tuple deform?

2018-07-02 Thread Pierre Ducroquet
On Wednesday, June 27, 2018 5:38:31 PM CEST Pavel Stehule wrote: > 2018-06-27 17:19 GMT+02:00 Tomas Vondra : > > On 06/26/2018 09:25 PM, Pavel Stehule wrote: > >> Hi > >> > >> ... > >> > >> So I am able to see effect of jit_tuple_deforming, and very well, but > >> only if optimization is active.

Re: Cache lookup errors with functions manipulation object addresses

2018-07-02 Thread Michael Paquier
On Sun, Jul 01, 2018 at 12:31:17PM -0400, Andrew Dunstan wrote: > I think you're asserting far too broad a policy for the CF, and in any case > there has been no discussion of what exactly is a large patch. I don't see > any great need to defer patch 3. It is substantial although not what I would >

Re: jsonpath

2018-07-02 Thread Nikita Glukhov
On 28.06.2018 05:39, Thomas Munro wrote: On Thu, Jun 28, 2018 at 11:38 AM, Nikita Glukhov wrote: Attached 15th version of the patches. Hi Nikita, I wonder why the Windows build scripts are not finding and processing your new .y and .l files: https://ci.appveyor.com/project/postgresql-cfbot/

Re: Avoid extra Sort nodes between WindowAggs when sorting can be reused

2018-07-02 Thread Masahiko Sawada
On Mon, Jul 2, 2018 at 5:25 PM, Daniel Gustafsson wrote: >> On 26 Jun 2018, at 17:11, Alexander Kuzmenkov >> wrote: > >> I took a look at the patch. It applies and compiles, the tests pass. > > Thanks for reviewing, and apologies for the slow response. > >> Some thoughts about the code: >> >> *

Re: branches_of_interest.txt

2018-07-02 Thread Robert Haas
On Mon, Jul 2, 2018 at 4:39 AM, Peter Eisentraut wrote: > On 01.07.18 17:41, Tom Lane wrote: >> I can see the value of people other than you being able to change it, >> but keeping it in the core repo seems like a kluge not a proper solution. >> In particular, once it'd been around for awhile so t

Re: ERROR: cannot start subtransactions during a parallel operation

2018-07-02 Thread Robert Haas
On Sun, Jul 1, 2018 at 5:02 AM, Mai Peng wrote: > Hello, how could I relax the subtransaction restriction, I used the Parallel > Unsafe option, but still have the same issue. There's no user option for that. Somebody would need to enhance PostgreSQL by writing a patch. I agree with Andres that

Re: branches_of_interest.txt

2018-07-02 Thread Andrew Dunstan
On Mon, Jul 2, 2018 at 4:45 AM, Magnus Hagander wrote: > > > On Mon, Jul 2, 2018 at 10:39 AM, Peter Eisentraut > wrote: >> >> On 01.07.18 17:41, Tom Lane wrote: >> > I can see the value of people other than you being able to change it, >> > but keeping it in the core repo seems like a kluge not a

Re: Explain buffers wrong counter with parallel plans

2018-07-02 Thread Robert Haas
On Fri, Jun 29, 2018 at 6:12 PM, Tom Lane wrote: > Alvaro Herrera writes: >> I'm CCing Tom here, as author of the patch that caused (most of) the >> issue. > > Uh ... me? I thought this was a parallel-query issue, which I've > pretty much not been involved in. Well, it was your commit that caus

Re: Explain buffers wrong counter with parallel plans

2018-07-02 Thread Robert Haas
On Sun, Jun 10, 2018 at 1:18 AM, Amit Kapila wrote: > Right, I think we have following options: > (a) Come up with a solution which allows percolating the buffer usage > and or similar stats to upper nodes in all cases. > (b) Allow it to work for some of the cases as it was earlier. > > I think (b

Re: branches_of_interest.txt

2018-07-02 Thread Robert Haas
On Mon, Jul 2, 2018 at 8:18 AM, Andrew Dunstan wrote: > Ideally this would be done as part of creating the new branch. Since > the web site doesn't have the same set of committers, a second metdata > repo like this seems sensible. > An alternative would be to create a special branch within the cor

Re: branches_of_interest.txt

2018-07-02 Thread Andrew Dunstan
On Mon, Jul 2, 2018 at 8:33 AM, Robert Haas wrote: > On Mon, Jul 2, 2018 at 8:18 AM, Andrew Dunstan > wrote: >> Ideally this would be done as part of creating the new branch. Since >> the web site doesn't have the same set of committers, a second metdata >> repo like this seems sensible. >> An al

Re: branches_of_interest.txt

2018-07-02 Thread Tom Lane
Robert Haas writes: > On Mon, Jul 2, 2018 at 8:18 AM, Andrew Dunstan > wrote: >> An alternative would be to create a special branch within the core >> repo for such data, something like this (The first two lines are the >> ones that are most important): >> ... >> The new branch won't share any hi

Re: [PATCH] Include application_name in "connection authorized" log message

2018-07-02 Thread Don Seiler
On Mon, Jul 2, 2018 at 2:13 AM, Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > On 21.06.18 16:21, Don Seiler wrote: > > - (errmsg("connection > > authorized: user=%s database=%s", > > - > > port->user_name, port->database_name))); > > +

Re: psql \df option for procedures

2018-07-02 Thread Fabrízio de Royes Mello
On Mon, Jul 2, 2018 at 7:07 AM, Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > > psql's \df command current has options a/n/t/w to show > aggregates/normal/trigger/window functions. Do we want to add something > for procedures? > +1. I can write a patch to save your time If you don

Re: Monitoring time of fsyncing WALs

2018-07-02 Thread Michael Paquier
On Mon, Jul 02, 2018 at 11:36:06AM +0800, Craig Ringer wrote: > On 1 July 2018 at 11:29, Michael Paquier wrote: >> So at the end, I would like to use the proposed patch and call it a >> day. Thoughts? >> > Patch looks good. Thanks Craig for the review! I have just pushed the previous patch with

Re: Should contrib modules install .h files?

2018-07-02 Thread Tom Lane
Andrew Gierth writes: > I'm thinking that $(includedir_server)/$(MODULEDIR) would be a > reasonable place? MODULEDIR defaults to either "contrib" or "extension" > depending on whether EXTENSION is set. > Something like the attached patch seem reasonable? FWIW, I agree with Andres' thought that ea

Re: Test-cases for deferred constraints in plpgsql_transaction.sql

2018-07-02 Thread Tom Lane
Ashutosh Sharma writes: > On Mon, Jul 2, 2018 at 3:30 PM, Peter Eisentraut > wrote: >> I won't say we don't need more tests, but I don't see a particular >> testing gap in this area. > I am not saying that the existing test-case is not enough to test > deferred constraints but, it would have bee

Re: PANIC during crash recovery of a recently promoted standby

2018-07-02 Thread Michael Paquier
On Mon, Jul 02, 2018 at 04:25:13PM +0900, Kyotaro HORIGUCHI wrote: > When minRecoveryPoint is invalid, there're only two possible > cases. It may be at very beginning of archive reovery or may be > running a crash recovery. In the latter case, we have detected > crash recovery before redo starts. S

Re: [HACKERS] Fix performance degradation of contended LWLock on NUMA

2018-07-02 Thread Jesper Pedersen
Hi, On 03/01/2018 10:50 AM, Jesper Pedersen wrote: As the patch still applies, make check-world passes and I believe that Yura has provided feedback for Andres' comments I'll leave this entry in "Ready for Committer". The patch from November 27, 2017 still applies (with hunks), passes "mak

Re: Should contrib modules install .h files?

2018-07-02 Thread Andrew Gierth
> "Tom" == Tom Lane writes: > Andrew Gierth writes: >> I'm thinking that $(includedir_server)/$(MODULEDIR) would be a >> reasonable place? MODULEDIR defaults to either "contrib" or >> "extension" depending on whether EXTENSION is set. Something like >> the attached patch seem reasonable

Re: Should contrib modules install .h files?

2018-07-02 Thread Tom Lane
Andrew Gierth writes: > "Tom" == Tom Lane writes: > Tom> FWIW, I agree with Andres' thought that each contrib module should > Tom> have its own subdirectory under $(includedir_server). Otherwise > Tom> we're going to be faced with questions about whether .h files need > Tom> to be renamed bec

Re: [WIP] [B-Tree] Retail IndexTuple deletion

2018-07-02 Thread Andrey V. Lepikhov
On 29.06.2018 14:07, Юрий Соколов wrote: чт, 28 июн. 2018 г., 8:37 Andrey V. Lepikhov >: On 28.06.2018 05:00, Peter Geoghegan wrote: > On Tue, Jun 26, 2018 at 11:40 PM, Andrey V. Lepikhov > mailto:a.lepik...@postgrespro.ru>> wrote: >> I st

Old small commitfest items

2018-07-02 Thread Andrew Dunstan
Andres talked about us concentrating on old items and very small items. Here's a list of items that are both old and small (FSVO "small"): The first number is the CF item number, the second the patch line count: 528 1146 Fix the optimization to skip WAL-logging on table created in same transactio

Re: Should contrib modules install .h files?

2018-07-02 Thread Andrew Gierth
> "Tom" == Tom Lane writes: >> A slight snag in trying to use a subdir for each module is that >> there is not in fact anywhere in the existing makefiles that uses or >> assigns such a name. Indeed some contrib subdirs install multiple >> modules. Tom> So, given that we have to add some

Re: Test-cases for deferred constraints in plpgsql_transaction.sql

2018-07-02 Thread Ashutosh Sharma
On Mon, Jul 2, 2018 at 7:07 PM, Tom Lane wrote: > Ashutosh Sharma writes: >> On Mon, Jul 2, 2018 at 3:30 PM, Peter Eisentraut >> wrote: >>> I won't say we don't need more tests, but I don't see a particular >>> testing gap in this area. > >> I am not saying that the existing test-case is not eno

Re: Should contrib modules install .h files?

2018-07-02 Thread Andrew Gierth
> "Tom" == Tom Lane writes: Tom> BTW, it's somewhat interesting to think about whether we ought to Tom> change the coding conventions so that extensions refer to their Tom> own headers with a subdirectory, e.g., #include "bloom/bloom.h". Tom> Having done that, all of contrib could build w

Re: branches_of_interest.txt

2018-07-02 Thread Andres Freund
On 2018-07-01 11:41:07 -0400, Tom Lane wrote: > Andrew Dunstan writes: > > This file on the buildfarm server is used to tell clients which branches > > we'd like built. When a new stable branch is created it's added manually > > to this file, and when one gets to EOL it's removed from the file.

Re: Should contrib modules install .h files?

2018-07-02 Thread Andres Freund
On 2018-07-02 16:11:07 +0100, Andrew Gierth wrote: > > "Tom" == Tom Lane writes: > > >> A slight snag in trying to use a subdir for each module is that > >> there is not in fact anywhere in the existing makefiles that uses or > >> assigns such a name. Indeed some contrib subdirs install mu

Re: ERROR: cannot start subtransactions during a parallel operation

2018-07-02 Thread Andres Freund
Hi, On 2018-07-01 11:02:24 +0200, Mai Peng wrote: > Hello, how could I relax the subtransaction restriction, I used the > Parallel Unsafe option, but still have the same issue. > Rgds. I'm unclear why you still get the error. Could you please give us the query triggering the error, including an e

Re: Should contrib modules install .h files?

2018-07-02 Thread Tom Lane
Andrew Gierth writes: > "Tom" == Tom Lane writes: > Tom> So, given that we have to add something to the module makefiles > Tom> anyway, we could also add a macro specifying the subdirectory name > Tom> to use. (Although in practice this should always be equal to the > Tom> contrib/ subdirecto

Re: branches_of_interest.txt

2018-07-02 Thread Tom Lane
Andres Freund writes: > On 2018-07-01 11:41:07 -0400, Tom Lane wrote: >> I can see the value of people other than you being able to change it, >> but keeping it in the core repo seems like a kluge not a proper solution. > FWIW, I've a manually maintained version of this in the scripts I use to >

Re: pgsql: Fix "base" snapshot handling in logical decoding

2018-07-02 Thread Arseny Sher
Arseny Sher writes: > There is also one thing that puzzles me as I don't know much about > vacuum internals. If I do plain VACUUM of pg_attribute in the test, it > shouts "catalog is missing 1 attribute(s) for relid" error (which is > quite expected), while with 'VACUUM FULL pg_attribute' the tu

Re: Tips on committing

2018-07-02 Thread Stephen Frost
Greetings, * Peter Geoghegan (p...@bowt.ie) wrote: > FWIW, I developed a document on committing for my own reference, with > some help from Andres. A lot of it is about commit message style, the > use of fields, and so on. But I've also developed a check list for > committing, knowing that there a

Re: [HACKERS] [PATCH] kNN for SP-GiST

2018-07-02 Thread Alexander Korotkov
Hi! On Fri, Jun 29, 2018 at 5:37 PM Nikita Glukhov wrote: > On 06.03.2018 17:30, David Steele wrote: > > > I agree with Andres. Pushing this patch to the next CF. > > Attached 4th version of the patches rebased onto the current master. > Nothing interesting has changed from the previous version.

Re: Tips on committing

2018-07-02 Thread Alvaro Herrera
On 2018-Jul-02, Stephen Frost wrote: > > * Do a dry run before really pushing by using --dry-run. > > In addition to this, I'd recommend using 'git show' on the results of > the --dry-run, so that you see what you're really about to push. Since commit 653530c8b196 I use this little script I borr

Re: [WIP] [B-Tree] Retail IndexTuple deletion

2018-07-02 Thread Peter Geoghegan
On Mon, Jul 2, 2018 at 7:29 AM, Andrey V. Lepikhov wrote: > In the new version the patch [1] was used in cooperation with 'retail > indextuple deletion' and 'quick vacuum strategy' patches (see > '0004-Retail-IndexTuple-Deletion-with-TID-sorting-in-leaf-.patch'. Cool. I'm going to post a revised

Re: psql \df option for procedures

2018-07-02 Thread Isaac Morland
While you're looking at \df, you might want to consider removing the display of source code (we have \sf for that, and it takes up a lot of space), and add a column to display access permissions (who can execute the function). On 2 July 2018 at 09:22, Fabrízio de Royes Mello wrote: > On Mon, Jul

Proposed fix for Bug #15259 (invalid empty array returned by intarray "&" operator)

2018-07-02 Thread Alexey Kryuchkov
The attached patch fixes Bug #15259 [1] in the intarray module, making the '&' array intersection operator return proper zero-dimensional empty arrays instead of one-dimensional, zero-length "empty" arrays. In [2] this problem was addressed by changing the behaviour of construct_[md_]array(), but

Re: Making all nbtree entries unique by having heap TIDs participate in comparisons

2018-07-02 Thread Peter Geoghegan
On Thu, Jun 14, 2018 at 11:44 AM, Peter Geoghegan wrote: > I attach an unfinished prototype of suffix truncation, that also > sometimes *adds* a new attribute in pivot tuples. It adds an extra > heap TID from the leaf level when truncating away non-distinguishing > attributes during a leaf page sp

Re: Regression on PostgreSQL 10 ORDER/GROUP BY expression not found in targetlist

2018-07-02 Thread Robert Haas
On Sat, Jun 30, 2018 at 5:38 PM, Tom Lane wrote: > I also think that there's some horribly unsafe coding in > apply_scanjoin_target_to_paths: it clobbers a RelOptInfo's reltarget, > with no thought for whether that might affect things elsewhere, > and it also clobbers individual paths' PathTargets

Re: alter index WITH ( storage_parameter = value [, ... ] ) for partition index.

2018-07-02 Thread Robert Haas
On Wed, Jun 27, 2018 at 5:42 AM, Rajkumar Raghuwanshi wrote: > postgres=# alter index part_idx reset (fillfactor); > ERROR: "part_idx" is not a table, view, materialized view, or index I don't know whether that should work, but it seems like the error message needs improvement, at the least. --

Re: Fix error message when trying to alter statistics on included column

2018-07-02 Thread Robert Haas
On Thu, Jun 28, 2018 at 5:28 AM, Yugo Nagata wrote: > According to the error message, it is not allowed to alter statistics on > included column because this is "non-expression column". > > postgres=# create table test (i int, d int); > CREATE TABLE > postgres=# create index idx on test(i) incl

Re: Should contrib modules install .h files?

2018-07-02 Thread Andrew Gierth
> "Tom" == Tom Lane writes: >> How about this: it's most likely that modules that install include >> files will also be using MODULE_big, so use that as the default >> name; if a makefile that uses only MODULES also wants to install >> include files, have it define MODULE_NAME (or some su

Re: shared-memory based stats collector

2018-07-02 Thread Robert Haas
On Fri, Jun 29, 2018 at 4:34 AM, Kyotaro HORIGUCHI wrote: > Nowadays PostgreSQL has dynamic shared hash (dshash) so we can > use this as the main storage of statistics. We can share data > without a stress using this. > > A PoC previously posted tried to use "locally copied" dshash but > it doesn'

Re: Add --include-table-data-where option to pg_dump, to export only a subset of table data

2018-07-02 Thread Robert Haas
On Fri, Jun 29, 2018 at 8:09 AM, Surafel Temesgen wrote: > hey, > i am reviewing this patch > On Thu, May 31, 2018 at 4:49 AM, Carter Thaxton > wrote: >> >> >> pg_dump --where '"foo:bar":created_at >= '2018-05-01'" dbname > > it would be more sqlish if it specified like: > --table=foo --where =

Re: Unexpected behavior of DROP VIEW/TABLE IF EXISTS

2018-07-02 Thread Robert Haas
On Tue, Jun 26, 2018 at 1:06 PM, Tom Lane wrote: > Certainly we *could* change it, but it's not at all clear that it's a good > idea. The current behavior seemed sensible when it was implemented, and > it has stood for quite some years now. Now, we have one person > complaining that it wasn't wh

Re: [Proposal] Table-level Transparent Data Encryption (TDE) and Key Management Service (KMS)

2018-07-02 Thread Alvaro Hernandez
On 11/06/18 12:22, Masahiko Sawada wrote: On Fri, May 25, 2018 at 8:41 PM, Moon, Insung wrote: Hello Hackers, This propose a way to develop "Table-level" Transparent Data Encryption (TDE) and Key Management Service (KMS) support in PostgreSQL. Issues on data encryption of PostgreSQL

Re: [Proposal] Table-level Transparent Data Encryption (TDE) and Key Management Service (KMS)

2018-07-02 Thread Alvaro Hernandez
On 21/06/18 21:43, Nico Williams wrote: On Fri, May 25, 2018 at 08:41:46PM +0900, Moon, Insung wrote: Issues on data encryption of PostgreSQL == Currently, in PostgreSQL, data encryption can be using pgcrypto Tool. However, it is inconvenient to use pgcrypto to encrypts data in some c

Re: Speedup of relation deletes during recovery

2018-07-02 Thread Fujii Masao
On Thu, Jun 28, 2018 at 3:23 AM, Andres Freund wrote: > On 2018-06-28 03:21:51 +0900, Fujii Masao wrote: >> On Wed, Jun 27, 2018 at 10:44 AM, Thomas Munro >> wrote: >> > On Wed, Jun 27, 2018 at 1:13 PM, Thomas Munro >> > wrote: >> >> On Wed, Jun 27, 2018 at 12:16 PM, Thomas Munro >> >> wrote: >

Re: [WIP] [B-Tree] Retail IndexTuple deletion

2018-07-02 Thread Peter Geoghegan
On Mon, Jul 2, 2018 at 9:28 AM, Peter Geoghegan wrote: >> Execution time of last "VACUUM test;" command on my notebook was: >> >> with bulk deletion: 1.6 s; >> with Quick Vacuum Strategy: 5.2 s; >> with Quick Vacuum Strategy & TID sorting: 0.6 s. > > I'm glad that you looked into this. You could m

Re: Should contrib modules install .h files?

2018-07-02 Thread Andrew Gierth
> "Andrew" == Andrew Gierth writes: Andrew> OK, I'm working on an updated patch and here it is. This installs to $(includedir_server)/$(MODULEDIR)/$MODULE/file.h (e.g. include/server/extension/hstore/hstore.h for an actual example), and errors if HEADERS_xxx is defined for anything that's

Re: Should contrib modules install .h files?

2018-07-02 Thread Tom Lane
Andrew Gierth writes: > Two questions arise: > 1) include/server has a lot of files and subdirs, so using >include/server/$(MODULE)/ looks likely to be error-prone. So it >should be something like include/server/contrib/$(MODULE)/ or >include/server/extension/$(MODULE)/. Which one, or

Re: Should contrib modules install .h files?

2018-07-02 Thread Andrew Gierth
> "Tom" == Tom Lane writes: Tom> Might as well follow the MODULEDIR precedent (though I'm not wedded Tom> to that if somebody has an argument for something else). [...] Tom> I'd definitely vote for "error". Likewise if any .h file listed in Tom> the macro doesn't exist. OK, so that mat

Re: Avoid extra Sort nodes between WindowAggs when sorting can be reused

2018-07-02 Thread Daniel Gustafsson
> On 2 Jul 2018, at 14:01, Masahiko Sawada wrote: > Thank you for updating the patch! There are two review comments. Thanks for reviewing! > The current select_active_windows() function compares the all fields > of WindowClause for the sorting but with this patch we compare only > tleSortGroupR

Re: Unexpected behavior of DROP VIEW/TABLE IF EXISTS

2018-07-02 Thread Tom Lane
Robert Haas writes: > On Tue, Jun 26, 2018 at 1:06 PM, Tom Lane wrote: >> Certainly we *could* change it, but it's not at all clear that it's a good >> idea. The current behavior seemed sensible when it was implemented, and >> it has stood for quite some years now. Now, we have one person >> co

Re: [HACKERS] Small improvement to compactify_tuples

2018-07-02 Thread Andrew Dunstan
On 03/04/2018 04:57 AM, Yura Sokolov wrote: BTW, I have small change to templated version that improves sorting of random tuples a bit (1-1.5%). Will post it a bit later with test. There doesn't seem to have been any progress since this email. cheers andrew -- Andrew Dunstan

Re: Add --include-table-data-where option to pg_dump, to export only a subset of table data

2018-07-02 Thread Carter Thaxton
The whole reason for the colon in the --where option is to indicate which table the WHERE clause should refer to, so that one can dump less than all of the rows. The --table option is totally different. It specifies which tables to dump at all. If I provide a --where option, and no --table option

Re: [Proposal] Table-level Transparent Data Encryption (TDE) and Key Management Service (KMS)

2018-07-02 Thread Nico Williams
On Mon, Jul 02, 2018 at 06:56:34PM +0300, Alvaro Hernandez wrote: > On 21/06/18 21:43, Nico Williams wrote: > >Incidentally, PG w/ pgcrypto and FDW does provide everything one needs > >to be able to implement client-side crypto: > > > > - use PG w/ FDW as a client-side proxy for the real DB > > -

Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints

2018-07-02 Thread Nico Williams
On Tue, Jun 26, 2018 at 04:54:13PM -0400, Robbie Harwood wrote: > Nico Williams writes: > > > [Re-send; first attempt appears to have hit /dev/null somewhere. My > > apologies if you get two copies.] > > > > I've finally gotten around to rebasing this patch and making the change > > that was req

Re: Threat models for DB cryptography (Re: [Proposal] Table-level Transparent Data Encryption (TDE) and Key) Management Service (KMS)

2018-07-02 Thread Nico Williams
On Mon, Jul 02, 2018 at 06:22:46PM +0900, Masahiko Sawada wrote: > On Fri, Jun 22, 2018 at 2:31 PM, Tsunakawa, Takayuki > wrote: > > From: Nico Williams [mailto:n...@cryptonector.com] > > > >> One shortcoming of relying on OS functionality for protection against > >> malicious storage is that not

Re: Protect syscache from bloating with negative cache entries

2018-07-02 Thread Andrew Dunstan
On 06/26/2018 05:00 AM, Kyotaro HORIGUCHI wrote: The attached is the patch set including this plancache stuff. 0001- catcache time-based expiration (The origin of this thread) 0002- introduces dynahash pruning feature 0003- implement relcache pruning using 0002 0004- (perhaps) independent f

Re: How to find the base version cf-bot is using?

2018-07-02 Thread Kyotaro HORIGUCHI
Hello. Thomas. At Mon, 2 Jul 2018 22:14:42 +1200, Thomas Munro wrote in > On Mon, Jul 2, 2018 at 9:39 PM, Kyotaro HORIGUCHI > wrote: > >> === applying patch > >> ./v4-0001-Remove-entries-that-haven-t-been-used-for-a-certain-.patch > > ... > >> |Date: Tue, 26 Dec 2017 17:43:09 +0900 > > ... >

Re: Protect syscache from bloating with negative cache entries

2018-07-02 Thread Kyotaro HORIGUCHI
Hello. The previous v4 patchset was just broken. At Tue, 26 Jun 2018 18:00:03 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI wrote in <20180626.180003.127457941.horiguchi.kyot...@lab.ntt.co.jp> > Hello. I rebased this patchset. .. > > The attached is the patch set including this plancache stuff

RE: automatic restore point

2018-07-02 Thread Yotsunaga, Naoki
Hi. Thanks for comments. Explanation of the background of the function proposal was inadequate. So, I explain again. I assume the following situation. User needs to make a quick, seemingly simple fix to an important production database. User composes the query, gives it an once-over, and lets it

RE: automatic restore point

2018-07-02 Thread Yotsunaga, Naoki
Hi. Thanks for comments. >There is also recovery_target_lsn which is new as of v10. In this method, it is necessary to look at a lsn position before operating. But I assume the user who did not look it before operating. So I think that this method is not appropriate. > So basically what you ar

Re: automatic restore point

2018-07-02 Thread Michael Paquier
On Tue, Jul 03, 2018 at 01:07:41AM +, Yotsunaga, Naoki wrote: >> There is also recovery_target_lsn which is new as of v10. > In this method, it is necessary to look at a lsn position before operating. > But I assume the user who did not look it before operating. > So I think that this method

Re: automatic restore point

2018-07-02 Thread Michael Paquier
On Tue, Jul 03, 2018 at 01:06:31AM +, Yotsunaga, Naoki wrote: >> I'd rather spend effort making the initial execution of said commands >> less likely. > > I think that the function to prohibit DELETE and UPDATE without a > WHERE clause in the later response is good way. This has popped up alre

Re: Old small commitfest items

2018-07-02 Thread Michael Paquier
On Mon, Jul 02, 2018 at 10:30:11AM -0400, Andrew Dunstan wrote: > 528 1146 Fix the optimization to skip WAL-logging on table created in > same transaction This has been around for an astonishing amount of time... I don't recall all the details but rewriting most of the relation sync handling arou

Re: Add --include-table-data-where option to pg_dump, to export only a subset of table data

2018-07-02 Thread Michael Paquier
On Mon, Jul 02, 2018 at 03:11:46PM -0700, Carter Thaxton wrote: > Also, there may be some misunderstanding about "foo:bar" above. That's an > example of using a namespaced table, where "bar" is a table in the > namespace "foo". Normally, assuming your table is named "bar" in the > default namespa

Re: Protect syscache from bloating with negative cache entries

2018-07-02 Thread Alvaro Herrera
On 2018-Jul-02, Andrew Dunstan wrote: > Andres suggested back in March (and again privately to me) that given how > much this has changed from the original this CF item should be marked > Returned With Feedback and the current patchset submitted as a new item. > > Does anyone object to that cours

Re: Protect syscache from bloating with negative cache entries

2018-07-02 Thread Andres Freund
Hi, On 2018-07-02 21:50:36 -0400, Alvaro Herrera wrote: > On 2018-Jul-02, Andrew Dunstan wrote: > > > Andres suggested back in March (and again privately to me) that given how > > much this has changed from the original this CF item should be marked > > Returned With Feedback and the current patc

Re: automatic restore point

2018-07-02 Thread Jaime Casanova
On Mon, 2 Jul 2018 at 20:07, Yotsunaga, Naoki wrote: > > Hi. Thanks for comments. > > Explanation of the background of the function proposal was inadequate. > So, I explain again. > > I assume the following situation. > User needs to make a quick, seemingly simple fix to an important production >

Re: Speedup of relation deletes during recovery

2018-07-02 Thread Michael Paquier
On Tue, Jul 03, 2018 at 04:13:15AM +0900, Fujii Masao wrote: > OK, so what about the attached patch? I have been looking at this patch, and this looks in good shape to me (please indent!). +* Call smgrclose() in reverse order as when smgropen() is called. +* This trick enables remove_from

  1   2   >