Re: [PATCH] Incremental sort (was: PoC: Partial sort) - Mailing list pgsql-hackers

From Andreas Karlsson
Subject Re: [PATCH] Incremental sort (was: PoC: Partial sort)
Date
Msg-id 70ed0ba6-2941-a372-b2e6-5ffa2bb77e0e@proxel.se
Whole thread Raw
In response to Re: [PATCH] Incremental sort (was: PoC: Partial sort)  (James Coleman <jtc331@gmail.com>)
Responses Re: [PATCH] Incremental sort (was: PoC: Partial sort)  (James Coleman <jtc331@gmail.com>)
List pgsql-hackers
On 3/23/20 1:33 AM, James Coleman wrote:
> So on the face of it we have a bit of a no-win situation. The function
> tuple_sort_method_name returns a const, but lappend wants a non-const.
> I'm not sure what the project style preference is here: we could cast
> the result as (char *) to drop the const qualifier, but that's frowned
> upon some places. Alternatively we could make a new non-const copy of
> string. Which is preferable in the postgres project style?

The PostgreSQL has places where const is explicitly casted away with the 
unconstify() macro, so unless you can find a better solution that is 
probably an ok option.

Andreas




pgsql-hackers by date:

Previous
From: James Coleman
Date:
Subject: Re: [PATCH] Incremental sort (was: PoC: Partial sort)
Next
From: Andreas Karlsson
Date:
Subject: Re: ssl passphrase callback