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

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: CONSTANT/NOT NULL/initializer properties for plpgsql record variables
Date: 2018-01-25 17:28:49
Message-ID: F8CB403D-F8AA-49E3-B566-17949009846F@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 25 Jan 2018, at 16:34, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Daniel Gustafsson <daniel(at)yesql(dot)se> 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 confusion
>> around what y means in ‘x int[y]’, and I can see ‘x CONSTANT int[y]’ being
>> misinterpreted as “length fixed to y”.
>
> Hmm. What would you imagine the hint saying? It's certainly true that
> a lot of people don't understand that a declared array length doesn't
> mean anything in Postgres, but that's not specific to this context.

I was thinking about something along the lines of:

errhint("In array declarations, CONSTANT refers to elements and not length."),

.. when datatype->typisarray is true, but again it might just be waffling that
doesn’t help anyone.

cheers ./daniel

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2018-01-25 18:58:03 Re: plpgsql function startup-time improvements
Previous Message Nikolay Shaplov 2018-01-25 17:27:15 Re: [PATCH][PROPOSAL] Refuse setting toast.* reloptions when TOAST table does not exist