Re: CONSTANT/NOT NULL/initializer properties for plpgsql record variables

2018-01-25 Thread Daniel Gustafsson
> On 25 Jan 2018, at 16:34, Tom Lane wrote: > Daniel Gustafsson writes: >> One tiny thing: while not introduced in this patch, I wonder if it would be >> worth adding an errhint in the following hunk when applied to arrays, to >> clarify what CONSTANT in an array declaration mean. I have seen c

CONSTANT/NOT NULL/initializer properties for plpgsql record variables

2018-01-25 Thread David G. Johnston
On Thursday, January 25, 2018, Tom Lane wrote: > > The documentation currently says > > The CONSTANT option prevents the variable from being assigned to > after initialization, so that its value will remain constant for > the duration of the block. > While we don't really

Re: CONSTANT/NOT NULL/initializer properties for plpgsql record variables

2018-01-25 Thread Tom Lane
Daniel Gustafsson writes: > I’ve reviewed this patch (disclaimer: I did not review the patches listed > above > which it is based on) and the functionality introduced. The code is straight- > forward, there are ample tests and I can’t make it break however many weird > combinations thrown at it.

Re: CONSTANT/NOT NULL/initializer properties for plpgsql record variables

2018-01-25 Thread Daniel Gustafsson
> On 25 Jan 2018, at 00:32, Tom Lane wrote: > > I wrote: >> I said a couple of times in recent threads that it wouldn't be too hard >> to implement $SUBJECT given the other patches I've been working on. > > Here's a version rebased up to HEAD, with a trivial merge conflict fixed. > > This now n

Re: CONSTANT/NOT NULL/initializer properties for plpgsql record variables

2018-01-24 Thread Tom Lane
I wrote: > I said a couple of times in recent threads that it wouldn't be too hard > to implement $SUBJECT given the other patches I've been working on. Here's a version rebased up to HEAD, with a trivial merge conflict fixed. This now needs to be applied over the patches in https://postgr.es/m/8

CONSTANT/NOT NULL/initializer properties for plpgsql record variables

2017-12-29 Thread Tom Lane
I said a couple of times in recent threads that it wouldn't be too hard to implement $SUBJECT given the other patches I've been working on. Attached is proof of the pudding. This needs to be applied on top of the patches in https://postgr.es/m/23537.1514589...@sss.pgh.pa.us and https://postgr.es/m