Re: Underscore in positional parameters?

Поиск
Список
Период
Сортировка
От Erik Wienhold
Тема Re: Underscore in positional parameters?
Дата
Msg-id 7e7d7001-bc48-4b7d-b937-d77fcd7ac31b@ewie.name
обсуждение исходный текст
Ответ на Re: Underscore in positional parameters?  (Alexander Lakhin <exclusion@gmail.com>)
Ответы Re: Underscore in positional parameters?
Список pgsql-hackers
On 2024-05-19 07:00 +0200, Alexander Lakhin wrote:
> I encountered anomalies that you address with this patch too.
> And I can confirm that it fixes most cases, but there is another one:
> SELECT $300000000 \bind 'foo' \g
> ERROR:  invalid memory alloc request size 1200000000
> 
> Maybe you would find this worth fixing as well.

Yes, that error message is not great.  In variable_paramref_hook we
check paramno > INT_MAX/sizeof(Oid) when in fact MaxAllocSize/sizeof(Oid)
is the more appropriate limit to avoid that unspecific alloc size error.

Fixed in v4 with a separate patch because it's unrelated to the param
number parsing.  But it fits nicely into the broader issue on the upper
limit for param numbers.  Note that $268435455 is still the largest
possible param number ((2^30-1)/4) and that we just return a more
user-friendly error message for params beyond that limit.

-- 
Erik

Вложения

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

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: commitfest.postgresql.org is no longer fit for purpose
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [PATCH] Avoid mixing custom and OpenSSL BIO functions