Thread: Compile static postgres.lib for postgres 15.3 on Windows

Compile static postgres.lib for postgres 15.3 on Windows

From
Priess Stefan
Date:

Hi all,

 

up to version 9.6.22 there was a win32.mak file in the src/interfaces/libpw folder which could be used to compile a static postgres.lib using nmake. Since Postgres 10 this file has been removed.

 

Is it still possilbe to build a static postgres.lib for windows ? And if so, how do I do it.

 

Thanks!


Stefan

 

nexus / chili

 

Stefan Priess
Softwareentwicklung

Tel: +49 6221 18079-10

E-Mail: stefan.priess@nexus-chili.com

 

 

NEXUS / CHILI GmbH, Friedrich-Ebert-Str. 2, 69221 Dossenheim/Heidelberg

www.nexus-chili.com

 

Eingetragene Gesellschaft beim Registergericht Mannheim, HRB 337363
Geschäftsführer: Dr. Uwe Engelmann, Dr. Heiko Münch

 

Re: Compile static postgres.lib for postgres 15.3 on Windows

From
Tom Lane
Date:
Priess Stefan <stefan.priess@nexus-chili.com> writes:
> up to version 9.6.22 there was a win32.mak file in the src/interfaces/libpw folder which could be used to compile a
staticpostgres.lib using nmake. Since Postgres 10 this file has been removed. 

Yup.  It didn't really work right and there was insufficient interest
in maintaining it.

> Is it still possilbe to build a static postgres.lib for windows ? And if so, how do I do it.

Run the normal build process using MSVC, and then just take libpq.lib
from the results.  On any modern machine that's just going to take
a few minutes, so it's not worth maintaining a separate libpq-only
build path.

            regards, tom lane



AW: Compile static postgres.lib for postgres 15.3 on Windows

From
Priess Stefan
Date:
Thanks Tom!

I also need to change the default port from 5433 to 5432 (--with-pgport=5433). How can I do this using the build.bat
toolchain?I don't see the pgport parameter in the config_default.pl file. 

Best,

Stefan

nexus / chili

Stefan Priess
Softwareentwicklung

Tel: +49 6221 18079-10
E-Mail: stefan.priess@nexus-chili.com


NEXUS / CHILI GmbH, Friedrich-Ebert-Str. 2, 69221 Dossenheim/Heidelberg
www.nexus-chili.com

Eingetragene Gesellschaft beim Registergericht Mannheim, HRB 337363
Geschäftsführer: Dr. Uwe Engelmann, Dr. Heiko Münch

-----Ursprüngliche Nachricht-----
Von: Tom Lane <tgl@sss.pgh.pa.us>
Gesendet: Freitag, 28. Juli 2023 14:48
An: Priess Stefan <stefan.priess@nexus-chili.com>
Cc: pgsql-general@lists.postgresql.org
Betreff: Re: Compile static postgres.lib for postgres 15.3 on Windows

Priess Stefan <stefan.priess@nexus-chili.com> writes:
> up to version 9.6.22 there was a win32.mak file in the src/interfaces/libpw folder which could be used to compile a
staticpostgres.lib using nmake. Since Postgres 10 this file has been removed. 

Yup.  It didn't really work right and there was insufficient interest in maintaining it.

> Is it still possilbe to build a static postgres.lib for windows ? And if so, how do I do it.

Run the normal build process using MSVC, and then just take libpq.lib from the results.  On any modern machine that's
justgoing to take a few minutes, so it's not worth maintaining a separate libpq-only build path. 

            regards, tom lane





Re: AW: Compile static postgres.lib for postgres 15.3 on Windows

From
Adrian Klaver
Date:
On 7/28/23 07:26, Priess Stefan wrote:
> Thanks Tom!
> 
> I also need to change the default port from 5433 to 5432 (--with-pgport=5433). How can I do this using the build.bat
toolchain?I don't see the pgport parameter in the config_default.pl file.
 

1) The default port is 5432.

2) Why do you want to change it?

> 
> Best,
> 
> Stefan
> 
> nexus / chili
> 
> Stefan Priess
> Softwareentwicklung
> 
> Tel: +49 6221 18079-10
> E-Mail: stefan.priess@nexus-chili.com
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com




Re: AW: Compile static postgres.lib for postgres 15.3 on Windows

From
Tom Lane
Date:
Priess Stefan <stefan.priess@nexus-chili.com> writes:
> I also need to change the default port from 5433 to 5432 (--with-pgport=5433). How can I do this using the build.bat
toolchain?I don't see the pgport parameter in the config_default.pl file. 

I don't use MSVC myself, but a quick look at the code suggests that
you want to add

    "--with-pgport" => 5433

(with the quotes, probably).

            regards, tom lane



AW: AW: Compile static postgres.lib for postgres 15.3 on Windows

From
Priess Stefan
Date:
Sorry, I meant that I need to change the default port from 5432 to 5433.

nexus / chili

Stefan Priess
Softwareentwicklung

Tel: +49 6221 18079-10
E-Mail: stefan.priess@nexus-chili.com


NEXUS / CHILI GmbH, Friedrich-Ebert-Str. 2, 69221 Dossenheim/Heidelberg 
www.nexus-chili.com

Eingetragene Gesellschaft beim Registergericht Mannheim, HRB 337363
Geschäftsführer: Dr. Uwe Engelmann, Dr. Heiko Münch

-----Ursprüngliche Nachricht-----
Von: Adrian Klaver <adrian.klaver@aklaver.com> 
Gesendet: Freitag, 28. Juli 2023 16:44
An: Priess Stefan <stefan.priess@nexus-chili.com>; Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general@lists.postgresql.org
Betreff: Re: AW: Compile static postgres.lib for postgres 15.3 on Windows

On 7/28/23 07:26, Priess Stefan wrote:
> Thanks Tom!
> 
> I also need to change the default port from 5433 to 5432 (--with-pgport=5433). How can I do this using the build.bat
toolchain?I don't see the pgport parameter in the config_default.pl file.
 

1) The default port is 5432.

2) Why do you want to change it?

> 
> Best,
> 
> Stefan
> 
> nexus / chili
> 
> Stefan Priess
> Softwareentwicklung
> 
> Tel: +49 6221 18079-10
> E-Mail: stefan.priess@nexus-chili.com
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com




AW: AW: Compile static postgres.lib for postgres 15.3 on Windows

From
Priess Stefan
Date:
Good morning Tom,

I tried adding

pgport    => 5433,     # --with-pgport=<path>

to the config_default.pl file. And

$config->{pgport} = 5433;

to the config.pl file.

But the default port is still 5432...



nexus / chili

Stefan Priess
Softwareentwicklung

Tel: +49 6221 18079-10
E-Mail: stefan.priess@nexus-chili.com


NEXUS / CHILI GmbH, Friedrich-Ebert-Str. 2, 69221 Dossenheim/Heidelberg
www.nexus-chili.com

Eingetragene Gesellschaft beim Registergericht Mannheim, HRB 337363
Geschäftsführer: Dr. Uwe Engelmann, Dr. Heiko Münch

-----Ursprüngliche Nachricht-----
Von: Tom Lane <tgl@sss.pgh.pa.us>
Gesendet: Freitag, 28. Juli 2023 17:01
An: Priess Stefan <stefan.priess@nexus-chili.com>
Cc: pgsql-general@lists.postgresql.org
Betreff: Re: AW: Compile static postgres.lib for postgres 15.3 on Windows

Priess Stefan <stefan.priess@nexus-chili.com> writes:
> I also need to change the default port from 5433 to 5432 (--with-pgport=5433). How can I do this using the build.bat
toolchain?I don't see the pgport parameter in the config_default.pl file. 

I don't use MSVC myself, but a quick look at the code suggests that you want to add

    "--with-pgport" => 5433

(with the quotes, probably).

            regards, tom lane



AW: AW: Compile static postgres.lib for postgres 15.3 on Windows

From
Priess Stefan
Date:
Tom,

i followed your instructions exactly and put

"--with-pgport" => 5433

in the config_default.pl and now it is working!

Thanks!

nexus / chili

Stefan Priess
Softwareentwicklung

Tel: +49 6221 18079-10
E-Mail: stefan.priess@nexus-chili.com


NEXUS / CHILI GmbH, Friedrich-Ebert-Str. 2, 69221 Dossenheim/Heidelberg
www.nexus-chili.com

Eingetragene Gesellschaft beim Registergericht Mannheim, HRB 337363
Geschäftsführer: Dr. Uwe Engelmann, Dr. Heiko Münch

-----Ursprüngliche Nachricht-----
Von: Priess Stefan <stefan.priess@nexus-chili.com>
Gesendet: Montag, 31. Juli 2023 09:52
An: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general@lists.postgresql.org
Betreff: AW: AW: Compile static postgres.lib for postgres 15.3 on Windows

Good morning Tom,

I tried adding

pgport    => 5433,     # --with-pgport=<path>

to the config_default.pl file. And

$config->{pgport} = 5433;

to the config.pl file.

But the default port is still 5432...



nexus / chili

Stefan Priess
Softwareentwicklung

Tel: +49 6221 18079-10
E-Mail: stefan.priess@nexus-chili.com


NEXUS / CHILI GmbH, Friedrich-Ebert-Str. 2, 69221 Dossenheim/Heidelberg www.nexus-chili.com

Eingetragene Gesellschaft beim Registergericht Mannheim, HRB 337363
Geschäftsführer: Dr. Uwe Engelmann, Dr. Heiko Münch

-----Ursprüngliche Nachricht-----
Von: Tom Lane <tgl@sss.pgh.pa.us>
Gesendet: Freitag, 28. Juli 2023 17:01
An: Priess Stefan <stefan.priess@nexus-chili.com>
Cc: pgsql-general@lists.postgresql.org
Betreff: Re: AW: Compile static postgres.lib for postgres 15.3 on Windows

Priess Stefan <stefan.priess@nexus-chili.com> writes:
> I also need to change the default port from 5433 to 5432 (--with-pgport=5433). How can I do this using the build.bat
toolchain?I don't see the pgport parameter in the config_default.pl file. 

I don't use MSVC myself, but a quick look at the code suggests that you want to add

    "--with-pgport" => 5433

(with the quotes, probably).

            regards, tom lane