programming 'like' operator

Started by Ron Petersonabout 19 years ago2 messagesgeneral
Jump to latest
#1Ron Peterson
ron.peterson@yellowbank.com

Anyone have any tips for an earnest aspiring but somewhat befuddled
PostgreSQL acolyte as to what's required to program (in C) a 'like'
operator for a user defined type?

--
Ron Peterson
https://www.yellowbank.com/

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Ron Peterson (#1)
Re: programming 'like' operator

Ron Peterson <ron.peterson@yellowbank.com> writes:

Anyone have any tips for an earnest aspiring but somewhat befuddled
PostgreSQL acolyte as to what's required to program (in C) a 'like'
operator for a user defined type?

Well, you could look at the existing code which is in
src/backend/utils/adt/like.c
src/backend/utils/adt/like_match.c
The text variant is a bit obfuscated because it tries to support
both case-sensitive and case-insensitive matching with only one
set of code --- the bytea variant might be easier to follow.

regards, tom lane