Re: pgbench - test whether a variable exists

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: pgbench - test whether a variable exists
Дата
Msg-id 20200414010151.GC1492@paquier.xyz
обсуждение исходный текст
Ответ на Re: pgbench - test whether a variable exists  (Fabien COELHO <coelho@cri.ensmp.fr>)
Ответы Re: pgbench - test whether a variable exists
Список pgsql-hackers
On Mon, Apr 13, 2020 at 09:54:01AM +0200, Fabien COELHO wrote:
> Attached a v4. I'm resurrecting this small patch, after "\aset" has been
> added to pgbench (9d8ef988).

Hmm.  It seems to me that this stuff needs to be more careful with the
function handling?  For example, all those cases fail but they
directly pass down a variable that may not be defined, so shouldn't
those results be undefined as well instead of failing:
\set g double(:{?no_such_variable})
\set g exp(:{?no_such_variable})
\set g greatest(:{?no_such_variable}, :{?no_such_variable})
\set g int(:{?no_such_variable})

It seems to me that there could be a point in having the result of any
function to become undefined if using at least one undefined argument
(the point could be made as well that things like greatest just ignore
conditioned variables), so I was surprised to not see the logic more
linked with ENODE_VARIABLE.  If your intention is to keep this
behavior, it should at least be tested I guess.  Please note that this
patch will have to wait until v14 opens for business for more
comments.  :p
--
Michael

Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: pg_basebackup, manifests and backends older than ~12
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: [patch] some PQExpBuffer are not destroyed in pg_dump