Pattern matching ints

From: Tim Smith <randomdev4+postgres(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Pattern matching ints
Date: 2015-01-26 11:32:19
Message-ID: CA+HuS5GiTdr+Ryhbf7+x3YKGUWKE77HbDz_ki9EHmBxOD3L4SA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Is there a more efficient way to pattern match integer columns other
than something like :

where cast(mynumber as text) ~ '.*123.*'

I also seem to recall you can't create indexes on casts either ?

Thx

Tim

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2015-01-26 12:51:36 Re: Pattern matching ints
Previous Message Paul Jungwirth 2015-01-26 00:20:34 Re: partial "on-delete set null" constraint