Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands: \quit_if, \quit_unless)

2017-01-29 Thread Corey Huinker
> > My point is that examples about one thing can be interpreted as example > for other things which is also done in the example, so it is better to do > everything right. > Fair enough. I'll rewrite the examples to use pk lookups. I doubt the query plan for those will change much in the future.

Re: [HACKERS] Create a separate test file for exercising system views

2017-01-29 Thread Andres Freund
Hi, On 2017-01-29 16:02:21 -0500, Tom Lane wrote: > I did not do anything about testing the various pg_stat_xxx views. > Those could be added later, or maybe they deserve their own home. > (In many cases, those would need something smarter than the basic > count(*) technique used here, because

[HACKERS] Create a separate test file for exercising system views

2017-01-29 Thread Tom Lane
In connection with the "pg_hba_file_settings view patch" thread, I was wondering where we could logically insert a regression test case for that view. I realized that there is no natural home for it among the existing regression tests, because it's not really connected to any SQL language

Re: [HACKERS] CONNECTION LIMIT and Parallel Query don't play well together

2017-01-29 Thread David Rowley
On 27 January 2017 at 03:53, Robert Haas wrote: > Sorry, this had slipped through the cracks -- I'm having a very hard > time keeping up with the flow of patches and emails. But it looks > good to me, except that it seems like CountDBBackends() needs the same > fix (and

Re: [HACKERS] Performance improvement for joins where outer side is unique

2017-01-29 Thread David Rowley
On 28 January 2017 at 05:04, Tom Lane wrote: > David Rowley writes: >> I agree that special handling of one join type is not so pretty. >> However, LEFT JOINs still remain a bit special as they're the only >> ones we currently perform join

Re: [HACKERS] [PATCH] Rename pg_switch_xlog to pg_switch_wal

2017-01-29 Thread Michael Paquier
On Sat, Jan 28, 2017 at 12:43 PM, David Steele wrote: > The problem I have with aliases is that they would need to be done across > the board. At the least, we would need function aliases, symlinks for the > binaries (which would rneed to be done by the packagers), aliases

Re: [HACKERS] Superowners

2017-01-29 Thread Stephen Frost
* Peter Eisentraut (peter.eisentr...@2ndquadrant.com) wrote: > On 1/26/17 1:25 PM, Simon Riggs wrote: > > That should include the ability to dump all objects, yet without any > > security details. And it should allow someone to setup logical > > replication easily, including both trigger based and

Re: [HACKERS] pg_ls_dir & friends still have a hard-coded superuser check

2017-01-29 Thread David Fetter
On Thu, Jan 26, 2017 at 08:50:27AM -0500, Robert Haas wrote: > On Wed, Jan 25, 2017 at 10:31 PM, Stephen Frost wrote: > > Frankly, I get quite tired of the argument essentially being made > > here that because pg_ls_dir() wouldn't grant someone superuser > > rights, that we

Re: [HACKERS] pg_ls_dir & friends still have a hard-coded superuser check

2017-01-29 Thread Robert Haas
On Sun, Jan 29, 2017 at 5:39 PM, David Fetter wrote: > On Thu, Jan 26, 2017 at 08:50:27AM -0500, Robert Haas wrote: >> On Wed, Jan 25, 2017 at 10:31 PM, Stephen Frost wrote: >> > Frankly, I get quite tired of the argument essentially being made >> > here

Re: [HACKERS] pg_ls_dir & friends still have a hard-coded superuser check

2017-01-29 Thread David Fetter
On Sun, Jan 29, 2017 at 05:52:51PM -0500, Robert Haas wrote: > On Sun, Jan 29, 2017 at 5:39 PM, David Fetter wrote: > > On Thu, Jan 26, 2017 at 08:50:27AM -0500, Robert Haas wrote: > >> On Wed, Jan 25, 2017 at 10:31 PM, Stephen Frost wrote: > >> > Frankly, I

Re: [HACKERS] [PATCH] Rename pg_switch_xlog to pg_switch_wal

2017-01-29 Thread Andres Freund
On 2017-01-28 08:47:03 +0900, Michael Paquier wrote: > On Sat, Jan 28, 2017 at 8:03 AM, Peter Eisentraut > wrote: > > On 1/26/17 2:05 PM, Robert Haas wrote: > >> I do not think it can be right to rename the directory and not > >> anything else. > > > > I think

[HACKERS] [PATCH]: fix bug in SP-GiST box_ops

2017-01-29 Thread Nikita Glukhov
Working on the tests for new SP-GiST opclasses for polygons and circles, I've found a bug in the SP-GiST box_ops (added in 9.6): some operators (&<, &>, $<|, |&>) have wrong tests in spg_box_quad_inner_consistent(). This obviously leads to incorrect results of a SP-GiST index scan (see tests in

Re: [HACKERS] Transactions involving multiple postgres foreign servers

2017-01-29 Thread vinayak
On 2017/01/29 0:11, Peter Eisentraut wrote: On 1/26/17 4:49 AM, Masahiko Sawada wrote: Sorry, I attached wrong version patch of pg_fdw_xact_resovler. Please use attached patch. So in some other thread we are talking about renaming "xlog", because nobody knows what the "x" means. In the

Re: [HACKERS] Supporting huge pages on Windows

2017-01-29 Thread Tsunakawa, Takayuki
From: Amit Kapila [mailto:amit.kapil...@gmail.com] > Hmm. It doesn't work even on a command prompt with administrative > privileges. It gives below error: > > waiting for server to start2017-01-17 11:20:13.780 IST [4788] FATAL: > could not create shared memory segment: error code 1450 >

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-29 Thread Michael Paquier
On Mon, Jan 30, 2017 at 11:20 AM, Haribabu Kommi wrote: > On Sun, Jan 29, 2017 at 9:18 AM, Tom Lane wrote: >> tgl wrote: >> > I spent awhile hacking on this, and made a lot of things better, but >> > I'm still very unhappy about the state of the

Re: [HACKERS] WIP: About CMake v2

2017-01-29 Thread Michael Paquier
On Sat, Jan 28, 2017 at 12:20 PM, Peter Eisentraut wrote: > On 1/27/17 6:11 PM, Andres Freund wrote: >> On 2017-01-27 09:09:36 -0500, Peter Eisentraut wrote: >>> My preferred scenario would be to replace the Windows build system by >>> this first, then refine it,

Re: [HACKERS] WIP: About CMake v2

2017-01-29 Thread Andres Freund
On 2017-01-27 22:20:41 -0500, Peter Eisentraut wrote: > On 1/27/17 6:11 PM, Andres Freund wrote: > > On 2017-01-27 09:09:36 -0500, Peter Eisentraut wrote: > >> My preferred scenario would be to replace the Windows build system by > >> this first, then refine it, then get rid of Autoconf. > >> > >>

Re: [HACKERS] Query fails when SRFs are part of FROM clause (Commit id: 69f4b9c85f)

2017-01-29 Thread Rushabh Lathia
On Sat, Jan 28, 2017 at 3:43 AM, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Fri, Jan 27, 2017 at 5:28 AM, Rushabh Lathia > wrote: > >> Consider the below test; >> >> CREATE TABLE tab ( a int primary key); >> >> SELECT * >> FROM pg_constraint pc, >>

Re: [HACKERS] Radix tree for character conversion

2017-01-29 Thread Kyotaro HORIGUCHI
Hello, this is the revised version of character conversion using radix tree. At Fri, 27 Jan 2017 17:33:57 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI wrote in <20170127.173357.221584433.horiguchi.kyot...@lab.ntt.co.jp> > Hi, this is an intermediate report

Re: [HACKERS] Create a separate test file for exercising system views

2017-01-29 Thread Ashutosh Bapat
On Mon, Jan 30, 2017 at 2:32 AM, Tom Lane wrote: > In connection with the "pg_hba_file_settings view patch" thread, I was > wondering where we could logically insert a regression test case for that > view. I realized that there is no natural home for it among the existing >

Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands: \quit_if, \quit_unless)

2017-01-29 Thread Jim Nasby
On 1/29/17 2:35 AM, Fabien COELHO wrote: I'm wondering what pg would do on "EXISTS(SELECT 1 FROM customer)" if there are many employees. [...] I believe that the scan stops on the first row it finds, because the EXITS() clause is met. Hmmm... That is not so clear from "EXPLAIN" output: You

Re: [HACKERS] Superowners

2017-01-29 Thread Stephen Frost
Jim, * Jim Nasby (jim.na...@bluetreble.com) wrote: > On 1/29/17 4:44 PM, Stephen Frost wrote: > >* Peter Eisentraut (peter.eisentr...@2ndquadrant.com) wrote: > >>On 1/26/17 1:25 PM, Simon Riggs wrote: > >>>That should include the ability to dump all objects, yet without any > >>>security details.

Re: [HACKERS] [PATCH] Rename pg_switch_xlog to pg_switch_wal

2017-01-29 Thread Stephen Frost
* Andres Freund (and...@anarazel.de) wrote: > On 2017-01-28 08:47:03 +0900, Michael Paquier wrote: > > On Sat, Jan 28, 2017 at 8:03 AM, Peter Eisentraut > > wrote: > > > On 1/26/17 2:05 PM, Robert Haas wrote: > > >> I do not think it can be right to rename the

Re: [HACKERS] Create a separate test file for exercising system views

2017-01-29 Thread Michael Paquier
On Mon, Jan 30, 2017 at 6:02 AM, Tom Lane wrote: > In connection with the "pg_hba_file_settings view patch" thread, I was > wondering where we could logically insert a regression test case for that > view. I realized that there is no natural home for it among the existing >

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-29 Thread Haribabu Kommi
On Sun, Jan 29, 2017 at 9:18 AM, Tom Lane wrote: > I wrote: > > I spent awhile hacking on this, and made a lot of things better, but > > I'm still very unhappy about the state of the comments. > > I made another pass over this, working on the comments and the docs, > and

Re: [HACKERS] Superowners

2017-01-29 Thread Jim Nasby
On 1/29/17 4:44 PM, Stephen Frost wrote: * Peter Eisentraut (peter.eisentr...@2ndquadrant.com) wrote: On 1/26/17 1:25 PM, Simon Riggs wrote: That should include the ability to dump all objects, yet without any security details. And it should allow someone to setup logical replication easily,

Re: [HACKERS] Transactions involving multiple postgres foreign servers

2017-01-29 Thread Ashutosh Bapat
On Sat, Jan 28, 2017 at 8:41 PM, Peter Eisentraut wrote: > On 1/26/17 4:49 AM, Masahiko Sawada wrote: >> Sorry, I attached wrong version patch of pg_fdw_xact_resovler. Please >> use attached patch. > > So in some other thread we are talking about renaming "xlog",

Re: [HACKERS] Improvements in psql hooks for variables

2017-01-29 Thread Rahila Syed
Hello, Please consider following comments on the patch. In function ParseVariableNum, > if (!val || !val[0]) > return false; Check for 'val == NULL' as in above condition is done even in callers of ParseVariableNum(). There should be only one such check. >+ psql_error("Invalid

Re: [HACKERS] sequence data type

2017-01-29 Thread Michael Paquier
On Sat, Jan 28, 2017 at 2:49 AM, Peter Eisentraut wrote: > On 1/25/17 11:57 PM, Michael Paquier wrote: >> @@ -15984,6 +15992,9 @@ dumpSequence(Archive *fout, TableInfo *tbinfo) >> "CREATE SEQUENCE %s\n", >>

Re: [HACKERS] BUG: pg_stat_statements query normalization issues with combined queries

2017-01-29 Thread Kyotaro HORIGUCHI
Mmm.. At Sat, 28 Jan 2017 11:52:20 +0800, Craig Ringer wrote in > On 28 Jan. 2017 02:08, "Tom Lane" wrote: > > Kyotaro HORIGUCHI writes: > >

Re: [HACKERS] Review: GIN non-intrusive vacuum of posting tree

2017-01-29 Thread Andrew Borodin
2017-01-25 12:09 GMT+05:00 Andrew Borodin : > 2017-01-24 22:29 GMT+05:00 Jeff Davis : >> By the way, can you show me where the Lehman and Yao paper addresses >> page recycling? > > Here J. Hellerstein comments L paper [1] saying that effectively > there is

Re: [HACKERS] Transactions involving multiple postgres foreign servers

2017-01-29 Thread Masahiko Sawada
On Mon, Jan 30, 2017 at 12:50 PM, Ashutosh Bapat wrote: > On Sat, Jan 28, 2017 at 8:41 PM, Peter Eisentraut > wrote: >> On 1/26/17 4:49 AM, Masahiko Sawada wrote: >>> Sorry, I attached wrong version patch of pg_fdw_xact_resovler.

Re: [HACKERS] pgbench - allow to store select results into variables

2017-01-29 Thread Fabien COELHO
Please pardon the redondance: this is a slightly edited repost from another thread where motivation for this patch was discussed, so that it appear in the relevant thread. Tom> [...] there was immediately objection as to whether his idea of TPC-B Tom> compliance was actually right.

Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands: \quit_if, \quit_unless)

2017-01-29 Thread Fabien COELHO
Hello, I'm wondering what pg would do on "EXISTS(SELECT 1 FROM customer)" if there are many employees. [...] I believe that the scan stops on the first row it finds, because the EXITS() clause is met. Hmmm... That is not so clear from "EXPLAIN" output: Result (cost=0.03..0.04 rows=1

Re: [HACKERS] Cache Hash Index meta page.

2017-01-29 Thread Mithun Cy
> HashMetaPage _hash_getcachedmetap(Relation rel, Buffer *metabuf, bool > force_refresh); > > If the cache is initialized and force_refresh is not true, then this > just returns the cached data, and the metabuf argument isn't used. > Otherwise, if *metabuf == InvalidBuffer, we set *metabuf to

Re: [HACKERS] WIP: [[Parallel] Shared] Hash

2017-01-29 Thread Thomas Munro
On Sat, Jan 7, 2017 at 9:01 AM, Thomas Munro wrote: > Stepping back a bit, I am aware of the following approaches to hash > join parallelism: > > 1. Run the inner plan and build a private hash table in each > participant [...]. > > 2. Run a partition-wise hash

Re: [HACKERS] Should buffer of initialization fork have a BM_PERMANENT flag

2017-01-29 Thread Michael Paquier
On Thu, Jan 26, 2017 at 9:14 AM, Michael Paquier wrote: > So the patch attached fixes the problem by changing BufferAlloc() in > such a way that initialization forks are permanently written to disk, > which is what you are suggesting. As a simple fix for back-branches >