Thread: Linux equivalent library for "postgres.lib" from Windows

Linux equivalent library for "postgres.lib" from Windows

From
"Gadamsetty, Kiran"
Date:

Hi,

 

I am new to the product and in windows “postgres.lib” provides certain functions which we are using in windows for creating extensions.

Now I am porting the project to Linux and there no straight library with this name in Linux binaries packages.

 

Can someone please advise the equivalent library for postgres.lib in Linux?

 

Thanks,
Kiran G

Re: Linux equivalent library for "postgres.lib" from Windows

From
Michael Paquier
Date:
On Mon, Nov 7, 2016 at 2:28 PM, Gadamsetty, Kiran
<Kiran.Gadamsetty@dell.com> wrote:
> I am new to the product and in windows “postgres.lib” provides certain
> functions which we are using in windows for creating extensions.
>
> Now I am porting the project to Linux and there no straight library with
> this name in Linux binaries packages.
>
> Can someone please advise the equivalent library for postgres.lib in Linux?

There is no need to go down to this level of details perhaps? You
could just use the PGXS infrastructure to guess it for you.
--
Michael


Re: Linux equivalent library for "postgres.lib" from Windows

From
John R Pierce
Date:
On 11/6/2016 9:28 PM, Gadamsetty, Kiran wrote:

I am new to the product and in windows “postgres.lib” provides certain functions which we are using in windows for creating extensions.

Now I am porting the project to Linux and there no straight library with this name in Linux binaries packages.

 

Can someone please advise the equivalent library for postgres.lib in Linux?

 


I am not sure what this postgres.lib is, what are the functions you're using ?

libpq.so is the standard postgres client library.  it provides the PQxxxxxx functions documented here, https://www.postgresql.org/docs/current/static/libpq.html

or are you talking about the SPI_xxxxx functions used by C functions being called within postgresql ?





-- 
john r pierce, recycling bits in santa cruz

Re: Linux equivalent library for "postgres.lib" from Windows

From
John R Pierce
Date:
On 11/7/2016 7:51 PM, Michael Paquier wrote:
> There is no need to go down to this level of details perhaps? You
> could just use the PGXS infrastructure to guess it for you.

+1     I forgot to mention PGXS, that provides a portable method of
building server-side extensions.

See https://www.postgresql.org/docs/current/static/extend-pgxs.html


--
john r pierce, recycling bits in santa cruz



Re: Linux equivalent library for "postgres.lib" from Windows

From
Michael Paquier
Date:
On Tue, Nov 8, 2016 at 1:29 PM, John R Pierce <pierce@hogranch.com> wrote:
> I am not sure what this postgres.lib is, what are the functions you're using
> ?

It contains references to all the exposed functions of the backend on
Windows. Using something like dumpbin /exports postgres.lib would show
exactly that if I recall correctly. But, anyway, what Kiran is looking
for here is to build his stuff via PGXS.
--
Michael


Re: Linux equivalent library for "postgres.lib" from Windows

From
Albe Laurenz
Date:
John R Pierce wrote:
>> I am new to the product and in windows “postgres.lib” provides certain functions which we are
>> using in windows for creating extensions.
>> 
>> Now I am porting the project to Linux and there no straight library with this name in Linux
>> binaries packages.
>> 
>> Can someone please advise the equivalent library for postgres.lib in Linux?
> 
> I am not sure what this postgres.lib is, what are the functions you're using ?

With MSVC, you have to link with the mylibrary.lib file if you want to use
functions from the shared library mylibrary.dll.
This is not necessary on Linux, where references to a shared library are resolved
at load time.

So the answer to the original question is that there is no replacement
for postgres.lib on Linux because you don't need it to link with PostgreSQL.
It is enough to #include the required PostgreSQL headers during compilation.

Some information on how to link on Linux can be found here:
https://www.postgresql.org/docs/current/static/xfunc-c.html#DFUNC
But as others have remarked, using PGXS is much better than doing
it by hand.

Yours,
Laurenz Albe

Re: Linux equivalent library for "postgres.lib" from Windows

From
"Gadamsetty, Kiran"
Date:
We are depending on postgres.lib while creating a postgre extension for windows. 
We need to know the equivalent library in Linux to build the same in Linux to get the symbols resolve correctly.

Any help is appreciated.

-Kiran G 



-----Original Message-----
From: Michael Paquier [mailto:michael.paquier@gmail.com] 
Sent: Tuesday, November 08, 2016 9:21 AM
To: Gadamsetty, Kiran <Kiran.Gadamsetty@emc.com>
Cc: pgsql-general@postgresql.org; Kumar, Sunil(RM engineering) <sunilp.kumar@emc.com>
Subject: Re: [GENERAL] Linux equivalent library for "postgres.lib" from Windows

On Mon, Nov 7, 2016 at 2:28 PM, Gadamsetty, Kiran <Kiran.Gadamsetty@dell.com> wrote:
> I am new to the product and in windows “postgres.lib” provides certain 
> functions which we are using in windows for creating extensions.
>
> Now I am porting the project to Linux and there no straight library 
> with this name in Linux binaries packages.
>
> Can someone please advise the equivalent library for postgres.lib in Linux?

There is no need to go down to this level of details perhaps? You could just use the PGXS infrastructure to guess it
foryou.
 
--
Michael

Re: Linux equivalent library for "postgres.lib" from Windows

From
David Guyot
Date:
If you are looking for the name of the package providing the postgres
library, it will probably change over the distros; under Debian, you're
probably looking for libpq5 for the library itself, but I don't know the
name of the package containing debugging symbols for this one.

Depending on your development language, the corresponding package name can be different, and there can be a package
withdebugging symbols. 

Regards.

Le mardi 08 novembre 2016 à 05:01 +0000, Gadamsetty, Kiran a écrit :
> We are depending on postgres.lib while creating a postgre extension for windows.
> We need to know the equivalent library in Linux to build the same in Linux to get the symbols resolve correctly.
>
> Any help is appreciated.
>
> -Kiran G
--
David Guyot
Administrateur système, réseau et télécom / Sysadmin
Europe Camions Interactive / Stockway
Moulin Collot
F-88500 Ambacourt
03 29 30 47 85

Attachment