Re: pgbench logging broken by time logic changes

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: pgbench logging broken by time logic changes
Дата
Msg-id c031d7e6-a903-bac0-be96-26adc8903e2c@dunslane.net
обсуждение исходный текст
Ответ на Re: pgbench logging broken by time logic changes  (Fabien COELHO <coelho@cri.ensmp.fr>)
Ответы Re: pgbench logging broken by time logic changes  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
On 6/24/21 2:46 AM, Fabien COELHO wrote:
>
> Bonjour Michaël,
>
>> Using grep() with "$re" results in all the fields matching.  Using on
>> the contrary "/$re/" in grep(), like list_files(), would only match
>> the first one, which is correct.
>
> Ok, good catch. Perl is kind of a strange language.


Not really, the explanation is fairly simple:

grep returns the values for which the test is true.

grep ("$re",@values) doesn't perform a regex test against the values, it
tests the truth of "$re" for each value, i.e. it's more or less the same
as  grep (1, @values), which will always returns the whole @values list.

By contrast grep (/$re/, @values) returns those elements of @values that
match the regex.


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com




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

Предыдущее
От: Pavel Borisov
Дата:
Сообщение: Re: Parallel scan with SubTransGetTopmostTransaction assert coredump
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Using indexUnchanged with nbtree