Robust ways for checking allowed values in a column

From: Shaozhong SHI <shishaozhong(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Robust ways for checking allowed values in a column
Date: 2022-01-25 13:55:54
Message-ID: CA+i5JwZ75h=VQN_rc8P5g_1+_boGQ=gv3b_KW-WPc7KR-nUKEQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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?

Regards,

David

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Guillaume Lelarge 2022-01-25 14:16:06 Re: Robust ways for checking allowed values in a column
Previous Message Rob Sargent 2022-01-25 05:06:09 Re: Undetected Deadlock