Re: [HACKERS] POLA violation with \c service=

2015-01-10 Thread Erik Rijkers
On Fri, January 9, 2015 20:15, David Fetter wrote: [psql_fix_uri_service_003.patch] Applies on master; the feature (switching services) works well but a \c without any parameters produces a segfault: (centos 6.6, 4.9.2, 64-bit) $ echo -en $PGSERVICEFILE\n$PGSERVICE\n$PGPORT\n

Re: [HACKERS] Compression of full-page-writes

2015-01-10 Thread Michael Paquier
On Fri, Jan 9, 2015 at 9:49 PM, Rahila Syed rahilasyed...@gmail.com wrote: So this test can be used to evaluate how shorter records influence performance since the master waits for flush confirmation from the standby, right? Yes. This test can help measure performance improvement due to reduced

Re: [HACKERS] Fixing memory leak in pg_upgrade

2015-01-10 Thread Michael Paquier
On Sat, Jan 10, 2015 at 2:27 AM, Bruce Momjian br...@momjian.us wrote: so some memory is allocated, and has to be freed. I looked at avoiding the call to gen_db_file_maps() for old_db-rel_arr.nrels == 0, but there are checks in there comparing the old/new relation counts, so it can't be

Re: [HACKERS] POLA violation with \c service=

2015-01-10 Thread Andrew Dunstan
On 01/09/2015 02:15 PM, David Fetter wrote: Some C cleanups... Not quite enough cleanup. As I told you on IRC, the only addition to common.h should be the declaration of recognized_connection_string. These do not belong there (they belong in common.c): +static const char

Re: [HACKERS] POLA violation with \c service=

2015-01-10 Thread Andrew Dunstan
On 01/10/2015 09:32 AM, Andres Freund wrote: On 2015-01-10 09:16:07 -0500, Andrew Dunstan wrote: +static const char uri_designator[] = postgresql://; +static const char short_uri_designator[] = postgres://; These declarations in common.h would cause a separate instance of these pieces

Re: [HACKERS] Escaping from blocked send() reprised.

2015-01-10 Thread Andres Freund
On 2014-09-04 08:49:22 -0400, Robert Haas wrote: On Tue, Sep 2, 2014 at 3:01 PM, Andres Freund and...@2ndquadrant.com wrote: I'm slightly worried about the added overhead due to the latch code. In my implementation I only use latches after a nonblocking read, but still. Every

Re: [HACKERS] Transactions involving multiple postgres foreign servers

2015-01-10 Thread Michael Paquier
On Sat, Jan 10, 2015 at 9:02 AM, Jim Nasby jim.na...@bluetreble.com wrote: On 1/8/15, 12:00 PM, Kevin Grittner wrote: The key point is that the distributed transaction data must be flagged as needing to commit rather than roll back between the prepare phase and the final commit. If you try to

Re: [HACKERS] POLA violation with \c service=

2015-01-10 Thread Andres Freund
On 2015-01-10 09:49:52 -0500, Andrew Dunstan wrote: Save static inline functions, that is. Yeah, but not normally data items. (I did say in general). As a general rule for novice C programmers I think my rule of thumb is reasonable. Agreed. I just tried to preempt somebody grepping for static

Re: [HACKERS] INSERT ... ON CONFLICT UPDATE and RLS

2015-01-10 Thread Stephen Frost
Dean, * Dean Rasheed (dean.a.rash...@gmail.com) wrote: On 9 January 2015 at 20:26, Stephen Frost sfr...@snowman.net wrote: Where this leaves me, at least, is feeling like we should always apply the INSERT WITH CHECK policy, then if there is a conflict, check the UPDATE USING policy and

Re: [HACKERS] INSERT ... ON CONFLICT UPDATE and RLS

2015-01-10 Thread Dean Rasheed
On 9 January 2015 at 20:26, Stephen Frost sfr...@snowman.net wrote: Where this leaves me, at least, is feeling like we should always apply the INSERT WITH CHECK policy, then if there is a conflict, check the UPDATE USING policy and throw an error if the row isn't visible but otherwise perform

Re: [HACKERS] POLA violation with \c service=

2015-01-10 Thread Andres Freund
On 2015-01-10 09:16:07 -0500, Andrew Dunstan wrote: +static const char uri_designator[] = postgresql://; +static const char short_uri_designator[] = postgres://; These declarations in common.h would cause a separate instance of these pieces of storage to occur in every object file

Re: [HACKERS] libpq 9.4 requires /etc/passwd?

2015-01-10 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: On Fri, Jan 9, 2015 at 06:57:02PM -0500, Tom Lane wrote: Hmm ... actually, I'll bet it's not $HOME that's at issue, but the name of the user. Commit a4c8f14364c27508233f8a31ac4b10a4c90235a9 turned failure of pg_fe_getauthname() into a hard connection

Re: [HACKERS] libpq 9.4 requires /etc/passwd?

2015-01-10 Thread Noah Misch
On Fri, Jan 09, 2015 at 06:57:02PM -0500, Tom Lane wrote: Commit a4c8f14364c27508233f8a31ac4b10a4c90235a9 turned failure of pg_fe_getauthname() into a hard connection failure, whereas previously it was harmless as long as the caller provided a username. I wonder if we shouldn't just revert

Re: [HACKERS] libpq 9.4 requires /etc/passwd?

2015-01-10 Thread Christoph Berg
Re: Tom Lane 2015-01-10 22432.1420915...@sss.pgh.pa.us So what I propose we do with this is patch HEAD and 9.4 only. We need to do *something* in 9.4 to address Christoph's complaint, and that branch is new enough that we can probably get away with changing officially-unsupported APIs. The

[HACKERS] s_lock.h default definitions are rather confused

2015-01-10 Thread Tom Lane
I've not tried to build HEAD on my HPPA dinosaur for awhile, but I did just now, and I am presented with boatloads of this: ../../../src/include/storage/s_lock.h:759: warning: `S_UNLOCK' redefined ../../../src/include/storage/s_lock.h:679: warning: this is the location of the previous definition

Re: [HACKERS] s_lock.h default definitions are rather confused

2015-01-10 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: Given you got the error above, you used gcc. Right. Have you used non-gcc compiler on hppa recently? I seem to recall you mentioning that that doesn't work sanely anymore? If so, perhaps we can just remove the !gcc variant? I'll try that shortly

[HACKERS] Sloppy SSPI error reporting code

2015-01-10 Thread Tom Lane
While looking at fe-auth.c I noticed quite a few places that weren't bothering to make error messages localizable (ie, missing libpq_gettext calls), and/or were failing to add a trailing newline as expected in libpq error messages. Perhaps these are intentional but I doubt it. Most of the

Re: [HACKERS] libpq 9.4 requires /etc/passwd?

2015-01-10 Thread Tom Lane
Christoph Berg c...@df7cb.de writes: Re: Tom Lane 2015-01-10 22432.1420915...@sss.pgh.pa.us So what I propose we do with this is patch HEAD and 9.4 only. We need to do *something* in 9.4 to address Christoph's complaint, and that branch is new enough that we can probably get away with changing

Re: [HACKERS] Parallel Seq Scan

2015-01-10 Thread Stephen Frost
* Amit Kapila (amit.kapil...@gmail.com) wrote: At this moment if we can ensure that parallel plan should not be selected for cases where it will perform poorly is more than enough considering we have lots of other work left to even make any parallel operation work. The problem with this

Re: [HACKERS] libpq 9.4 requires /etc/passwd?

2015-01-10 Thread Tom Lane
One other point here: I realized while testing my patch that it's actually impossible to provoke the failure mode Christoph is unhappy about in psql. You can only see it in an application that uses PQsetdb/PQsetdbLogin, which of course psql doesn't anymore. The reason is that in the PQconnect

Re: [HACKERS] INSERT ... ON CONFLICT UPDATE and RLS

2015-01-10 Thread Dean Rasheed
On 10 January 2015 at 15:12, Stephen Frost sfr...@snowman.net wrote: NOTE: If we do change RLS CHECKs to be executed prior to modifying any data, that's potentially a change that could be made independently of the UPSERT patch. We should also probably then stop referring to them as WITH CHECK

Re: [HACKERS] s_lock.h default definitions are rather confused

2015-01-10 Thread Andres Freund
On 2015-01-10 16:09:42 -0500, Tom Lane wrote: I've not tried to build HEAD on my HPPA dinosaur for awhile, but I did just now, and I am presented with boatloads of this: ../../../src/include/storage/s_lock.h:759: warning: `S_UNLOCK' redefined ../../../src/include/storage/s_lock.h:679:

Re: [HACKERS] s_lock.h default definitions are rather confused

2015-01-10 Thread Andres Freund
On 2015-01-10 17:58:10 -0500, Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: Given you got the error above, you used gcc. Have you used non-gcc compiler on hppa recently? I seem to recall you mentioning that that doesn't work sanely anymore? If so, perhaps we can just remove

Re: Fwd: Re: [HACKERS] make check-world regress failed

2015-01-10 Thread Andres Freund
Hi, On 2015-01-09 04:59:56 +0100, Vladimir Koković wrote: Thanks Andres, i686 check-world passed with your atomic-uint64-alignment.patch. Thanks for the report and testing! I've pushed the fix. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/

Re: [HACKERS] s_lock.h default definitions are rather confused

2015-01-10 Thread Andres Freund
On 2015-01-10 18:40:58 -0500, Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: On 2015-01-11 00:06:41 +0100, Andres Freund wrote: Ick, that one is my failure. Actually. It looks like I only translated the logic from barrier.h 1:1 and it already was broken there. Hm, it looks

Re: [HACKERS] POLA violation with \c service=

2015-01-10 Thread David Fetter
On Sat, Jan 10, 2015 at 09:30:57AM +0100, Erik Rijkers wrote: On Fri, January 9, 2015 20:15, David Fetter wrote: [psql_fix_uri_service_003.patch] Applies on master; the feature (switching services) works well but a \c without any parameters produces a segfault: (centos 6.6, 4.9.2,

Re: [HACKERS] Parallel Seq Scan

2015-01-10 Thread Robert Haas
On Fri, Jan 9, 2015 at 12:24 PM, Stephen Frost sfr...@snowman.net wrote: The parameters sound reasonable but I'm a bit worried about the way you're describing the implementation. Specifically this comment: Cost of starting up parallel workers with default value as 1000.0 multiplied by number

Re: [HACKERS] libpq 9.4 requires /etc/passwd?

2015-01-10 Thread David Fetter
On Sat, Jan 10, 2015 at 02:02:54PM -0500, Tom Lane wrote: Not entirely sure what to do about this, but I predict this won't be the last complaint unless we find some way to improve test coverage in this area. Or perhaps we could turn PQsetdbLogin into a ***very*** thin wrapper around

Re: [HACKERS] s_lock.h default definitions are rather confused

2015-01-10 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: Given you got the error above, you used gcc. Have you used non-gcc compiler on hppa recently? I seem to recall you mentioning that that doesn't work sanely anymore? If so, perhaps we can just remove the !gcc variant? It still compiles, modulo some

Re: [HACKERS] s_lock.h default definitions are rather confused

2015-01-10 Thread Andres Freund
On 2015-01-11 00:06:41 +0100, Andres Freund wrote: On 2015-01-10 17:58:10 -0500, Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: Given you got the error above, you used gcc. Have you used non-gcc compiler on hppa recently? I seem to recall you mentioning that that doesn't

Re: [HACKERS] BRIN range operator class

2015-01-10 Thread Andreas Karlsson
Hi, I made a quick review for your patch, but I would like to see someone who was involved in the BRIN work comment on Emre's design issues. I will try to answer them as best as I can below. I think minimax indexes on range types seems very useful, and inet/cidr too. I have no idea about

Re: Custom/Foreign-Join-APIs (Re: [HACKERS] [v9.5] Custom Plan API)

2015-01-10 Thread Jim Nasby
On 1/9/15, 8:51 PM, Kohei KaiGai wrote: 2015-01-10 9:56 GMT+09:00 Jim Nasby jim.na...@bluetreble.com: On 1/9/15, 6:54 PM, Jim Nasby wrote: On 1/9/15, 6:44 PM, Petr Jelinek wrote: Yep, I had a same impression when I looked at the code first time, however, it is defined as below. Not a

Re: [HACKERS] Parallel Seq Scan

2015-01-10 Thread Robert Haas
On Thu, Jan 8, 2015 at 6:42 AM, Amit Kapila amit.kapil...@gmail.com wrote: Are we sure that in such cases we will consume work_mem during execution? In cases of parallel_workers we are sure to an extent that if we reserve the workers then we will use it during execution. Nonetheless, I have

Re: [HACKERS] Parallel Seq Scan

2015-01-10 Thread Robert Haas
On Thu, Jan 8, 2015 at 2:46 PM, Stephen Frost sfr...@snowman.net wrote: Yeah, if we come up with a plan for X workers and end up not being able to spawn that many then I could see that being worth a warning or notice or something. Not sure what EXPLAIN has to do anything with it.. That seems

Re: [HACKERS] Using 128-bit integers for sum, avg and statistics aggregates

2015-01-10 Thread Andreas Karlsson
On 01/11/2015 02:36 AM, Andres Freund wrote: a) Afaics only __int128/unsigned __int128 is defined. See https://gcc.gnu.org/onlinedocs/gcc/_005f_005fint128.html Both GCC and Clang defines both of them. Which you use seems to just be a matter of preference. b) I'm doubtful that

Re: [HACKERS] Transactions involving multiple postgres foreign servers

2015-01-10 Thread Jim Nasby
On 1/10/15, 7:11 AM, Michael Paquier wrote: If we had an independent transaction coordinator then I agree with you Kevin. I think Robert is proposing that if we are controlling one of the nodes that's participating as well as coordinating the overall transaction that we can take some shortcuts.

Re: [HACKERS] Using 128-bit integers for sum, avg and statistics aggregates

2015-01-10 Thread Andres Freund
Hi, +# Check if platform support gcc style 128-bit integers. +AC_CHECK_TYPES([__int128_t, __uint128_t], [], [], []) Hm, I'm not sure that's sufficent. Three things: a) Afaics only __int128/unsigned __int128 is defined. See https://gcc.gnu.org/onlinedocs/gcc/_005f_005fint128.html b) I'm

Re: [HACKERS] Parallel Seq Scan

2015-01-10 Thread Amit Kapila
On Sun, Jan 11, 2015 at 9:09 AM, Robert Haas robertmh...@gmail.com wrote: On Thu, Jan 8, 2015 at 6:42 AM, Amit Kapila amit.kapil...@gmail.com wrote: 2. To enable two types of shared memory queue's (error queue and tuple queue), we need to ensure that we switch to appropriate queue during

Re: [HACKERS] s_lock.h default definitions are rather confused

2015-01-10 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On 2015-01-11 00:06:41 +0100, Andres Freund wrote: Ick, that one is my failure. Actually. It looks like I only translated the logic from barrier.h 1:1 and it already was broken there. Hm, it looks like the current code essentially is from

Re: Custom/Foreign-Join-APIs (Re: [HACKERS] [v9.5] Custom Plan API)

2015-01-10 Thread Kohei KaiGai
2015-01-11 10:40 GMT+09:00 Jim Nasby jim.na...@bluetreble.com: On 1/9/15, 8:51 PM, Kohei KaiGai wrote: 2015-01-10 9:56 GMT+09:00 Jim Nasby jim.na...@bluetreble.com: On 1/9/15, 6:54 PM, Jim Nasby wrote: On 1/9/15, 6:44 PM, Petr Jelinek wrote: Yep, I had a same impression when I looked