I'd like to discuss scaleout at PGCon

2018-05-26 Thread MauMau
Hello, I'm going to attend PGCon in Ottawa for the first time. I am happy if I can meet you. Because I'm visually impaired, I only have vision to sense light. If you see a Japanese man with a height of 171 cm with a white cane, it's probably me. I'd be happy if you talk to me. But as I'm stil

Re: Allowing printf("%m") only where it actually works

2018-05-26 Thread Thomas Munro
On Sun, May 27, 2018 at 12:38 PM, Tom Lane wrote: > At least in the case of ereport, all it takes to create a hazard is > more than one sub-function, eg this is risky: > > ereport(..., errmsg(..., strerror(errno)), errdetail(...)); > > because errdetail() might run first and malloc some me

Re: Allowing printf("%m") only where it actually works

2018-05-26 Thread Tom Lane
I wrote: > ... It doesn't take much to make one nontrivial either. If > memory serves, malloc() can trash errno on some platforms such as macOS, > so even just a palloc creates a hazard of a hard-to-reproduce problem. After digging around in the archives, the closest thing that we seem to know fo

Re: Allowing printf("%m") only where it actually works

2018-05-26 Thread Tom Lane
Thomas Munro writes: > On Sun, May 27, 2018 at 4:21 AM, Tom Lane wrote: >> (Basically what this would protect against is elog_start changing errno, >> which it doesn't.) > Hmm. It looks like errstart() preserves errno to protect %m not from > itself, but from the caller's other arguments to the

Re: Allowing printf("%m") only where it actually works

2018-05-26 Thread Thomas Munro
On Sun, May 27, 2018 at 4:21 AM, Tom Lane wrote: > ... So that seems like a rather high price to > pay to deal with what, at present, is a purely hypothetical hazard. > (Basically what this would protect against is elog_start changing errno, > which it doesn't.) Hmm. It looks like errstart() pr

Re: Redesigning the executor (async, JIT, memory efficiency)

2018-05-26 Thread Andres Freund
On 2018-05-26 17:08:51 -0400, Robert Haas wrote: > On Fri, May 25, 2018 at 2:40 AM, Andres Freund wrote: > > I think we're going to have to continue showing the tree plan. I think > > the linear version is far too hard to understand for anything > > nontrivial. > > Some of that is because this for

Re: SPI/backend equivalent of extended-query Describe(statement)?

2018-05-26 Thread Andrew Gierth
> "Chapman" == Chapman Flack writes: >> So what I'm thinking now is that the way to go, if one wants to >> imitate the client-side protocol behavior closely, would be to have >> a setup hook that calls parse_variable_parameters the first time, >> and then parse_fixed_parameters on subsequ

Re: Redesigning the executor (async, JIT, memory efficiency)

2018-05-26 Thread Robert Haas
On Fri, May 25, 2018 at 2:40 AM, Andres Freund wrote: > I think we're going to have to continue showing the tree plan. I think > the linear version is far too hard to understand for anything > nontrivial. Some of that is because this format is intrinsically hard to read, but it's also partly beca

Re: found xmin from before relfrozenxid on pg_catalog.pg_authid

2018-05-26 Thread Andres Freund
On 2018-05-26 13:45:06 -0700, Andres Freund wrote: > On 2018-05-25 15:05:31 -0700, Andres Freund wrote: > > On 2018-05-25 17:47:37 -0400, Tom Lane wrote: > > > For nailed indexes, we allow updating of some additional fields, and I > > > guess what has to happen here is that we teach the code to upd

Periods

2018-05-26 Thread Vik Fearing
SQL:2011 introduced the concept of a "period". It takes two existing columns and basically does the same thing as our range types except there is no new storage. I believe if Jeff Davis had given us range types a few years later than he did, it would have been using periods. Attached is a WIP

Re: found xmin from before relfrozenxid on pg_catalog.pg_authid

2018-05-26 Thread Andres Freund
On 2018-05-25 15:05:31 -0700, Andres Freund wrote: > On 2018-05-25 17:47:37 -0400, Tom Lane wrote: > > For nailed indexes, we allow updating of some additional fields, and I > > guess what has to happen here is that we teach the code to update some > > additional fields for nailed tables too. > >

Re: SPI/backend equivalent of extended-query Describe(statement)?

2018-05-26 Thread Chapman Flack
On 05/26/18 15:22, Andrew Gierth wrote: > So what I'm thinking now is that the way to go, if one wants to imitate > the client-side protocol behavior closely, would be to have a setup hook > that calls parse_variable_parameters the first time, and then > parse_fixed_parameters on subsequent calls f

Re: SPI/backend equivalent of extended-query Describe(statement)?

2018-05-26 Thread Andrew Gierth
> "Chapman" == Chapman Flack writes: >> Really our hook mechanism only supports adding hooks, not removing >> them. Chapman> I suppose the pllua_spi_prepare_checkparam_hook could be Chapman> linked in once and for all, and turned on and off just where Chapman> the code now hooks and unh

Re: Adding a new table to the system catalog

2018-05-26 Thread Tom Lane
Paul Howells writes: > I am exploring and poking at the source code to inform a design for adding > valid-time support to postgres. The feature will required updating > existing system catalog tables as well as adding one or more new tables. > Is there any documentation on how to update the syst

Re: Allowing printf("%m") only where it actually works

2018-05-26 Thread Tom Lane
I wrote: > Thomas Munro writes: >> Here's an experimental way to do that, if you don't mind depending on >> gory details of libc implementations (ie knowledge of what it expands >> too). Not sure how to avoid that since it's a macro on all modern >> systems, and we don't have a way to temporarily

Re: SPI/backend equivalent of extended-query Describe(statement)?

2018-05-26 Thread Chapman Flack
On 05/26/18 10:03, Tom Lane wrote: > Really our hook mechanism only supports adding hooks, not removing them. I suppose the pllua_spi_prepare_checkparam_hook could be linked in once and for all, and turned on and off just where the code now hooks and unhooks it, and just forward to the next hook w

Adding a new table to the system catalog

2018-05-26 Thread Paul Howells
Hello All, I am exploring and poking at the source code to inform a design for adding valid-time support to postgres. The feature will required updating existing system catalog tables as well as adding one or more new tables. Is there any documentation on how to update the system catalog? What

Re: [PATCH] Clear up perlcritic 'missing return' warning

2018-05-26 Thread Andrew Dunstan
On 05/23/2018 02:00 PM, Andrew Dunstan wrote: On Wed, May 23, 2018 at 1:45 PM, Alvaro Herrera wrote: On 2018-May-23, Andrew Dunstan wrote: And yes, the idea is that if we do this then we adopt a perlcritic policy that calls it out when we forget. If we can have a buildfarm animal that runs

Re: jsonb iterator not fully initialized

2018-05-26 Thread Andrew Dunstan
On 05/26/2018 03:09 AM, Piotr Stefaniak wrote: On 2018-05-26 02:02, Peter Eisentraut wrote: I got this error message via -fsanitized=undefined: jsonfuncs.c:5169:12: runtime error: load of value 127, which is not a valid value for type '_Bool' The query was select ts_headline('{}'::jsonb, ts

Re: SCRAM with channel binding downgrade attack

2018-05-26 Thread Michael Paquier
On Sat, May 26, 2018 at 09:08:50AM -0400, Bruce Momjian wrote: > On Sat, May 26, 2018 at 08:32:20AM +0900, Michael Paquier wrote: >> >> OK, I can live with that as well. So we'll go in the direction of two >> parameters then: >> - scram_channel_binding, which can use "prefer" (default), "require"

Re: Avoiding Tablespace path collision for primary and standby

2018-05-26 Thread Tom Lane
Thomas Munro writes: > I also wondered about this when trying to figure out how to write a > TAP test for recovery testing with tablespaces, for my undo proposal. > I was starting to wonder about either allowing relative paths or > supporting some kind of variable in the tablespace path that could

Re: SPI/backend equivalent of extended-query Describe(statement)?

2018-05-26 Thread Tom Lane
Andrew Gierth writes: > "Tom" == Tom Lane writes: > Tom> Yikes. That seems pretty unsafe :-( > I put in a recursion check out of paranoia, but even after considerable > thought wasn't able to figure out any scenario that would actually break > it. If it's actually unsafe I'd really like to kno

Re: SCRAM with channel binding downgrade attack

2018-05-26 Thread Bruce Momjian
On Sat, May 26, 2018 at 08:32:20AM +0900, Michael Paquier wrote: > On Fri, May 25, 2018 at 06:24:07PM +0300, Heikki Linnakangas wrote: > > On 25 May 2018 17:44:16 EEST, Robert Haas wrote: > >> It seems to me that this is really another sort of thing altogether. > >> Whether or not you want to insi

Re: zheap: a new storage format for PostgreSQL

2018-05-26 Thread Amit Kapila
On Fri, Mar 2, 2018 at 4:05 PM, Alexander Korotkov wrote: > On Fri, Mar 2, 2018 at 1:31 PM, Amit Kapila wrote: >> >> On Fri, Mar 2, 2018 at 1:50 PM, Tsunakawa, Takayuki >> wrote: >> > From: Amit Kapila [mailto:amit.kapil...@gmail.com] >> >> At EnterpriseDB, we (me and some of my colleagues) are

Re: jsonb iterator not fully initialized

2018-05-26 Thread Piotr Stefaniak
On 2018-05-26 02:02, Peter Eisentraut wrote: > I got this error message via -fsanitized=undefined: > > jsonfuncs.c:5169:12: runtime error: load of value 127, which is not a > valid value for type '_Bool' > > The query was > > select ts_headline('{}'::jsonb, tsquery('aaa & bbb')); > > This calls