Re: using regular expression queries with regular expression indexes

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: using regular expression queries with regular expression indexes
Дата
Msg-id fe5ba8cb-4d5a-8ed5-cda2-6cad27a9bf0c@gmx.net
обсуждение исходный текст
Ответ на using regular expression queries with regular expression indexes  (Mark Steben <mark.steben@drivedominion.com>)
Список pgsql-admin
Mark Steben schrieb am 25.06.2020 um 18:45:
> I have a query that uses regexp code to confirm if a text field is a date or not.

Why don't you define it as a date column? (e.g. so that leap years are corretly dealt with)

But if you can't do that, what about a generated column that uses that regex to populate a boolean flag, e.g.
is_valid_date?

Then the expensive regex evaluation would only be done when you change the value, not everytime you query it.

Thomas



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: using regular expression queries with regular expression indexes
Следующее
От: Mai Peng
Дата:
Сообщение: After renaming a database the subscription ( logical replication)stay sticky to the old database (master)