> On 25 Jan 2018, at 16:34, Tom Lane <t...@sss.pgh.pa.us> wrote:
> Daniel Gustafsson <dan...@yesql.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

Reply via email to