Re: Issue is changing _bt_compare function and

Lists: pgsql-hackers
From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: <pgadmin(at)pse-consulting(dot)de>, <dpage(at)vale-housing(dot)co(dot)uk>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Vote needed: revert beta2 changes or not?
Date: 2005-10-07 18:29:59
Message-ID: 028401c5cb6d$245c9c7c$6a01a8c0@valehousing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

You're absolutely right of course...

/D
-----Original Message-----
From: "Andreas Pflug"<pgadmin(at)pse-consulting(dot)de>
Sent: 07/10/05 18:49:49
To: "Dave Page"<dpage(at)vale-housing(dot)co(dot)uk>
Cc: "pgsql-hackers(at)postgresql(dot)org"<pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Vote needed: revert beta2 changes or not?

Dave Page wrote:
>
>
> Oh no, what have I started!! :-)

In order to keep traffic on this list low, both of us should be
excluded...;-)

Regards,
Andreas

-----Unmodified Original Message-----
Dave Page wrote:
>
>
> Oh no, what have I started!! :-)

In order to keep traffic on this list low, both of us should be
excluded...;-)

Regards,
Andreas


From: sandeep satpal <sandeep(at)it(dot)iitb(dot)ac(dot)in>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Issue is changing _bt_compare function and btcompare.c file
Date: 2005-10-07 19:12:55
Message-ID: Pine.LNX.4.63.0510080037140.16181@akash.it.iitb.ac.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Hello all,

In _bt_compare function , instead of calling FunctionCall2 , I want to
call FunctionCall3 with three parameter and in
btcompare.c "btname_pattern_cmp" function will take three parameter and
i want to change this function according to third parameter.

But the biggest issue is initdb is also using this index for creating and
initializing its own index structure ( may be meta index sorts of )

So how I solve this issue...please guide me...
thanx
sandeep

On Fri, 7 Oct 2005, Dave Page wrote:

> You're absolutely right of course...
>
> /D
> -----Original Message-----
> From: "Andreas Pflug"<pgadmin(at)pse-consulting(dot)de>
> Sent: 07/10/05 18:49:49
> To: "Dave Page"<dpage(at)vale-housing(dot)co(dot)uk>
> Cc: "pgsql-hackers(at)postgresql(dot)org"<pgsql-hackers(at)postgresql(dot)org>
> Subject: Re: [HACKERS] Vote needed: revert beta2 changes or not?
>
> Dave Page wrote:
>>
>>
>> Oh no, what have I started!! :-)
>
> In order to keep traffic on this list low, both of us should be
> excluded...;-)
>
> Regards,
> Andreas
>
>
>
> -----Unmodified Original Message-----
> Dave Page wrote:
>>
>>
>> Oh no, what have I started!! :-)
>
> In order to keep traffic on this list low, both of us should be
> excluded...;-)
>
> Regards,
> Andreas
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>

--
------------------
| Sandeep Satpal |
| M.Tech Student |
| Lab 212 KReSIT |
------------------


From: Neil Conway <neilc(at)samurai(dot)com>
To: sandeep satpal <sandeep(at)it(dot)iitb(dot)ac(dot)in>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Issue is changing _bt_compare function and
Date: 2005-10-07 22:30:01
Message-ID: 1128724201.23118.55.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, 2005-08-10 at 00:42 +0530, sandeep satpal wrote:
> ... please guide me

Two suggestions:

(1) Don't start new threads by replying to an existing thread of no
relevance to the new subject

(2) Spend some time phrasing your question in a coherent manner --
you're more likely to get a useful response. Read

http://www.catb.org/~esr/faqs/smart-questions.html

For example, what is the actual high-level problem you are trying to
solve? How are you attempting to solve it, and exactly what difficulties
have you encountered in doing so?

-Neil


From: sandeep satpal <sandeep(at)it(dot)iitb(dot)ac(dot)in>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Issue is changing _bt_compare function and
Date: 2005-10-08 07:18:50
Message-ID: Pine.LNX.4.63.0510081238570.4363@akash.it.iitb.ac.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Hello,
Sorry for last mail.
I hope this time I will explain my doubt more clearly.

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.

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 ??
Hope this time I had explained in more clear way...
thanx,

--
------------------
| Sandeep Satpal |
| M.Tech Student |
| Lab 212 KReSIT |
------------------


From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: sandeep satpal <sandeep(at)it(dot)iitb(dot)ac(dot)in>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Issue is changing _bt_compare function and
Date: 2005-10-08 11:31:33
Message-ID: 20051008113132.GA30988@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: 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(at)svana(dot)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.


From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: sandeep satpal <sandeep(at)it(dot)iitb(dot)ac(dot)in>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Issue is changing _bt_compare function and
Date: 2005-10-08 17:16:34
Message-ID: 20051008171634.GA5648@surnet.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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.

This is certainly the wrong layer to be making these changes. Have you
considered using the citext type? If it doesn't suit you, you could use
it as a foundation for developing your own.

What you need to change is the function stored in the scankey.

--
Alvaro Herrera http://www.amazon.com/gp/registry/DXLWNGRJD34
Voy a acabar con todos los humanos / con los humanos yo acabaré
voy a acabar con todos / con todos los humanos acabaré (Bender)


From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: sandeep satpal <sandeep(at)it(dot)iitb(dot)ac(dot)in>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Issue is changing _bt_compare function and
Date: 2005-10-09 09:18:57
Message-ID: 4348E081.7010700@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

> 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?

Yes, shouldn't you just be making a simple new string type that's case
insensitive?

Chris