Re: [HACKERS] [PATCH] Send catalog_xmin separately in hot standby feedback

2016-09-04 Thread Craig Ringer
On 5 September 2016 at 12:40, Craig Ringer wrote: > Hi all > > Currently hot standby feedback sends GetOldestXmin()'s result to the > upstream as the required xmin. GetOldestXmin() returns a slot's > catalog_xmin if that's the lowest xmin on the system. Note that this patch changes the API to Ge

Re: [HACKERS] LSN as a recovery target

2016-09-04 Thread Michael Paquier
On Sun, Sep 4, 2016 at 11:30 PM, Simon Riggs wrote: > On 4 September 2016 at 14:32, Abhijit Menon-Sen wrote: >> At 2016-09-04 07:02:01 +0100, si...@2ndquadrant.com wrote: >>> >>> > By the way, what has been committed does not include the patch >>> > adding the parsing context in case of an error

Re: [HACKERS] Parallel build with MSVC

2016-09-04 Thread Michael Paquier
On Mon, Sep 5, 2016 at 9:18 AM, Noah Misch wrote: > On Wed, Apr 27, 2016 at 08:15:05AM +, Christian Ullrich wrote: >> * From: Michael Paquier [mailto:michael.paqu...@gmail.com] >> >> > On Wed, Apr 27, 2016 at 4:06 PM, Christian Ullrich >> > wrote: >> >> > > * From: Michael Paquier [mailto:mic

[HACKERS] [PATCH] Send catalog_xmin separately in hot standby feedback

2016-09-04 Thread Craig Ringer
Hi all Currently hot standby feedback sends GetOldestXmin()'s result to the upstream as the required xmin. GetOldestXmin() returns a slot's catalog_xmin if that's the lowest xmin on the system. That's fine so long as we don't do logical decoding on standbys, but if we start allowing logical slots

Re: [HACKERS] Patch: Implement failover on libpq connect level.

2016-09-04 Thread Victor Wagner
On Mon, 5 Sep 2016 07:59:02 +0530 Mithun Cy wrote: > On Aug 31, 2016 1:44 PM, "Victor Wagner" wrote: > > Thanks, I've added this to 7-th (yet unpublished here) version of my > > patch. > Hi victor, just wanted know what your plan for your patch 07. Would > you like to submit it to the community.

Re: [HACKERS] Speed up Clog Access by increasing CLOG buffers

2016-09-04 Thread Amit Kapila
On Mon, Sep 5, 2016 at 3:18 AM, Tomas Vondra wrote: > Hi, > > This thread started a year ago, different people contributed various > patches, some of which already got committed. Can someone please post a > summary of this thread, so that it's a bit more clear what needs > review/testing, what are

Re: [HACKERS] PassDownLimitBound for ForeignScan/CustomScan

2016-09-04 Thread Kouhei Kaigai
> On Mon, Aug 29, 2016 at 7:25 AM, Kouhei Kaigai wrote: > > > Hello, > > The attached patch adds an optional callback to support special > optimization > if ForeignScan/CustomScan are located under the Limit node in plan-tree. > > Our sort node wisely switches the beha

[HACKERS] Re: [bug fix] Cascading standby cannot catch up and get stuck emitting the same message repeatedly

2016-09-04 Thread Tsunakawa, Takayuki
From: pgsql-hackers-ow...@postgresql.org > [mailto:pgsql-hackers-ow...@postgresql.org] On Behalf Of Tsunakawa, > Our customer hit a problem of cascading replication, and we found the cause. > They are using the latest PostgreSQL 9.2.18. The bug seems to have been > fixed in 9.4 and higher during t

Re: [HACKERS] OpenSSL 1.1 breaks configure and more

2016-09-04 Thread Michael Paquier
On Mon, Sep 5, 2016 at 9:32 AM, Andreas Karlsson wrote: > On 09/05/2016 02:23 AM, Tom Lane wrote: >> >> Judging by the number of people who have popped up recently with their >> own OpenSSL 1.1 patches, I think there is going to be a lot of demand for >> back-patching some sort of 1.1 support into

Re: [HACKERS] Logical decoding slots can go backwards when used from SQL, docs are wrong

2016-09-04 Thread Craig Ringer
On 5 September 2016 at 10:41, Craig Ringer wrote: > On 2 September 2016 at 17:49, Craig Ringer wrote: > >> So the main change becomes the one-liner in my prior mail. > > Per feedback from Simon, updated with a new test in src/test/recovery . ... attached this time. -- Craig Ringer

Re: [HACKERS] Logical decoding slots can go backwards when used from SQL, docs are wrong

2016-09-04 Thread Craig Ringer
On 2 September 2016 at 17:49, Craig Ringer wrote: > So the main change becomes the one-liner in my prior mail. Per feedback from Simon, updated with a new test in src/test/recovery . If you revert the change to src/backend/replication/logical/logicalfuncs.c then the test will start failing. I'

Re: [HACKERS] Patch: Implement failover on libpq connect level.

2016-09-04 Thread Mithun Cy
On Aug 31, 2016 1:44 PM, "Victor Wagner" wrote: > Thanks, I've added this to 7-th (yet unpublished here) version of my > patch. Hi victor, just wanted know what your plan for your patch 07. Would you like to submit it to the community. I have just signed up as a reviewer for your patch.

Re: [HACKERS] Remove superuser() checks from pgstattuple

2016-09-04 Thread Andres Freund
On September 4, 2016 6:33:30 PM PDT, Tom Lane wrote: >Andres Freund writes: >> On 2016-09-04 21:09:41 -0400, Tom Lane wrote: >>> Hm, couldn't we do that automatically? At least in the case where >only >>> one base-version script is available? > >> You mean determining the baseversion? Hm, yes,

Re: [HACKERS] Remove superuser() checks from pgstattuple

2016-09-04 Thread Tom Lane
Andres Freund writes: > On 2016-09-04 21:09:41 -0400, Tom Lane wrote: >> Hm, couldn't we do that automatically? At least in the case where only >> one base-version script is available? > You mean determining the baseversion? Hm, yes, that might work. But I'm > not sure how much we can rely on no

Re: [HACKERS] Remove superuser() checks from pgstattuple

2016-09-04 Thread Andres Freund
On 2016-09-04 21:09:41 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2016-09-04 11:55:06 -0400, Tom Lane wrote: > >> It is becoming clear that the current extension update mechanism is kind > >> of brute-force for this sort of change. I have no ideas offhand about a > >> better way to do

Re: [HACKERS] Remove superuser() checks from pgstattuple

2016-09-04 Thread Tom Lane
Andres Freund writes: > On 2016-09-04 11:55:06 -0400, Tom Lane wrote: >> It is becoming clear that the current extension update mechanism is kind >> of brute-force for this sort of change. I have no ideas offhand about a >> better way to do it, but like Peter, I was dismayed by the amount of pure

Re: [HACKERS] [PATCH] COPY vs \copy HINT

2016-09-04 Thread Craig Ringer
On 5 September 2016 at 09:05, Craig Ringer wrote: >I've attached an update that does so and > warns on EACCES too. ... this time, with required parens. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services From d4455da00411daa

Re: [HACKERS] [PATCH] COPY vs \copy HINT

2016-09-04 Thread Craig Ringer
On 4 September 2016 at 23:33, Tom Lane wrote: > So my consciousness was raised just now by an example of exactly this > scenario over in pgsql-novice. What I forgot was that the client may > in fact be on the same machine as the server, in which case EACCES > is pretty much exactly what you'd ex

Re: [HACKERS] Remove superuser() checks from pgstattuple

2016-09-04 Thread Andres Freund
On 2016-09-04 11:55:06 -0400, Tom Lane wrote: > [ warning, thread hijack ahead ] > > Stephen Frost writes: > > * Peter Eisentraut (peter.eisentr...@2ndquadrant.com) wrote: > >> I think this is a good change to pursue, and we'll likely want to do > >> more similar changes in contrib. But I'm worr

Re: [HACKERS] Yet another small patch - reorderbuffer.c:1099

2016-09-04 Thread Tom Lane
Andres Freund writes: > On 2016-04-05 11:38:27 -0300, Alvaro Herrera wrote: >> The current arrangement looks bizantine to me, for no reason. If we >> think that one of the two branches might do something additional to the >> list deletion, surely that will be in a separate stanza with its own >>

Re: [HACKERS] Parallel build with MSVC

2016-09-04 Thread Noah Misch
On Sun, Sep 04, 2016 at 08:26:12PM -0400, Tom Lane wrote: > Noah Misch writes: > > I was tempted to back-patch this. The risk to back branch users seems > > negligible, and it would be convenient for me as a person who builds all > > branches. That reason is not good enough, so I plan not to bac

Re: [HACKERS] OpenSSL 1.1 breaks configure and more

2016-09-04 Thread Andreas Karlsson
On 09/05/2016 02:23 AM, Tom Lane wrote: Judging by the number of people who have popped up recently with their own OpenSSL 1.1 patches, I think there is going to be a lot of demand for back-patching some sort of 1.1 support into our back branches. All this talk of refactoring does not sound very

Re: [HACKERS] Parallel build with MSVC

2016-09-04 Thread Tom Lane
Noah Misch writes: > I was tempted to back-patch this. The risk to back branch users seems > negligible, and it would be convenient for me as a person who builds all > branches. That reason is not good enough, so I plan not to back-patch. I > feel like I might be missing a stronger reason to ba

Re: [HACKERS] OpenSSL 1.1 breaks configure and more

2016-09-04 Thread Tom Lane
Andreas Karlsson writes: > On 08/30/2016 08:42 AM, Heikki Linnakangas wrote: >> PS. I just remembered that I've wanted to refactor the pgcrypto calls >> for symmetric encryption to use the newer EVP API for some time, and >> even posted a patch for that >> (https://www.postgresql.org/message-id/56

Re: [HACKERS] Parallel build with MSVC

2016-09-04 Thread Noah Misch
On Wed, Apr 27, 2016 at 08:15:05AM +, Christian Ullrich wrote: > * From: Michael Paquier [mailto:michael.paqu...@gmail.com] > > > On Wed, Apr 27, 2016 at 4:06 PM, Christian Ullrich > > wrote: > > > > * From: Michael Paquier [mailto:michael.paqu...@gmail.com] > > > >> vcbuild also supports /

Re: [HACKERS] OpenSSL 1.1 breaks configure and more

2016-09-04 Thread Andreas Karlsson
On 08/30/2016 08:42 AM, Heikki Linnakangas wrote: There's the ResourceOwner mechanism, see src/backend/utils/resowner/. That would be the proper way to do this. Call RegisterResourceReleaseCallback() when the context is allocated, and have the callback free it. One pitfall to watch out for is tha

Re: [HACKERS] Remove superuser() checks from pgstattuple

2016-09-04 Thread Stephen Frost
Tom, * Tom Lane (t...@sss.pgh.pa.us) wrote: > [ warning, thread hijack ahead ] quite. > Stephen Frost writes: > > * Peter Eisentraut (peter.eisentr...@2ndquadrant.com) wrote: > >> I think this is a good change to pursue, and we'll likely want to do > >> more similar changes in contrib. But I'm

Re: [HACKERS] Change error code for hstore syntax error

2016-09-04 Thread Marko Tiikkaja
Hi Sherrylyn, On 2016-05-09 19:42, Sherrylyn Branchaw wrote: I'm attaching a revised patch; please let me know if there are any other issues before I submit to the commitfest. I think this is mostly good, but these two should be changed: errmsg("unexpected end of string: \"%s\"", state->beg

Re: [HACKERS] \timing interval

2016-09-04 Thread Jim Nasby
On 9/3/16 2:35 PM, Tom Lane wrote: I pushed the patch using this: Time: 176460001.200 ms (2 d 01:01:00.001) and all else as before. I'd find this useful in the final output of EXPLAIN ANALYZE as well; any objections to adding it? -- Jim Nasby, Data Architect, Blue Treble Consulting, Austin

[HACKERS] Minor fix to comments

2016-09-04 Thread Jim Nasby
I noticed some imbalanced '-'s in execnodes.h. Though, ISTM newer code doesn't use -'s in comments anymore, so maybe it'd be better to just ditch them? -- Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX Experts in Analytics, Data Architecture and PostgreSQL Data in Trouble? Get it i

Re: [HACKERS] pg_sequence catalog

2016-09-04 Thread Greg Stark
On Wed, Aug 31, 2016 at 3:01 PM, Tom Lane wrote: > > Uh, not as subtly as all that, because "select * from sequence" will > now return a different set of columns, which will flat out break a > lot of clients that use that method to get sequence properties. So? Clients expect changes like this bet

Re: [HACKERS] Obsolete TODO item "-Wcast-align" ?

2016-09-04 Thread Christian Convey
On Sun, Sep 4, 2016 at 5:56 PM, Tom Lane wrote: > Christian Convey writes: >> I chose this item from the TODO page: "[E] Remove warnings created by >> -Wcast-align". It didn't have a check-mark after the "[E]", which I >> took to mean it's an outstanding issue. >> However, I'm starting to wonder

Re: [HACKERS] Obsolete TODO item "-Wcast-align" ?

2016-09-04 Thread Tom Lane
Christian Convey writes: > I chose this item from the TODO page: "[E] Remove warnings created by > -Wcast-align". It didn't have a check-mark after the "[E]", which I > took to mean it's an outstanding issue. > However, I'm starting to wonder if it's already been fixed: No, but you only see it o

Re: [HACKERS] Speed up Clog Access by increasing CLOG buffers

2016-09-04 Thread Tomas Vondra
Hi, This thread started a year ago, different people contributed various patches, some of which already got committed. Can someone please post a summary of this thread, so that it's a bit more clear what needs review/testing, what are the main open questions and so on? I'm interested in doing som

[HACKERS] Obsolete TODO item "-Wcast-align" ?

2016-09-04 Thread Christian Convey
Hi guys, I'm trying to get my feet wet in PG development, but I ran into a snag with the TODO item I picked. Could someone please tell me if I'm making an obvious error? I chose this item from the TODO page: "[E] Remove warnings created by -Wcast-align". It didn't have a check-mark after the "[

Re: [HACKERS] Better locale-specific-character-class handling for regexps

2016-09-04 Thread Tom Lane
I wrote: > I got tired of hearing complaints about the issue described in > this thread: > https://www.postgresql.org/message-id/flat/24241.1329347196%40sss.pgh.pa.us > Here's a proposed fix. I've not done extensive performance testing, > but it seems to be as fast or faster than the old code in c

Re: [HACKERS] [PATCH] Alter or rename enum value

2016-09-04 Thread Emre Hasegeli
> I started looking at this patch. I'm kind of unhappy with having *both* > IF EXISTS and IF NOT EXISTS options on the statement, especially since > the locations of those phrases in the syntax seem to have been chosen > with a dartboard. This feels way more confusing than it is useful. > Is ther

Re: [HACKERS] Better locale-specific-character-class handling for regexps

2016-09-04 Thread Tom Lane
Heikki Linnakangas writes: > On 08/23/2016 03:54 AM, Tom Lane wrote: >> ! the color map for characters above MAX_SIMPLE_CHR is really a 2-D array, >> ! whose rows correspond to character ranges that are explicitly mentioned >> ! in the input, and whose columns correspond to sets of relevant locale

Re: Transactional enum additions - was Re: [HACKERS] Alter or rename enum value

2016-09-04 Thread Tom Lane
Emre Hasegeli writes: >> + /* >> +* If the row is hinted as committed, it's surely safe. This provides a >> +* fast path for all normal use-cases. >> +*/ >> + if (HeapTupleHeaderXminCommitted(enumval_tup->t_data)) >> + return; >> + >> + /* >> +* Usually, a row would ge

Re: [HACKERS] Make better use of existing enums in plpgsql

2016-09-04 Thread Pavel Stehule
Hi 2016-08-19 16:56 GMT+02:00 Peter Eisentraut < peter.eisentr...@2ndquadrant.com>: > plpgsql.h defines a number of enums, but most of the code passes them > around as ints. The attached patch updates structs and function > prototypes to take enum types instead. This clarifies the struct > defi

Re: [HACKERS] Remove superuser() checks from pgstattuple

2016-09-04 Thread Tom Lane
[ warning, thread hijack ahead ] Stephen Frost writes: > * Peter Eisentraut (peter.eisentr...@2ndquadrant.com) wrote: >> I think this is a good change to pursue, and we'll likely want to do >> more similar changes in contrib. But I'm worried that what is logically >> a 10-line change will end up

Re: [HACKERS] Remove superuser() checks from pgstattuple

2016-09-04 Thread Stephen Frost
* Peter Eisentraut (peter.eisentr...@2ndquadrant.com) wrote: > On 8/23/16 5:22 PM, Stephen Frost wrote: > > Now that we track initial privileges on extension objects and changes to > > those permissions, we can drop the superuser() checks from the various > > functions which are part of the pgstatt

Re: [HACKERS] [PATCH] COPY vs \copy HINT

2016-09-04 Thread Tom Lane
I wrote: > Craig Ringer writes: >> I thought about that but figured it didn't really matter too much, >> when thinking about examples like >> # COPY batch_demo FROM '/root/secret.csv' WITH (FORMAT CSV); >> ERROR: could not open file "/root/secret.csv" for reading: Permission denied >> or whatever

Re: [HACKERS] Add support for restrictive RLS policies

2016-09-04 Thread Stephen Frost
* Robert Haas (robertmh...@gmail.com) wrote: > On Thu, Sep 1, 2016 at 12:04 PM, Stephen Frost wrote: > > As outlined in the commit message, this adds support for restrictive RLS > > policies. We've had this in the backend since 9.5, but they were only > > available via hooks and therefore extensi

Re: [HACKERS] [PATCH] Reload SSL certificates on SIGHUP

2016-09-04 Thread Andreas Karlsson
On 08/31/2016 11:34 PM, Peter Geoghegan wrote: On Sun, Nov 22, 2015 at 7:29 PM, Andreas Karlsson wrote: Sorry for dropping this patch, but now I have started looking at it again. Any chance of picking this up again soon, Andreas? I think it's an important project. I would like to review it.

Re: [HACKERS] LSN as a recovery target

2016-09-04 Thread Simon Riggs
On 4 September 2016 at 14:32, Abhijit Menon-Sen wrote: > At 2016-09-04 07:02:01 +0100, si...@2ndquadrant.com wrote: >> >> > By the way, what has been committed does not include the patch >> > adding the parsing context in case of an error as wanted upthread. >> > Perhaps that's not worth adding no

Re: [HACKERS] Better locale-specific-character-class handling for regexps

2016-09-04 Thread Heikki Linnakangas
On 08/23/2016 03:54 AM, Tom Lane wrote: ! That's still not quite enough, though, because of locale-dependent ! character classes such as [[:alpha:]]. In Unicode locales these classes ! may have thousands of entries that are above MAX_SIMPLE_CHR, and we ! certainly don't want to be searching larg

Re: [HACKERS] LSN as a recovery target

2016-09-04 Thread Abhijit Menon-Sen
At 2016-09-04 07:02:01 +0100, si...@2ndquadrant.com wrote: > > > By the way, what has been committed does not include the patch > > adding the parsing context in case of an error as wanted upthread. > > Perhaps that's not worth adding now as there is the GUC refactoring > > potentially happening fo

Re: [HACKERS] pg_hba_file_settings view patch

2016-09-04 Thread Christoph Berg
Re: Simon Riggs 2016-09-03 > pg_hba_file_settings seems a clumsy name. I'd prefer pg_hba_settings, > since that name could live longer than the concept of pg_hba.conf, > which seems likely to become part of ALTER SYSTEM in future, so we > wouldn't really want the word "file" in there. IMHO "sett

Re: [HACKERS] [sqlsmith] Failed assertion in numeric aggregate

2016-09-04 Thread Heikki Linnakangas
On 09/03/2016 08:59 PM, Tom Lane wrote: Andreas Seltenreich writes: Digging in the coredumps, it looks like set_var_from_num() is invoked on an uninitialized NumericVar. Sample gdb session below. Hm, yeah, looks like numeric_poly_deserialize is missing a required init_var() step. Slightly a

Re: Transactional enum additions - was Re: [HACKERS] Alter or rename enum value

2016-09-04 Thread Emre Hasegeli
> Got around to looking at this. Attached is a revised version that I think > is in committable shape. The main non-cosmetic change is that the test > for "type was created in same transaction as new value" now consists of > comparing the xmins of the pg_type and pg_enum rows, without consulting

Re: [HACKERS] IF (NOT) EXISTS in psql-completion

2016-09-04 Thread Pavel Stehule
Hi This patch needs rebase. Regards Pavel

Re: [HACKERS] patch: function xmltable

2016-09-04 Thread Pavel Stehule
Hi minor update - using DefElem instead own private parser type Regards Pavel diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 5148095..189d201 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -10099,6 +10099,47 @@ SELECT xmlroot(xmlparse(document 'abc'),