Re: [HACKERS] Floating point comparison inconsistencies of the geometric types

2016-06-01 Thread Jim Nasby
On 6/1/16 10:03 AM, Paul Ramsey wrote: We don't depend on these, we have our own :/ The real answer for a GIS system is to have an explicit tolerance parameter for calculations like distance/touching/containment, but unfortunately we didn't do that so now we have our own compatibility/boil the

Re: [HACKERS] PostmasterPid not marked with PGDLLIMPORT

2016-06-01 Thread Alvaro Herrera
Robert Haas wrote: > On Wed, Jun 1, 2016 at 12:06 AM, Craig Ringer wrote: > > On 1 June 2016 at 11:48, Michael Paquier wrote: > >> Could it be possible to mark PostmasterPid with PGDLLIMPORT on HEAD > >> and back-branches? > > > > Sounds sensible

Re: [HACKERS] Parallel safety tagging of extension functions

2016-06-01 Thread Andreas Karlsson
On 06/01/2016 05:15 PM, Tom Lane wrote: Andreas Karlsson writes: On 06/01/2016 04:44 PM, Tom Lane wrote: I don't understand why you think you need the CREATE OR REPLACE FUNCTION commands? We only need to change proargtypes, and the updates did that. The catcache can take

Re: [HACKERS] JSON[B] arrays are second-class citizens

2016-06-01 Thread David G. Johnston
On Wed, Jun 1, 2016 at 11:55 AM, Jim Nasby wrote: > On 5/31/16 7:04 PM, Peter van Hardenberg wrote: > >> The idea of converting a JSONB array to a PG array is appealing and >> would potentially be more general-purpose than adding a new unnest. I'm >> not sure how

Re: [HACKERS] JSON[B] arrays are second-class citizens

2016-06-01 Thread David Fetter
On Tue, May 31, 2016 at 06:15:32PM -0400, David G. Johnston wrote: > I stand corrected. I was thinking you could somehow craft unnest(' value here>') but there is no way to auto-convert to "anyarray"... > > > The json_array_elements family manages to do the right thing. Why > > would it be

Re: [HACKERS] JSON[B] arrays are second-class citizens

2016-06-01 Thread David G. Johnston
On Tue, May 31, 2016 at 6:20 PM, Tom Lane wrote: > David Fetter writes: > > On Tue, May 31, 2016 at 05:06:00PM -0400, David G. Johnston wrote: > >> While likely not that common the introduction of an ambiguity makes > >> raises the bar considerably. > > >

Re: [HACKERS] PostmasterPid not marked with PGDLLIMPORT

2016-06-01 Thread Michael Paquier
On Thu, Jun 2, 2016 at 6:40 AM, Tom Lane wrote: > I suggest that there's a more principled reason for refusing a back-patch > here, which is that we don't back-patch new features, only bug fixes. > This request is certainly not a bug fix. It's in support of a new feature >

Re: [HACKERS] Perf Benchmarking and regression.

2016-06-01 Thread Andres Freund
On 2016-06-01 15:33:18 -0700, Andres Freund wrote: > Cpu: i7-6820HQ > Ram: 24GB of memory > Storage: Samsung SSD 850 PRO 1TB, encrypted > postgres -c shared_buffers=6GB -c backend_flush_after=128 -c > max_wal_size=100GB -c fsync=on -c synchronous_commit=off > pgbench -M prepared -c 16 -j 16 -T

[HACKERS] Re: pg9.6 segfault using simple query (related to use fk for join estimates)

2016-06-01 Thread Noah Misch
On Sun, May 29, 2016 at 01:36:01AM -0400, Noah Misch wrote: > On Fri, May 06, 2016 at 03:06:01PM -0400, Robert Haas wrote: > > On Thu, May 5, 2016 at 10:48 AM, David Rowley > > wrote: > > > On 5 May 2016 at 16:04, David Rowley wrote: >

Re: [HACKERS] [sqlsmith] Failed assertion in parallel worker (ExecInitSubPlan)

2016-06-01 Thread Noah Misch
On Thu, May 26, 2016 at 05:08:31PM +0530, Amit Kapila wrote: > Just to summarize, apart from above issue, we have discussed two different > issues related to parallel query in this thread. > a. Push down of parallel restricted clauses to nodes below gather. Patch > to fix same is posted upthread

Re: [HACKERS] Floating point comparison inconsistencies of the geometric types

2016-06-01 Thread Paul Ramsey
On Wed, Jun 1, 2016 at 8:59 AM, Jim Nasby wrote: > On 6/1/16 10:03 AM, Paul Ramsey wrote: >> >> We don't depend on these, we have our own :/ >> The real answer for a GIS system is to have an explicit tolerance >> parameter for calculations like

Re: [HACKERS] Misdesigned command/status APIs for parallel dump/restore

2016-06-01 Thread Tom Lane
I wrote: > I am pretty strongly tempted to get rid of MasterStartParallelItem > altogether and just hard-code what it does in DispatchJobForTocEntry. > ... > A different line of thought would be to fix the worker-command-parsing > situation by allowing the parsing to happen in format-specific

Re: [HACKERS] JSON[B] arrays are second-class citizens

2016-06-01 Thread Pavel Stehule
2016-06-01 17:55 GMT+02:00 Jim Nasby : > On 5/31/16 7:04 PM, Peter van Hardenberg wrote: > >> The idea of converting a JSONB array to a PG array is appealing and >> would potentially be more general-purpose than adding a new unnest. I'm >> not sure how feasible either

Re: [HACKERS] Floating point comparison inconsistencies of the geometric types

2016-06-01 Thread Tom Lane
Paul Ramsey writes: > One of the things people find annoying about postgis is that > ST_Intersects(ST_Intersection(a, b), a) can come out as false (a > derived point at a crossing of lines may not exactly intersect either > of the input lines), which is a direct result

Re: [HACKERS] Perf Benchmarking and regression.

2016-06-01 Thread Andres Freund
On 2016-05-31 16:03:46 -0400, Robert Haas wrote: > On Fri, May 27, 2016 at 12:37 AM, Andres Freund wrote: > > I don't think the situation is quite that simple. By *disabling* backend > > flushing it's also easy to see massive performance regressions. In > > situations where

Re: [HACKERS] Parallel safety tagging of extension functions

2016-06-01 Thread Andreas Karlsson
On 05/25/2016 03:32 AM, Tom Lane wrote: Andreas Karlsson writes: On 05/25/2016 02:41 AM, Robert Haas wrote: I'd rather extend see us ALTER AGGREGATE to do this. Wouldn't that prevent this from going into 9.6? I do not think changing ALTER AGGREGATE is 9.6 materials.

Re: [HACKERS] [sqlsmith] Failed assertions on parallel worker shutdown

2016-06-01 Thread Noah Misch
On Thu, May 26, 2016 at 03:27:40PM +0530, Amit Kapila wrote: > I think the workers should stop processing tuples after the tuple queues > got detached. This will not only handle above situation gracefully, but > will allow to speed up the queries where Limit clause is present on top of > Gather

Re: [HACKERS] Tracking wait event for latches

2016-06-01 Thread Thomas Munro
On Fri, May 20, 2016 at 8:14 AM, Michael Paquier wrote: > Hi all, > > As I mentioned $subject a couple of months back after looking at the > wait event facility here: >

Re: [HACKERS] PostmasterPid not marked with PGDLLIMPORT

2016-06-01 Thread Robert Haas
On Wed, Jun 1, 2016 at 12:24 PM, Alvaro Herrera wrote: > Robert Haas wrote: >> On Wed, Jun 1, 2016 at 12:06 AM, Craig Ringer wrote: >> > On 1 June 2016 at 11:48, Michael Paquier wrote: >> >> Could it be possible to mark

[HACKERS] Typo in comment in nbtree.h

2016-06-01 Thread Thomas Munro
Hi Following along with a btree bug report, I saw a typo "referencd" in a comment. Also "we've" seems a bit odd here, but maybe it's just me. Maybe it should be like this? --- a/src/include/access/nbtree.h +++ b/src/include/access/nbtree.h @@ -522,7 +522,7 @@ typedef struct BTScanPosData

Re: [HACKERS] Rename max_parallel_degree?

2016-06-01 Thread Josh berkus
On 06/01/2016 02:21 PM, Robert Haas wrote: > If you lined up ten people in a room all of whom were competent > database professionals and none of whom knew anything about PostgreSQL > and asked them to guess what a setting called work_mem does and what a > setting called max_parallel_degree does,

Re: [HACKERS] PostmasterPid not marked with PGDLLIMPORT

2016-06-01 Thread Tom Lane
> On Wed, Jun 1, 2016 at 5:04 PM, Robert Haas wrote: >> Probably not, but yes, I do want to reduce the commit load. I also >> think that we essentially have a contract with our users to limit what >> we back-patch to critical bug fixes and security fixes. When we don't >>

Re: [HACKERS] Rename max_parallel_degree?

2016-06-01 Thread Robert Haas
On Wed, Jun 1, 2016 at 10:10 AM, Tom Lane wrote: > Amit Kapila writes: >> Your explanation is clear, however the name max_parallel_workers makes it >> sound like that parallelising an operation is all about workers. Yes it >> depends a lot on the

Re: [HACKERS] Rename max_parallel_degree?

2016-06-01 Thread Tom Lane
Robert Haas writes: > I've largely given up hope of coming up with an alternative that can > attract more than one vote and that is also at least mildly accurate, > but one idea is max_parallel_workers_per_gather_node. That will be > totally clear. Given the reference to

Re: [HACKERS] PostmasterPid not marked with PGDLLIMPORT

2016-06-01 Thread David G. Johnston
On Wed, Jun 1, 2016 at 5:40 PM, Tom Lane wrote: > > On Wed, Jun 1, 2016 at 5:04 PM, Robert Haas > wrote: > >> Probably not, but yes, I do want to reduce the commit load. I also > >> think that we essentially have a contract with our users to limit what

Re: [HACKERS] PostmasterPid not marked with PGDLLIMPORT

2016-06-01 Thread David G. Johnston
On Wed, Jun 1, 2016 at 5:04 PM, Robert Haas wrote: > On Wed, Jun 1, 2016 at 12:24 PM, Alvaro Herrera > wrote: > > Robert Haas wrote: > >> On Wed, Jun 1, 2016 at 12:06 AM, Craig Ringer > wrote: > >> > On 1 June 2016 at

Re: [HACKERS] Parallel safety tagging of extension functions

2016-06-01 Thread Michael Paquier
On Thu, Jun 2, 2016 at 7:36 AM, Andreas Karlsson wrote: > On 05/25/2016 03:32 AM, Tom Lane wrote: >> >> Andreas Karlsson writes: >>> >>> On 05/25/2016 02:41 AM, Robert Haas wrote: I'd rather extend see us ALTER AGGREGATE to do this. >> >> >>>

Re: [HACKERS] Parallel safety tagging of extension functions

2016-06-01 Thread Andreas Karlsson
On 06/02/2016 01:41 AM, Michael Paquier wrote: > On Thu, Jun 2, 2016 at 7:36 AM, Andreas Karlsson wrote: >> Looked at this quickly and I do not think adding it would be what I consider >> a small patch since we would essentially need to copy the validation logic >> from

Re: [HACKERS] Does people favor to have matrix data type?

2016-06-01 Thread Kouhei Kaigai
> -Original Message- > From: Jim Nasby [mailto:jim.na...@bluetreble.com] > Sent: Wednesday, June 01, 2016 11:32 PM > To: Kaigai Kouhei(海外 浩平); Gavin Flower; Joe Conway; Ants Aasma; Simon Riggs > Cc: pgsql-hackers@postgresql.org > Subject: Re: [HACKERS] Does people favor to have matrix data

Re: [HACKERS] COMMENT ON, psql and access methods

2016-06-01 Thread Michael Paquier
On Wed, Jun 1, 2016 at 8:25 PM, Teodor Sigaev wrote: As far as I can see, COMMENT ON has no support for access methods. Wouldn't we want to add it as it is created by a command? On top of that, perhaps we could have a backslash command in psql to list the

Re: [HACKERS] Tracking wait event for latches

2016-06-01 Thread Michael Paquier
On Thu, Jun 2, 2016 at 12:25 PM, Thomas Munro wrote: > This patch allows identifiers to be specified by the WaitLatch and > WaitLatchOrSocket calls, but not for WaitEventSetWait, which is the > more general waiting primitive. I think it should be done by >

Re: [HACKERS] foreign table batch inserts

2016-06-01 Thread Etsuro Fujita
On 2016/05/31 14:53, Amit Langote wrote: On 2016/05/30 22:59, Craig Ringer wrote: On 30 May 2016 at 16:17, Etsuro Fujita wrote: That's a good point, but the basic idea is to send the local query almost-as-is to the remote server if possible. For example, if the

Re: [HACKERS] Parallel pg_dump's error reporting doesn't work worth squat

2016-06-01 Thread Kyotaro HORIGUCHI
At Tue, 31 May 2016 12:29:50 -0400, Tom Lane wrote in <7445.1464712...@sss.pgh.pa.us> > Kyotaro HORIGUCHI writes: > > At Fri, 27 May 2016 13:20:20 -0400, Tom Lane wrote in > > <14603.1464369...@sss.pgh.pa.us> > >>

Re: [HACKERS] Reviewing freeze map code

2016-06-01 Thread Masahiko Sawada
On Sat, May 7, 2016 at 5:34 AM, Robert Haas wrote: > On Mon, May 2, 2016 at 8:25 PM, Andres Freund wrote: >> + * heap_tuple_needs_eventual_freeze >> + * >> + * Check to see whether any of the XID fields of a tuple (xmin, xmax, xvac) >> + * will

Re: [HACKERS] COMMENT ON, psql and access methods

2016-06-01 Thread Teodor Sigaev
As far as I can see, COMMENT ON has no support for access methods. Wouldn't we want to add it as it is created by a command? On top of that, perhaps we could have a backslash command in psql to list the supported access methods, like \dam[S]? The system methods would be in this case all the

Re: [HACKERS] Change in order of criteria - reg

2016-06-01 Thread Amit Langote
On 2016/06/01 13:07, sri harsha wrote: > Hi, > > In PostgreSQL , does the order in which the criteria is given matter ?? > For example > > Query 1 : Select * from TABLE where a > 5 and b < 10; > > Query 2 : Select * from TABLE where b <10 and a > 5; > > Are query 1 and query 2 the same in

Re: [HACKERS] Rename max_parallel_degree?

2016-06-01 Thread Amit Kapila
On Tue, May 31, 2016 at 11:30 PM, Tom Lane wrote: > > I wrote: > > I really think that a GUC named "max_parallel_workers", which in fact > > limits the number of workers and not something else, is the way to go. > > To be concrete, I suggest comparing the attached

Re: [HACKERS] PostmasterPid not marked with PGDLLIMPORT

2016-06-01 Thread Robert Haas
On Wed, Jun 1, 2016 at 12:06 AM, Craig Ringer wrote: > On 1 June 2016 at 11:48, Michael Paquier wrote: >> Could it be possible to mark PostmasterPid with PGDLLIMPORT on HEAD >> and back-branches? > > Sounds sensible to me. I don't really want to

[HACKERS] array of domain types

2016-06-01 Thread Konstantin Knizhnik
I wonder why domain types can not be used for specification of array element: create domain objref as bigint; create table foo(x objref[]); ERROR: type "objref[]" does not exist create table foo(x bigint[]); CREATE TABLE Is there some principle problem here or it is just not implemented? --

Re: [HACKERS] Floating point comparison inconsistencies of the geometric types

2016-06-01 Thread Robert Haas
On Fri, May 27, 2016 at 6:43 AM, Emre Hasegeli wrote: > There are those macros defined for the built-in geometric types: > >> #define EPSILON 1.0E-06 > >> #define FPzero(A) (fabs(A) <= EPSILON) >> #define FPeq(A,B) (fabs((A) - (B)) <=

Re: [HACKERS] array of domain types

2016-06-01 Thread Thom Brown
On 1 June 2016 at 14:20, Konstantin Knizhnik wrote: > I wonder why domain types can not be used for specification of array > element: > > create domain objref as bigint; > create table foo(x objref[]); > ERROR: type "objref[]" does not exist > create table foo(x

Re: [HACKERS] Question and suggestion about application binary compatibility policy

2016-06-01 Thread Michael Meskes
> However, the problem I pointed out is that when the new library is > incompatible with the older one, say the major version of libpq.dll > changes from 5 to 6, the application user and/or developer cannot > notice the incompatibility immediately and easily.  On Unix/Linux, > the application

Re: [HACKERS] Rename synchronous_standby_names?

2016-06-01 Thread Masahiko Sawada
On Wed, Jun 1, 2016 at 9:49 AM, Michael Paquier wrote: > On Wed, Jun 1, 2016 at 3:56 AM, David G. Johnston > wrote: >> On Tue, May 31, 2016 at 2:19 PM, Peter Eisentraut >> wrote: >>> >>> On 5/31/16 1:47 PM,

Re: [HACKERS] PostmasterPid not marked with PGDLLIMPORT

2016-06-01 Thread David G. Johnston
On Wed, Jun 1, 2016 at 9:00 AM, Robert Haas wrote: > On Wed, Jun 1, 2016 at 12:06 AM, Craig Ringer > wrote: > > On 1 June 2016 at 11:48, Michael Paquier > wrote: > >> Could it be possible to mark PostmasterPid with

Re: [HACKERS] Rename max_parallel_degree?

2016-06-01 Thread Tom Lane
Amit Kapila writes: > Your explanation is clear, however the name max_parallel_workers makes it > sound like that parallelising an operation is all about workers. Yes it > depends a lot on the number of workers allocated for parallel operation, > but that is not

Re: [HACKERS] Does people favor to have matrix data type?

2016-06-01 Thread Jim Nasby
On 5/30/16 9:05 PM, Kouhei Kaigai wrote: Due to performance reason, location of each element must be deterministic without walking on the data structure. This approach guarantees we can reach individual element with 2 steps. Agreed. On various other points... Yes, please keep the discussion

Re: [HACKERS] Floating point comparison inconsistencies of the geometric types

2016-06-01 Thread Kevin Grittner
On Wed, Jun 1, 2016 at 8:08 AM, Robert Haas wrote: > On Fri, May 27, 2016 at 6:43 AM, Emre Hasegeli wrote: >> There are those macros defined for the built-in geometric types: >> >>> #define EPSILON 1.0E-06 >> >>> #define FPzero(A)

Re: [HACKERS] Floating point comparison inconsistencies of the geometric types

2016-06-01 Thread Tom Lane
Kevin Grittner writes: > On Wed, Jun 1, 2016 at 8:08 AM, Robert Haas wrote: >> Figuring out what to do about it is harder. Your proposal seems to be >> to remove them except where we need the fuzzy behavior, which doesn't >> sound unreasonable, but I

Re: [HACKERS] Parallel safety tagging of extension functions

2016-06-01 Thread Tom Lane
Andreas Karlsson writes: > It is the least ugly of all the ugly solutions I could think of. I have > attached a patch which fixes the signatures using this method. I use > CREATE OR REPLACE FUNCTION to update to catcache. What do you think? Is > it too ugly? I don't

Re: [HACKERS] Rename max_parallel_degree?

2016-06-01 Thread Jim Nasby
On 5/31/16 8:48 PM, Robert Haas wrote: On Tue, May 31, 2016 at 5:58 PM, Tom Lane wrote: Alvaro Herrera writes: Robert Haas wrote: I just want to point out that if we change #1, we're breaking postgresql.conf compatibility for, IMHO, not a whole

Re: [HACKERS] Floating point comparison inconsistencies of the geometric types

2016-06-01 Thread Joe Conway
On 06/01/2016 07:52 AM, Jim Nasby wrote: > On 6/1/16 9:27 AM, Tom Lane wrote: >> Kevin Grittner writes: >>> > On Wed, Jun 1, 2016 at 8:08 AM, Robert Haas >>> wrote: >> Figuring out what to do about it is harder. Your proposal seems to be

Re: [HACKERS] Parallel safety tagging of extension functions

2016-06-01 Thread Tom Lane
Andreas Karlsson writes: > On 06/01/2016 04:44 PM, Tom Lane wrote: >> I don't understand why you think you need the CREATE OR REPLACE FUNCTION >> commands? We only need to change proargtypes, and the updates did that. >> The catcache can take care of itself. > Maybe I did

Re: [HACKERS] Floating point comparison inconsistencies of the geometric types

2016-06-01 Thread Jim Nasby
On 6/1/16 9:27 AM, Tom Lane wrote: Kevin Grittner writes: > On Wed, Jun 1, 2016 at 8:08 AM, Robert Haas wrote: >> Figuring out what to do about it is harder. Your proposal seems to be >> to remove them except where we need the fuzzy behavior, which

[HACKERS] Removing overhead commands in parallel dump/restore

2016-06-01 Thread Tom Lane
While testing parallel dump/restore over the past few days, I noticed that it seemed to do an awful lot of duplicative SET commands, which I traced to the fact that restore was doing _doSetFixedOutputState(AH) in the wrong place, ie, once per TOC entry not once per worker. Another thing that's

Re: [HACKERS] Parallel safety tagging of extension functions

2016-06-01 Thread Andreas Karlsson
On 06/01/2016 04:44 PM, Tom Lane wrote: Andreas Karlsson writes: It is the least ugly of all the ugly solutions I could think of. I have attached a patch which fixes the signatures using this method. I use CREATE OR REPLACE FUNCTION to update to catcache. What do you think?

Re: [HACKERS] JSON[B] arrays are second-class citizens

2016-06-01 Thread David Fetter
On Tue, May 31, 2016 at 06:20:26PM -0400, Tom Lane wrote: > David Fetter writes: > > On Tue, May 31, 2016 at 05:06:00PM -0400, David G. Johnston wrote: > >> While likely not that common the introduction of an ambiguity makes > >> raises the bar considerably. > > > What

Re: [HACKERS] Floating point comparison inconsistencies of the geometric types

2016-06-01 Thread Paul Ramsey
On Wed, Jun 1, 2016 at 7:52 AM, Jim Nasby wrote: > > I suspect another wrinkle here is that in the GIS world a single point can > be represented it multiple reference/coordinate systems, and it would have > different values in each of them. AIUI the transforms between

Re: [HACKERS] Rename max_parallel_degree?

2016-06-01 Thread Petr Jelinek
On 01/06/16 17:27, Jim Nasby wrote: On 5/31/16 8:48 PM, Robert Haas wrote: On Tue, May 31, 2016 at 5:58 PM, Tom Lane wrote: Alvaro Herrera writes: Robert Haas wrote: I just want to point out that if we change #1, we're breaking postgresql.conf

Re: [HACKERS] JSON[B] arrays are second-class citizens

2016-06-01 Thread Jim Nasby
On 5/31/16 7:04 PM, Peter van Hardenberg wrote: The idea of converting a JSONB array to a PG array is appealing and would potentially be more general-purpose than adding a new unnest. I'm not sure how feasible either suggestion is. The one part I think is missing right now is unnest allows you

Re: [HACKERS] Rename max_parallel_degree?

2016-06-01 Thread David G. Johnston
On Wed, Jun 1, 2016 at 11:45 AM, Petr Jelinek wrote: > That GUC also controls worker processes that are started by extensions, > not just ones that parallel query starts. This is btw one thing I don't > like at all about how the current limits work, the parallel query will