Re: plruby: rb_iterate symbol clash with libruby.so

2018-11-07 Thread Pavel Raiskup
On Wednesday, November 7, 2018 4:55:13 PM CET Tom Lane wrote: > Pavel Raiskup writes: > > On Wednesday, November 7, 2018 3:25:31 PM CET Tom Lane wrote: > >> Yeah, I'm now mighty confused about this as well. PL/Ruby is pretty old > >> too, so how come nobody noticed this before? Is its

Re: plruby: rb_iterate symbol clash with libruby.so

2018-11-07 Thread Tom Lane
Pavel Raiskup writes: > On Wednesday, November 7, 2018 3:25:31 PM CET Tom Lane wrote: >> Yeah, I'm now mighty confused about this as well. PL/Ruby is pretty old >> too, so how come nobody noticed this before? Is its rb_iterate call in >> someplace that hardly gets any use? > ... I reproduced

Re: plruby: rb_iterate symbol clash with libruby.so

2018-11-07 Thread Pavel Raiskup
On Wednesday, November 7, 2018 3:25:31 PM CET Tom Lane wrote: > Pavel Raiskup writes: > > On Tuesday, November 6, 2018 7:28:21 PM CET Tom Lane wrote: > >> Done. I realized that the immediate problem, rb_iterate(), was only > >> added as of PG v10, which may explain why we hadn't heard complaints

Re: plruby: rb_iterate symbol clash with libruby.so

2018-11-07 Thread Tom Lane
Pavel Raiskup writes: > On Tuesday, November 6, 2018 7:28:21 PM CET Tom Lane wrote: >> Done. I realized that the immediate problem, rb_iterate(), was only >> added as of PG v10, which may explain why we hadn't heard complaints >> about this till now. So I've made the change only as far back as

Re: plruby: rb_iterate symbol clash with libruby.so

2018-11-07 Thread Pavel Raiskup
On Tuesday, November 6, 2018 7:28:21 PM CET Tom Lane wrote: > I wrote: > > 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 > >

Re: plruby: rb_iterate symbol clash with libruby.so

2018-11-06 Thread Tom Lane
I wrote: > 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. > Barring objections

Re: plruby: rb_iterate symbol clash with libruby.so

2018-11-06 Thread Pavel Raiskup
On Tuesday, November 6, 2018 3:49:46 PM CET Tom Lane wrote: > 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. >

Re: plruby: rb_iterate symbol clash with libruby.so

2018-11-06 Thread Tom Lane
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

Re: plruby: rb_iterate symbol clash with libruby.so

2018-11-06 Thread Pavel Raiskup
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? > > > > That's not terribly appetizing, because it essentially means

Re: plruby: rb_iterate symbol clash with libruby.so

2018-11-05 Thread Robert Haas
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? > > That's not terribly appetizing, because it essentially means we're giving > Ruby (and potentially every other library on the planet)

Re: plruby: rb_iterate symbol clash with libruby.so

2018-11-03 Thread Tom Lane
Andres Freund writes: > On 2018-11-03 14:39:45 -0400, Tom Lane wrote: >> Andres Freund writes: >>> ISTM this specific case we could solve the issue by opening plruby.so / >>> extension sos with RTLD_DEEPBIND. That doesn't work if ruby extensions >>> that are loaded later use rb_iterate, but

Re: plruby: rb_iterate symbol clash with libruby.so

2018-11-03 Thread Andres Freund
On 2018-11-03 14:39:45 -0400, Tom Lane wrote: > Andres Freund writes: > >> Pavel Raiskup writes: > >>> Is it realistic we could rename red-black tree methods from 'rb_*' to e.g. > >>> 'rbt_*' to avoid this clash? > > > ISTM this specific case we could solve the issue by opening plruby.so / > >

Re: plruby: rb_iterate symbol clash with libruby.so

2018-11-03 Thread Tom Lane
Andres Freund writes: >> Pavel Raiskup writes: >>> Is it realistic we could rename red-black tree methods from 'rb_*' to e.g. >>> 'rbt_*' to avoid this clash? > ISTM this specific case we could solve the issue by opening plruby.so / > extension sos with RTLD_DEEPBIND. That doesn't work if ruby

Re: plruby: rb_iterate symbol clash with libruby.so

2018-11-03 Thread Andres Freund
Hi, On 2018-11-03 14:19:46 -0400, Tom Lane wrote: > Pavel Raiskup writes: > > Hi, I'm curious how it worked before (seems like the function is defined > > in both PostgreSQL and Ruby projects for quite some time) - but I recently > > came across this situation: > > - /bin/postgres is

Re: plruby: rb_iterate symbol clash with libruby.so

2018-11-03 Thread Tom Lane
Pavel Raiskup writes: > Hi, I'm curious how it worked before (seems like the function is defined > in both PostgreSQL and Ruby projects for quite some time) - but I recently > came across this situation: > - /bin/postgres is build-time linked with 'ld -E' > - /bin/postgres dlopen()s

plruby: rb_iterate symbol clash with libruby.so

2018-11-03 Thread Pavel Raiskup
Hi, I'm curious how it worked before (seems like the function is defined in both PostgreSQL and Ruby projects for quite some time) - but I recently came across this situation: - /bin/postgres is build-time linked with 'ld -E' - /bin/postgres dlopen()s plruby.so - plruby.so calls