Re: Issue is changing _bt_compare function and

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Issue is changing _bt_compare function and
Дата
Msg-id 20051008113132.GA30988@svana.org
обсуждение исходный текст
Ответ на Re: Issue is changing _bt_compare function and  (sandeep satpal <sandeep@it.iitb.ac.in>)
Ответы Re: Issue is changing _bt_compare function and  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Список pgsql-hackers
On Sat, Oct 08, 2005 at 12:48:50PM +0530, sandeep satpal wrote:
> The _bt_compare function in "nbtree.c" file calls "FunctionCall2" and it
> passes two arguments , one is the scankey which we want to search on and
> other  key is on current b-tree node.
>
> My problem is I want to pass three parameter and the third argument will
> be used for taking decision during comparision that whether I want
> case-sensitive comparision or case-insensitive.

Well, if you want to pass a third argument, go ahead. Just make sure
you update all the appropriate function calls.

> But "initdb" also uses the same _bt_compare function for creating its own
> indexes.
> For eg.
>  when we write /usr/pgsql/bin/initdb -D /usr/local/data
> And my modification may create problems.
> How I solve this ??

Well, _bt_compare is used for every btree index in the system,
including all the system indexes. A fresh initdb already has several
dozen indexes already so your code has to deal with that.

Remember, _bt_compare compares strings, integers, floats, dates, etc
and your code needs to work for all of them too... What does it mean to
compare dates case-insensetivly?

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

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

Предыдущее
От: "Sean Utt"
Дата:
Сообщение: pg_dump option to dump only functions
Следующее
От: "Magnus Hagander"
Дата:
Сообщение: Re: Kerberos brokenness and oops question in 8.1beta2