CONSTANT/NOT NULL/initializer properties for plpgsql record variables - Mailing list pgsql-hackers

From David G. Johnston
Subject CONSTANT/NOT NULL/initializer properties for plpgsql record variables
Date
Msg-id CAKFQuwZn9C9e+BmTegqVvJgWCz5gZXWQSoLPPX09F7R+6V4i6g@mail.gmail.com
Whole thread Raw
In response to Re: CONSTANT/NOT NULL/initializer properties for plpgsql record variables  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thursday, January 25, 2018, Tom Lane <tgl@sss.pgh.pa.us> 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 have the concept of mutable types other languages do.  Maybe just saying "from being assigned or mutated after initialization" would suffice.

I don't see a desirable way to reinforce that the y in arr[y] is unenforced documentation - in the code or docs - beyond what is already done.  That distinction doesn't usually come up and for those where it does the docs will probably be an after-the-fact confirmation of observed behavior.

David J.

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [PATCH][PROPOSAL] Refuse setting toast.* reloptions when TOASTtable does not exist
Next
From: Jesper Pedersen
Date:
Subject: Re: unique indexes on partitioned tables