Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gK2fz-00055r-Cg for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Nov 2018 14:49:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gK2fx-0007bP-I9 for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Nov 2018 14:49:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gK2fx-0007bI-6I for pgsql-hackers@lists.postgresql.org; Tue, 06 Nov 2018 14:49:53 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gK2ft-0003NU-Of for pgsql-hackers@postgresql.org; Tue, 06 Nov 2018 14:49:51 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id wA6Enkss022882; Tue, 6 Nov 2018 09:49:46 -0500 From: Tom Lane To: Pavel Raiskup cc: Robert Haas , "pgsql-hackers@postgresql.org" , Devrim =?ISO-8859-1?Q?G=DCND=DCZ?= Subject: Re: plruby: rb_iterate symbol clash with libruby.so In-reply-to: <1772202.Bn4MKCBuZf@nb.usersys.redhat.com> References: <4738198.8KVIIDhgEB@nb.usersys.redhat.com> <20461.1541269186@sss.pgh.pa.us> <1772202.Bn4MKCBuZf@nb.usersys.redhat.com> Comments: In-reply-to Pavel Raiskup message dated "Tue, 06 Nov 2018 13:43:03 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <22880.1541515786.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 06 Nov 2018 09:49:46 -0500 Message-ID: <22881.1541515786@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Pavel Raiskup writes: > On Monday, November 5, 2018 9:06:41 PM CET Robert Haas wrote: >> On Sat, Nov 3, 2018 at 2:20 PM Tom Lane wrote: >>>> Is it realistic we could rename red-black tree methods from 'rb_*' to= e.g. >>>> 'rbt_*' to avoid this clash? >>> I don't have a huge objection to renaming the rbtree functions, other >>> than the precedent it sets ... >> Maybe prefixing with pg_ would better than rb_ to rbt_. ... >> It's certainly not very surprising that Ruby has symbols starting with >> rb_... > I now realized that there's rb_block_call() alternative for rb_iterate() > Ruby call -- which fortunately doesn't collide with PostgreSQL internals= . > It means that for sufficiently new Ruby there exists some solution (not > that something similar can not re-appear elsewhere). Yeah. The long and short of this is that we're trampling on namespace that reasonably belongs to Ruby --- if they had some functions named "pg_something" and complained about a collision with libpq, would we change? Nope. So really we should rename these. After looking at the code a bit I like the idea of s/rb/rbt/g better than s/rb/pg_rb/g. The latter seems verbose, and it would also open the question of whether we need to rename rbtree.h/.c, which would be an additional level of complication I don't want. The rbt approach will allow skipping some other renamings that would be needed for consistency if we use pg_rb. Barring objections I'll go make this happen shortly. It's too late for this week's releases, but Pavel could pick up the commit once it happens and carry it as a Fedora patch until the next releases. regards, tom lane