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

Поиск
Список
Период
Сортировка
От Daniel Gustafsson
Тема Re: CONSTANT/NOT NULL/initializer properties for plpgsql record variables
Дата
Msg-id F8CB403D-F8AA-49E3-B566-17949009846F@yesql.se
обсуждение исходный текст
Ответ на Re: CONSTANT/NOT NULL/initializer properties for plpgsql record variables  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> On 25 Jan 2018, at 16:34, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Daniel Gustafsson <daniel@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

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Nikolay Shaplov
Дата:
Сообщение: Re: [PATCH][PROPOSAL] Refuse setting toast.* reloptions when TOAST table does not exist
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: plpgsql function startup-time improvements