Re: Robust ways for checking allowed values in a column

Поиск
Список
Период
Сортировка
От Guillaume Lelarge
Тема Re: Robust ways for checking allowed values in a column
Дата
Msg-id CAECtzeUk=t2VvDcL=dejPxFsoVKXRtTUzp0w9sTMeVjquL6LXw@mail.gmail.com
обсуждение исходный текст
Ответ на Robust ways for checking allowed values in a column  (Shaozhong SHI <shishaozhong@gmail.com>)
Список pgsql-general
Le mar. 25 janv. 2022 à 14:56, Shaozhong SHI <shishaozhong@gmail.com> a écrit :
I tried the following:

 select form from mytable  where form ~ '^Canal$|^Drain$|^Foreshore$|^inlandRiver$|^Lake$|^lockOrFlightOfLocks$|^Marsh$|^Researvoir$|^Sea$|^tidalRiver$|^Transfer$'

I used ^ and $ to ensure checking of allowed values.

However, 'Backyard' was selected.

Why is that?


It works for me:

# select 'Backyard' ~ '^Canal$|^Drain$|^Foreshore$|^inlandRiver$|^Lake$|^lockOrFlightOfLocks$|^Marsh$|^Researvoir$|^Sea$|^tidalRiver$|^Transfer$';
┌──────────┐
│ ?column? │
├──────────┤
│ f        │
└──────────┘
(1 row)

So you will probably need a complete and reproducible example so that we could test it.


--
Guillaume.

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

Предыдущее
От: Shaozhong SHI
Дата:
Сообщение: Robust ways for checking allowed values in a column
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Robust ways for checking allowed values in a column