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

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

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: 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

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

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

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: 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?

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:

Re: [HACKERS] SERIALIZABLE with parallel query

2018-07-02 Thread Masahiko Sawada
On Fri, Jun 29, 2018 at 7:28 PM, Thomas Munro wrote: > On Thu, Jun 28, 2018 at 7:55 PM, Masahiko Sawada > wrote: >> I'd like to test and review this patches but they seem to conflict >> with current HEAD. Could you please rebase them? > > Hi Sawada-san, > > Thanks! Rebased and attached. The

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: inconsistency and inefficiency in setup_conversion()

2018-07-02 Thread John Naylor
I've attached v4, which is a rebase plus some comment revisions. -John Naylor From 4d1cb1d40c5c79c732e5433e95f8560fb41e20bd Mon Sep 17 00:00:00 2001 From: John Naylor Date: Mon, 2 Jul 2018 12:52:07 +0700 Subject: [PATCH v4 1/2] Add pg_language lookup. This didn't seem worth doing before, but an

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: 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'

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.

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

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))); > +                                           

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

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: 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

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

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

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

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

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

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

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: 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

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

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

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

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

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

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

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.

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

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

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'

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

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

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

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 >

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

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

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 >>

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

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: [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: 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

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: 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: 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: 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

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,

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)

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: 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

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

Re: Remove mention in docs that foreign keys on partitioned tables are not supported

2018-07-02 Thread Robert Haas
On Mon, Jul 2, 2018 at 1:46 AM, Ashutosh Bapat wrote: > This constraint was added to the partitioned table and inherited from > there. If user wants to drop that constraint for some reason, this > error message doesn't help. The error message tells why he can't drop > it, but doesn't tell,

Re: Unexpected behavior of DROP VIEW/TABLE IF EXISTS

2018-07-02 Thread Robert Haas
On Mon, Jul 2, 2018 at 5:25 PM, Tom Lane wrote: > 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

Re: Unexpected behavior of DROP VIEW/TABLE IF EXISTS

2018-07-02 Thread Robert Haas
On Mon, Jul 2, 2018 at 10:33 PM, Robert Haas wrote: > Yes, the original proposal was that we should be relaxed about it. ...in both directions i.e. DROP TABLE would work on a VIEW and DROP VIEW on a table. That definitely seems like it's going too far. > Another possibility that would also

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

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

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

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

Re: Remove mention in docs that foreign keys on partitioned tables are not supported

2018-07-02 Thread Amit Langote
On 2018/07/03 11:49, Robert Haas wrote: > On Mon, Jul 2, 2018 at 1:46 AM, Ashutosh Bapat > wrote: >> This constraint was added to the partitioned table and inherited from >> there. If user wants to drop that constraint for some reason, this >> error message doesn't help. The error message tells

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

Re: Copy function for logical replication slots

2018-07-02 Thread Michael Paquier
On Mon, Jul 02, 2018 at 04:31:32PM +0900, Masahiko Sawada wrote: > Attached an updated patch including copy function support for logical > slots as well as physical slots. Please review it. I had a look at this patch. As the output plugin can be changed for logical slots, having two functions is

Re: pgsql: Clarify use of temporary tables within partition trees

2018-07-02 Thread Michael Paquier
On Tue, Jul 03, 2018 at 12:59:33PM +1200, David Rowley wrote: > On 3 July 2018 at 10:16, Michael Paquier wrote: >> On Mon, Jul 02, 2018 at 02:07:37PM -0400, Robert Haas wrote: >>> I'd rather keep an elog(ERROR) than completely remove the check. >> >> +1. > > Attached Okay, the patch looks

Re: Possible bug in logical replication.

2018-07-02 Thread Michael Paquier
On Thu, Jun 21, 2018 at 07:31:20PM +0900, Michael Paquier wrote: > Could it be possible to get a patch from all the feedback and exchange > gathered here? Petr, I think that it would not hurt if you use the set > of words and comments you think is most adapted as the primary author of > the

Re: Possible bug in logical replication.

2018-07-02 Thread Alvaro Herrera
On 2018-Jul-03, Michael Paquier wrote: > On Thu, Jun 21, 2018 at 07:31:20PM +0900, Michael Paquier wrote: > > Could it be possible to get a patch from all the feedback and exchange > > gathered here? Petr, I think that it would not hurt if you use the set > > of words and comments you think is

Re: Remove mention in docs that foreign keys on partitioned tables are not supported

2018-07-02 Thread Ashutosh Bapat
On Tue, Jul 3, 2018 at 8:19 AM, Robert Haas wrote: > On Mon, Jul 2, 2018 at 1:46 AM, Ashutosh Bapat > wrote: >> This constraint was added to the partitioned table and inherited from >> there. If user wants to drop that constraint for some reason, this >> error message doesn't help. The error

Re: Should contrib modules install .h files?

2018-07-02 Thread Craig Ringer
On 2 July 2018 at 02: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

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: 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

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

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

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 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

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

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

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

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

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

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

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

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

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/

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

  1   2   >