Re: [HACKERS] [BUG] pg_basebackup from disconnected standby fails

2016-06-23 Thread Michael Paquier
On Thu, Jun 23, 2016 at 3:51 PM, Michael Paquier wrote: > By the way, do you mind if I add this patch to the next CF? Better not > to lose track of it... Well, I have added an entry here at the end: https://commitfest.postgresql.org/10/654/ Better doing it now before I

Re: [HACKERS] initdb issue on 64-bit Windows - (Was: [pgsql-packagers] PG 9.6beta2 tarballs are ready)

2016-06-23 Thread Craig Ringer
On 24 June 2016 at 13:00, Craig Ringer wrote: > I've now reproduced it with: > I can also confirm that it _doesn't_ crash with the same SDK using a 32-bit build (running under WoW on x64). cl 18.00.40629 for x86, env: %comspec% /k ""C:\Program Files

Re: [HACKERS] initdb issue on 64-bit Windows - (Was: [pgsql-packagers] PG 9.6beta2 tarballs are ready)

2016-06-23 Thread Craig Ringer
On 24 June 2016 at 12:31, Michael Paquier wrote: > On Fri, Jun 24, 2016 at 1:28 PM, Craig Ringer > wrote: > > Given that it's only been seen in VS 2013, it's particularly odd that > it's > > not biting woodlouse. > > > > I'd like more details

Re: [HACKERS] Missing checks when malloc returns NULL...

2016-06-23 Thread Michael Paquier
On Wed, Jun 22, 2016 at 10:41 AM, Michael Paquier wrote: > OK, there is not much that we can do here then. What about the rest? > Those seem like legit concerns to me. Registered this one to the next CF as a bug fix: https://commitfest.postgresql.org/10/653/ It would

Re: [HACKERS] initdb issue on 64-bit Windows - (Was: [pgsql-packagers] PG 9.6beta2 tarballs are ready)

2016-06-23 Thread Michael Paquier
On Fri, Jun 24, 2016 at 1:28 PM, Craig Ringer wrote: > Given that it's only been seen in VS 2013, it's particularly odd that it's > not biting woodlouse. > > I'd like more details from those whose installs are crashing. What exact > vcvars env did you run under, with which

Re: [HACKERS] initdb issue on 64-bit Windows - (Was: [pgsql-packagers] PG 9.6beta2 tarballs are ready)

2016-06-23 Thread Craig Ringer
On 24 June 2016 at 05:17, Umair Shahid wrote: > >> > It's still strange that it doesn't affect woodlouse. >> >> Or any of the other Windows critters... >> >> > Given that it's only been seen in VS 2013, it's particularly odd that it's not

Re: [HACKERS] tuplesort.c's copytup_index() is dead code

2016-06-23 Thread Peter Geoghegan
On Thu, Jun 23, 2016 at 8:35 PM, Tom Lane wrote: > We *do* have regression test coverage, but that code is set up to not > kick in at any index scale that would be sane to test in the regression > tests. See >

Re: [HACKERS] tuplesort.c's copytup_index() is dead code

2016-06-23 Thread Tom Lane
Peter Geoghegan writes: > FWIW, I think that that bug tells us a lot about hash index usage in > the field. It took many months for someone to complain about what > ought to have been a really obvious bug. Clearly, hardly anybody is > using hash indexes. I broke hash index

Re: [HACKERS] tuplesort.c's copytup_index() is dead code

2016-06-23 Thread Peter Geoghegan
On Thu, Jun 23, 2016 at 7:59 PM, Tom Lane wrote: > I think this may be premature in view of bug #14210. Even if we > don't reinstate use of this function to fix that, I'm not really > convinced we want to get rid of it; it seems likely to me that > we might want it again.

Re: [HACKERS] Odd behavior with domains

2016-06-23 Thread Justin Dearing
I was the one that reported that on twitter. I have a more detailed message on the general list that I sent before subscribing and probably needs to be moderated (or if it went to /dev/null let me know). On Thu, Jun 23, 2016 at 11:01 PM Tom Lane wrote: > "Joshua D. Drake"

Re: [HACKERS] initdb issue on 64-bit Windows - (Was: [pgsql-packagers] PG 9.6beta2 tarballs are ready)

2016-06-23 Thread Michael Paquier
On Fri, Jun 24, 2016 at 11:51 AM, Tsunakawa, Takayuki wrote: >> From: pgsql-hackers-ow...@postgresql.org >> [mailto:pgsql-hackers-ow...@postgresql.org] On Behalf Of Michael Paquier >> Sent: Friday, June 24, 2016 11:37 AM >> On Fri, Jun 24, 2016 at 11:33 AM, Craig

Re: [HACKERS] Odd behavior with domains

2016-06-23 Thread Tom Lane
"Joshua D. Drake" writes: > So this came across my twitter feed: > https://pbs.twimg.com/media/ClqIJtmXEAA5IGt.png public.text can exist in parallel with pg_catalog.text. Nothing to see here, move along. regards, tom lane -- Sent via

Re: [HACKERS] Odd behavior with domains

2016-06-23 Thread Alvaro Herrera
Joshua D. Drake wrote: > Hey, > > So this came across my twitter feed: > > https://pbs.twimg.com/media/ClqIJtmXEAA5IGt.png > > I have verified the oddness with a newer version: Well, it's not specifically related to domains -- it's related to the fact that pg_catalog objects mask the domain

Re: [HACKERS] tuplesort.c's copytup_index() is dead code

2016-06-23 Thread Tom Lane
Peter Geoghegan writes: > Commit 9f03ca915 removed the only COPYTUP() call that could reach > copytup_index() in practice, making copytup_index() dead code. > The attached patch removes this dead code, I think this may be premature in view of bug #14210. Even if we don't

Re: [HACKERS] initdb issue on 64-bit Windows - (Was: [pgsql-packagers] PG 9.6beta2 tarballs are ready)

2016-06-23 Thread Tsunakawa, Takayuki
> From: pgsql-hackers-ow...@postgresql.org > [mailto:pgsql-hackers-ow...@postgresql.org] On Behalf Of Michael Paquier > Sent: Friday, June 24, 2016 11:37 AM > On Fri, Jun 24, 2016 at 11:33 AM, Craig Ringer > wrote: > It might be worth testing that out and adding an initdb

Re: [HACKERS] Odd behavior with domains

2016-06-23 Thread Corey Huinker
On Thu, Jun 23, 2016 at 10:16 PM, Joshua D. Drake wrote: > Hey, > > So this came across my twitter feed: > > https://pbs.twimg.com/media/ClqIJtmXEAA5IGt.png > > I have verified the oddness with a newer version: > > psql -U postgres > psql (9.5.3) > Type "help" for help. >

Re: [HACKERS] initdb issue on 64-bit Windows - (Was: [pgsql-packagers] PG 9.6beta2 tarballs are ready)

2016-06-23 Thread Michael Paquier
On Fri, Jun 24, 2016 at 11:33 AM, Craig Ringer wrote: > Yes, quite possibly, actually. I should've just got Haroon to build me a new > initdb without the priv setting and with creation of crashdumps/ . > > It might be worth testing that out and adding an initdb startup flag

Re: [HACKERS] initdb issue on 64-bit Windows - (Was: [pgsql-packagers] PG 9.6beta2 tarballs are ready)

2016-06-23 Thread Craig Ringer
On 24 June 2016 at 10:28, Michael Paquier wrote: > On Fri, Jun 24, 2016 at 11:21 AM, Craig Ringer > wrote: > > * Launch a VS x86 command prompt > > * devenv /debugexe bin\initdb.exe -D test > > * Set a breakpoint in initdb.c:3557 and

Re: [HACKERS] initdb issue on 64-bit Windows - (Was: [pgsql-packagers] PG 9.6beta2 tarballs are ready)

2016-06-23 Thread Craig Ringer
On 24 June 2016 at 10:21, Craig Ringer wrote: > * To get a backtrace, I had to: > > * Launch a VS x86 command prompt > * devenv /debugexe bin\initdb.exe -D test > * Set a breakpoint in initdb.c:3557 and initdb.c:3307 > * Run > * When it traps at

Re: [HACKERS] initdb issue on 64-bit Windows - (Was: [pgsql-packagers] PG 9.6beta2 tarballs are ready)

2016-06-23 Thread Michael Paquier
On Fri, Jun 24, 2016 at 11:21 AM, Craig Ringer wrote: > * Launch a VS x86 command prompt > * devenv /debugexe bin\initdb.exe -D test > * Set a breakpoint in initdb.c:3557 and initdb.c:3307 > * Run > * When it traps at get_restricted_token(), manually move the

Re: [HACKERS] Hash Indexes

2016-06-23 Thread Amit Kapila
On Thu, Jun 23, 2016 at 10:56 PM, Robert Haas wrote: > On Wed, Jun 22, 2016 at 10:13 PM, Amit Kapila wrote: >>> A scan that has seen the flag won't look at the >>> tuple in any case. >> >> Why so? Assume that scan started on new bucket where >>

Re: [HACKERS] initdb issue on 64-bit Windows - (Was: [pgsql-packagers] PG 9.6beta2 tarballs are ready)

2016-06-23 Thread Craig Ringer
On 24 June 2016 at 05:17, Umair Shahid wrote: > On Fri, Jun 24, 2016 at 2:14 AM, Umair Shahid < > umair.sha...@2ndquadrant.com> wrote: > >> >> -- Forwarded message -- >> From: Tom Lane >> Date: Thu, Jun 23, 2016 at 9:32 PM >> Subject:

[HACKERS] Odd behavior with domains

2016-06-23 Thread Joshua D. Drake
Hey, So this came across my twitter feed: https://pbs.twimg.com/media/ClqIJtmXEAA5IGt.png I have verified the oddness with a newer version: psql -U postgres psql (9.5.3) Type "help" for help. postgres=# create domain text char(3); CREATE DOMAIN postgres=# create domain text char(2); ERROR:

[HACKERS] tuplesort.c's copytup_index() is dead code

2016-06-23 Thread Peter Geoghegan
Commit 9f03ca915 removed the only COPYTUP() call that could reach copytup_index() in practice, making copytup_index() dead code. The attached patch removes this dead code, in line with the existing copytup_datum() case, where tuplesort.c also doesn't directly support COPYTUP() (due to similar

Re: [HACKERS] Reviewing freeze map code

2016-06-23 Thread Amit Kapila
On Fri, Jun 24, 2016 at 4:33 AM, Andres Freund wrote: > On 2016-06-23 18:59:57 -0400, Alvaro Herrera wrote: >> Andres Freund wrote: >> >> > I'm looking into three approaches right now: >> > >> > 3) Use WAL logging for the already_marked = true case. >> >> >> > 3) This approach

Re: [HACKERS] Rethinking representation of partial-aggregate steps

2016-06-23 Thread David Rowley
On 24 June 2016 at 05:55, Tom Lane wrote: > #define AGGOP_COMBINESTATES 0x1 > #define AGGOP_SERIALIZESTATES 0x2 > #define AGGOP_DESERIALIZESTATES 0x4 > #define AGGOP_FINALIZEAGGS 0x8 > > typedef enum AggPartialMode > { > AGGPARTIAL_SIMPLE = AGGOP_FINALIZEAGGS, >

Re: [HACKERS] Feature suggestions: "dead letter"-savepoint.

2016-06-23 Thread Tsunakawa, Takayuki
From: pgsql-hackers-ow...@postgresql.org [mailto:pgsql-hackers-ow...@postgresql.org] On Behalf Of Craig Ringer Now, what I do think we need is to give the client the ability to determine whether one of its xacts actually committed or not when it lost the session after dispatching COMMIT but

Re: [HACKERS] Rethinking representation of partial-aggregate steps

2016-06-23 Thread Tom Lane
David Rowley writes: > As for the above proposal, I do agree that it'll be cleaner with bit > flags, I just really don't see the need for the AGGTYPE_* alias > macros. For me it's easier to read if each option is explicitly listed > similar to how pull_var_clause()

Re: [HACKERS] Rethinking representation of partial-aggregate steps

2016-06-23 Thread David Rowley
On 24 June 2016 at 05:12, Robert Haas wrote: > I do agree, however, that the three Boolean flags don't make the code > entirely easy to read. What I might suggest is that we replace the > three Boolean flags with integer flags, something like this: > > #define

Re: [HACKERS] Reviewing freeze map code

2016-06-23 Thread Andres Freund
On 2016-06-23 18:59:57 -0400, Alvaro Herrera wrote: > Andres Freund wrote: > > > I'm looking into three approaches right now: > > > > 3) Use WAL logging for the already_marked = true case. > > > > 3) This approach so far seems the best. It's possible to reuse the > > xl_heap_lock record (in an

Re: [HACKERS] Reviewing freeze map code

2016-06-23 Thread Alvaro Herrera
Andres Freund wrote: > I'm looking into three approaches right now: > > 3) Use WAL logging for the already_marked = true case. > 3) This approach so far seems the best. It's possible to reuse the > xl_heap_lock record (in an afaics backwards compatible manner), and in > most cases the overhead

Re: [HACKERS] Rethinking representation of partial-aggregate steps

2016-06-23 Thread David Rowley
On 24 June 2016 at 05:25, Tom Lane wrote: > Robert Haas writes: >> Hmm, well I guess I would have to disagree with the idea that those >> other modes aren't useful. I seem to recall that David had some >> performance results showing that pushing partial

Re: [HACKERS] Reviewing freeze map code

2016-06-23 Thread Andres Freund
On 2016-06-21 16:32:03 -0400, Robert Haas wrote: > On Tue, Jun 21, 2016 at 3:46 PM, Andres Freund wrote: > > On 2016-06-21 15:38:25 -0400, Robert Haas wrote: > >> On Tue, Jun 21, 2016 at 1:49 PM, Andres Freund wrote: > >> >> I'm also a bit dubious that

Re: [HACKERS] Questionabl description in datatype.sgml

2016-06-23 Thread Tatsuo Ishii
> On Sat, Jun 18, 2016 at 11:58:58AM -0400, Tom Lane wrote: >> Tatsuo Ishii writes: >> > In "8.13.2. Encoding Handling" >> > >> > When using binary mode to pass query parameters to the server >> > and query results back to the client, no character set conversion

Re: [HACKERS] Protocol buffer support for Postgres

2016-06-23 Thread Flavius Anton
On Thu, Jun 23, 2016 at 1:50 PM, Greg Stark wrote: > On Thu, Jun 23, 2016 at 8:15 PM, Flavius Anton wrote: >> >> I'd love to talk more about this. > > I thought quite a bit about this a few years ago but never really > picked up it to work on. > > Another

[HACKERS] initdb issue on 64-bit Windows - (Was: [pgsql-packagers] PG 9.6beta2 tarballs are ready)

2016-06-23 Thread Umair Shahid
On Fri, Jun 24, 2016 at 2:14 AM, Umair Shahid wrote: > > -- Forwarded message -- > From: Tom Lane > Date: Thu, Jun 23, 2016 at 9:32 PM > Subject: Re: [pgsql-packagers] PG 9.6beta2 tarballs are ready > To: Magnus Hagander

Re: [HACKERS] Protocol buffer support for Postgres

2016-06-23 Thread Greg Stark
On Thu, Jun 23, 2016 at 8:15 PM, Flavius Anton wrote: > > I'd love to talk more about this. I thought quite a bit about this a few years ago but never really picked up it to work on. There are different use cases where this could be useful and different approaches that

Re: [HACKERS] Protocol buffer support for Postgres

2016-06-23 Thread Flavius Anton
On Tue, Apr 26, 2016 at 2:40:49PM -0700, David Fetter wrote: > Should we see about making a more flexible serialization > infrastructure? What we have is mostly /ad hoc/, and has already > caused real pain to the PostGIS folks, this even after some pretty > significant and successful efforts were

Re: [HACKERS] Bug in to_timestamp().

2016-06-23 Thread David G. Johnston
On Thu, Jun 23, 2016 at 2:00 PM, Robert Haas wrote: > On Thu, Jun 23, 2016 at 1:46 PM, David G. Johnston > wrote: > >> Sheesh. Who put you in charge of this? You basically seem like you > >> are trying to shut up anyone who supports this

Re: [HACKERS] Bug in to_timestamp().

2016-06-23 Thread Jim Nasby
On 6/23/16 12:29 PM, Alvaro Herrera wrote: David G. Johnston wrote: On Thursday, June 23, 2016, Alex Ignatov wrote: Arguing just like that one can say that we don't even need exception like "division by zero". Just use well-formed numbers in denominator... Input

Re: [HACKERS] Rethinking representation of partial-aggregate steps

2016-06-23 Thread Tom Lane
Alvaro Herrera writes: > Tom Lane wrote: >> Yeah, that's another way we could go. I had been considering a variant >> of that, which was to assign specific code values to the enum constants >> and then invent macros that did bit-anding tests on them. That ends up >>

Re: [HACKERS] Bug in to_timestamp().

2016-06-23 Thread Tom Lane
Robert Haas writes: > On Thu, Jun 23, 2016 at 1:40 PM, Tom Lane wrote: >> At the very least I'd want to see a thought-through proposal that >> addresses all three of these interrelated points: >> >> * what should a space in the format match >> * what

Re: [HACKERS] Rethinking representation of partial-aggregate steps

2016-06-23 Thread Alvaro Herrera
Tom Lane wrote: > What I'm imagining is, say, > > #define AGGOP_COMBINESTATES 0x1 > #define AGGOP_SERIALIZESTATES 0x2 > #define AGGOP_DESERIALIZESTATES 0x4 > #define AGGOP_FINALIZEAGGS 0x8 > > typedef enum AggPartialMode > { > AGGPARTIAL_SIMPLE = AGGOP_FINALIZEAGGS, > AGGPARTIAL_PARTIAL

Re: [HACKERS] Bug in to_timestamp().

2016-06-23 Thread Robert Haas
On Thu, Jun 23, 2016 at 1:46 PM, David G. Johnston wrote: >> Sheesh. Who put you in charge of this? You basically seem like you >> are trying to shut up anyone who supports this change, and I don't >> think that's right. > > I'm all for a change in this area - though

Re: [HACKERS] Rethinking representation of partial-aggregate steps

2016-06-23 Thread Simon Riggs
On 23 June 2016 at 18:31, Robert Haas wrote: > > Sure, but aggregating as early as possible will often have the effect > of dramatically reducing the number of tuples that have to pass > through upper levels of the plan tree, which seems it would frequently > far outweigh

Re: [HACKERS] Bug in to_timestamp().

2016-06-23 Thread David G. Johnston
On Thursday, June 23, 2016, Robert Haas wrote: > On Thu, Jun 23, 2016 at 1:12 PM, David G. Johnston > > wrote: > > to_timestamp with its present behavior is, IMO, a poorly designed > function > > that would never be accepted today.

Re: [HACKERS] Bug in to_timestamp().

2016-06-23 Thread Robert Haas
On Thu, Jun 23, 2016 at 1:40 PM, Tom Lane wrote: > Robert Haas writes: >> On Thu, Jun 23, 2016 at 1:12 PM, David G. Johnston >> wrote: >>> My understanding is that is not going to change for 9.6. > >> That's exactly what is

Re: [HACKERS] Bug in to_timestamp().

2016-06-23 Thread Tom Lane
Robert Haas writes: > On Thu, Jun 23, 2016 at 1:12 PM, David G. Johnston > wrote: >> My understanding is that is not going to change for 9.6. > That's exactly what is under discussion here. I would definitely agree with David on that point.

Re: [HACKERS] Rethinking representation of partial-aggregate steps

2016-06-23 Thread Alvaro Herrera
Tom Lane wrote: > Robert Haas writes: > > I do agree, however, that the three Boolean flags don't make the code > > entirely easy to read. What I might suggest is that we replace the > > three Boolean flags with integer flags, something like this: > > Yeah, that's

Re: [HACKERS] Rethinking representation of partial-aggregate steps

2016-06-23 Thread Robert Haas
On Thu, Jun 23, 2016 at 1:25 PM, Tom Lane wrote: > Robert Haas writes: >> On Thu, Jun 23, 2016 at 12:26 PM, Tom Lane wrote: >>> I'm inclined to think that we should aggressively simplify here, perhaps >>> replacing all three of

Re: [HACKERS] Bug in to_timestamp().

2016-06-23 Thread Alvaro Herrera
David G. Johnston wrote: > On Thursday, June 23, 2016, Alex Ignatov wrote: > > > Arguing just like that one can say that we don't even need exception like > > "division by zero". Just use well-formed numbers in denominator... > > Input data sometimes can be generated

Re: [HACKERS] Hash Indexes

2016-06-23 Thread Robert Haas
On Wed, Jun 22, 2016 at 10:13 PM, Amit Kapila wrote: >> A scan that has seen the flag won't look at the >> tuple in any case. > > Why so? Assume that scan started on new bucket where > split-in-progress flag was set, now it will not look at tuples that > are marked as

Re: [HACKERS] Rethinking representation of partial-aggregate steps

2016-06-23 Thread Tom Lane
Robert Haas writes: > On Thu, Jun 23, 2016 at 12:26 PM, Tom Lane wrote: >> I'm inclined to think that we should aggressively simplify here, perhaps >> replacing all three of these flags with a three-way enum, say >> >> PARTIALAGG_NORMAL /* simple

Re: [HACKERS] Bug in to_timestamp().

2016-06-23 Thread Robert Haas
On Thu, Jun 23, 2016 at 1:12 PM, David G. Johnston wrote: > to_timestamp with its present behavior is, IMO, a poorly designed function > that would never be accepted today. Concrete proposals for either fixing or > deprecating (or both) are welcome. Fixing it should

Re: [HACKERS] Bug in to_timestamp().

2016-06-23 Thread Robert Haas
On Thu, Jun 23, 2016 at 12:37 PM, David G. Johnston wrote > To be honest I don't see how this is relevant to quoted content. And you've > already made this point quite clearly - repeating it isn't constructive. > This behavior has existed for a long time and I don't

Re: [HACKERS] Bug in to_timestamp().

2016-06-23 Thread David G. Johnston
On Thursday, June 23, 2016, Alex Ignatov wrote: > Arguing just like that one can say that we don't even need exception like > "division by zero". Just use well-formed numbers in denominator... > Input data sometimes can be generated automagically. Without exception >

Re: [HACKERS] Rethinking representation of partial-aggregate steps

2016-06-23 Thread Robert Haas
On Thu, Jun 23, 2016 at 12:26 PM, Tom Lane wrote: > I really dislike this aspect of the partial-aggregate patch: > > typedef struct Agg > { > ... > boolcombineStates; /* input tuples contain transition states */ > boolfinalizeAggs; /* should we

Re: [HACKERS] Bug in to_timestamp().

2016-06-23 Thread Alex Ignatov
On 23.06.2016 19:37, David G. Johnston wrote: On Thu, Jun 23, 2016 at 12:16 PM, Alex Ignatov >wrote: On 23.06.2016 16:30, Bruce Momjian wrote: On Thu, Jun 23, 2016 at 07:41:26AM +, amul sul wrote: On

Re: [HACKERS] Bug in to_timestamp().

2016-06-23 Thread David G. Johnston
On Thu, Jun 23, 2016 at 12:16 PM, Alex Ignatov wrote: > > On 23.06.2016 16:30, Bruce Momjian wrote: > >> On Thu, Jun 23, 2016 at 07:41:26AM +, amul sul wrote: >> >>> On Monday, 20 June 2016 8:53 PM, Alex Ignatov >>> wrote: >>> >>> >>> On

[HACKERS] Rethinking representation of partial-aggregate steps

2016-06-23 Thread Tom Lane
I really dislike this aspect of the partial-aggregate patch: typedef struct Agg { ... boolcombineStates; /* input tuples contain transition states */ boolfinalizeAggs; /* should we call the finalfn on agg states? */ boolserialStates; /* should agg

Re: [HACKERS] Bug in to_timestamp().

2016-06-23 Thread Alex Ignatov
On 23.06.2016 16:30, Bruce Momjian wrote: On Thu, Jun 23, 2016 at 07:41:26AM +, amul sul wrote: On Monday, 20 June 2016 8:53 PM, Alex Ignatov wrote: On 13.06.2016 18:52, amul sul wrote: And it wont stop on some simple whitespace. By using to_timestamp you can

Re: [HACKERS] Parallelized polymorphic aggs, and aggtype vs aggoutputtype

2016-06-23 Thread Tom Lane
David Rowley writes: > On 23 June 2016 at 11:22, Tom Lane wrote: >> The behavior that I'd expect (and that I documented) for a deserialization >> function is that it just allocates its result in the current, short-lived >> memory context, since

Re: [HACKERS] how is the WAL receiver process stopped and restarted when the network connection is broken and then restored?

2016-06-23 Thread Rui Hai Jiang
Thank you Craig for your suggestion. I followed the clue and spent the whole day digging into the code. Finally I figured out how the WAL receiver exits and restarts. Question-1. How the WAL receiver process exits === When the network connection is

Re: [HACKERS] PQconnectdbParams vs PQconninfoParse

2016-06-23 Thread Tom Lane
Craig Ringer writes: > While writing some code that takes a connstring and adds some parameters, I > noticed that PQconninfoParse doesn't play well with PQconnectdbParams. > PQconnectdbParams takes a pair of equal-length arrays, one for keys and one > for values, each

Re: [HACKERS] Bug in to_timestamp().

2016-06-23 Thread Bruce Momjian
On Thu, Jun 23, 2016 at 07:41:26AM +, amul sul wrote: > On Monday, 20 June 2016 8:53 PM, Alex Ignatov > wrote: > > > >>On 13.06.2016 18:52, amul sul wrote: > >And it wont stop on some simple whitespace. By using to_timestamp you > >can get any output results by

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

2016-06-23 Thread Bruce Momjian
On Thu, Jun 23, 2016 at 06:42:57AM +, Tsunakawa, Takayuki wrote: > > From: Bruce Momjian [mailto:br...@momjian.us] > > We have this text in src/tools/RELEASE_CHANGES: > > ... > > This is saying running against a mismatched minor version should be fine > > for a binary. > > Thanks for a good

[HACKERS] Extract Jsonb key and values

2016-06-23 Thread hari.prasath
Hi all, I am having jsonb as C character string received by WAL decoding and want to extract all its key and value pairs. Which is the best approach for extracting keys and its values? i) Converting the C string to a PostgreSQL jsonb object ii) Using open-source json-c

Re: [HACKERS] Feature suggestions: "dead letter"-savepoint.

2016-06-23 Thread Craig Ringer
On 23 June 2016 at 17:34, Terje Elde wrote: > > But what if there’s a bug making a call to the external service? Most of > the time, you’ll trap the error and set status to something sane, but what > if there’s a crash-bug in the SDK implementing it, or some other situation >

Re: [HACKERS] Feature suggestions: "dead letter"-savepoint.

2016-06-23 Thread Terje Elde
> On 23 Jun 2016, at 11:50, Marko Tiikkaja wrote: > > Comparing these two; how is the latter any better? It's the same number of > commands, except it's holding a transaction open for longer, it's using a > non-standard concept and it's arguably more complex. Same number of

Re: [HACKERS] Requesting external_pid_file with postgres -C when not initialized lead to coredump

2016-06-23 Thread alain radix
Testing that external_pid_file was not null didn't seem necessary to me because it's initialized to '' and background workers could only start after the startup piece of code. If external_pid_file is set to null while the server run, then I prefer to not hide the problem as it would only be

Re: [HACKERS] Feature suggestions: "dead letter"-savepoint.

2016-06-23 Thread Marko Tiikkaja
On 2016-06-23 12:34, Terje Elde wrote: Typically the flow would be something like: BEGIN; SELECT id FROM targets WHERE status=‘scheduled’ FOR UPDATE SKIP LOCKED LIMIT 1; UPDATE targets SET status=‘in-flight’ WHERE id =%(id); COMMIT; — Do the work. BEGIN; UPDATE targets SET status=‘completed’

[HACKERS] Feature suggestions: "dead letter"-savepoint.

2016-06-23 Thread Terje Elde
Hi all, I’d like to pitch the idea of supporting “dead letter”-savepoints, similar to the way you have “dead letter”-exchanges in message-queue systems, etc. The idea is basically that a client can publish a message, but in such a away that it only ever actually gets published if the client

[HACKERS] PQconnectdbParams vs PQconninfoParse

2016-06-23 Thread Craig Ringer
Hi all While writing some code that takes a connstring and adds some parameters, I noticed that PQconninfoParse doesn't play well with PQconnectdbParams. PQconnectdbParams takes a pair of equal-length arrays, one for keys and one for values, each terminated by null elements. But PQconninfoParse

Re: [HACKERS] Bug in to_timestamp().

2016-06-23 Thread amul sul
On Monday, 20 June 2016 8:53 PM, Alex Ignatov wrote: >>On 13.06.2016 18:52, amul sul wrote: >And it wont stop on some simple whitespace. By using to_timestamp you >can get any output results by providing illegal input parameters values: >postgres=# SELECT

[HACKERS] Comment and function argument names are mismatched in bugmgr.c.

2016-06-23 Thread Masahiko Sawada
Hi all, By commit 428b1d6b, function WritebackContextInit is added but the comment of this function seems to be incorrect. *max_coalesce variable doesn't exist at anywhere. Also, I think it should be fixed that the argument name of this function does not match function declare in buf_internal.h.

Re: [HACKERS] [BUG] pg_basebackup from disconnected standby fails

2016-06-23 Thread Michael Paquier
On Thu, Jun 23, 2016 at 3:50 PM, Michael Paquier wrote: > On Wed, Jun 15, 2016 at 4:52 PM, Kyotaro HORIGUCHI > wrote: >> Hello, > > Sorry for the late reply, Horiguchi-san. I have finally been able to > put some mind power into that. >

Re: [HACKERS] [BUG] pg_basebackup from disconnected standby fails

2016-06-23 Thread Michael Paquier
On Wed, Jun 15, 2016 at 4:52 PM, Kyotaro HORIGUCHI wrote: > Hello, Sorry for the late reply, Horiguchi-san. I have finally been able to put some mind power into that. > This is somewhat artificial but the same situation could be made > also in the nature. The

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

2016-06-23 Thread Tsunakawa, Takayuki
> From: Bruce Momjian [mailto:br...@momjian.us] > We have this text in src/tools/RELEASE_CHANGES: > ... > This is saying running against a mismatched minor version should be fine > for a binary. Thanks for a good rationale. > I know this thread is old but it bounced around a lot of ideas. I