Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pVwt5-0006bJ-T0 for pgsql-novice@arkaria.postgresql.org; Sat, 25 Feb 2023 15:55:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pVwt3-0000Te-CU for pgsql-novice@arkaria.postgresql.org; Sat, 25 Feb 2023 15:55:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pVwt2-0000Kl-VC for pgsql-novice@lists.postgresql.org; Sat, 25 Feb 2023 15:55:00 +0000 Received: from relay2-d.mail.gandi.net ([217.70.183.194]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pVwsz-0007J8-Pn for pgsql-novice@lists.postgresql.org; Sat, 25 Feb 2023 15:54:59 +0000 Received: (Authenticated sender: adsend@dunslane.net) by mail.gandi.net (Postfix) with ESMTPSA id B4F9440005; Sat, 25 Feb 2023 15:54:53 +0000 (UTC) Content-Type: multipart/alternative; boundary="------------iOUNjXdS09dFZG0o0nDQB9h0" Message-ID: <8a05330d-6260-2375-9284-38ed7e500052@dunslane.net> Date: Sat, 25 Feb 2023 10:54:52 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: using libjansson in postgres extension Content-Language: en-US To: mahendrakar s , pgsql-novice References: From: Andrew Dunstan In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------iOUNjXdS09dFZG0o0nDQB9h0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2023-02-23 Th 20:59, mahendrakar s wrote: > > On Thu, 23 Feb 2023 at 19:08, mahendrakar s > wrote: > > Hello Hackers, > > I'm developing an extension where in it indirectly references > (libjansson) and libjansson has a symbol json_object > which > conflicts with postgres  symbol 'json_object > '. > > I see below: > PostgreSQL: Documentation: 11: 38.10. C-Language Functions > > "Symbol names defined within object files must not conflict with > each other or with symbols defined in the PostgreSQL server > executable. You will have to rename your functions or variables if > you get error messages to this effect." > > But this requires to maintain libjansson with customizations(have > a different symbol) to meet the needs. > > Do you have any suggestions to use the libjansson 'as it is' > without using the different symbol. > > No. AFAICT you will have to create a fork of the library as the documentation suggests. cheers andrew -- Andrew Dunstan EDB:https://www.enterprisedb.com --------------iOUNjXdS09dFZG0o0nDQB9h0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


On 2023-02-23 Th 20:59, mahendrakar s wrote:

On Thu, 23 Feb 2023 at 19:08, mahendrakar s <mahendrakarforpg@gmail.com> wrote:
Hello Hackers,

I'm developing an extension where in it indirectly references (libjansson) and libjansson has a symbol json_object which conflicts with postgres  symbol 'json_object'.

I see below:
PostgreSQL: Documentation: 11: 38.10. C-Language Functions
"Symbol names defined within object files must not conflict with each other or with symbols defined in the PostgreSQL server executable. You will have to rename your functions or variables if you get error messages to this effect."

But this requires to maintain libjansson with customizations(have a different symbol) to meet the needs.

Do you have any suggestions to use the libjansson 'as it is' without using the different symbol.




No. AFAICT you will have to create a fork of the library as the documentation suggests.


cheers


andrew


--
Andrew Dunstan
EDB: https://www.enterprisedb.com
--------------iOUNjXdS09dFZG0o0nDQB9h0--