Find out the version of the server

Started by Igor Korotover 1 year ago6 messagesgeneral
Jump to latest
#1Igor Korot
ikorot01@gmail.com

Hi, ALL,

In April of 2017 I got the source code of the Postgresql, build the libpq
and then deleted everything else.

I was using MSVC 3010 at the time.

Now I moved to MSVC 2017 but unfortunately I can't reuse the library built,
since MSVC changed one of its headers.

Is it possible to find what version of the server was used for the build?

Im looking at the Windows Explorer timestamp, which gives me 4 September
2017.

Thank you.

P.s. please forgive for any typos as it's been written from the Android
phone.

#2Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Igor Korot (#1)
Re: Find out the version of the server

On 11/28/24 17:31, Igor Korot wrote:

Hi, ALL,

In April of 2017 I got the source code of the Postgresql, build the
libpq and then deleted everything else.

I was using MSVC 3010 at the time.

Now I moved to MSVC 2017 but unfortunately I can't reuse the library
built, since MSVC changed one of its headers.

Reuse it for what?

Is it possible to find what version of the server was used for the build?

Im looking at the Windows Explorer timestamp, which gives me 4 September
2017.

At any point in time there are 5 supported versions of Postgres in play.
Given that you could have also built against one of the unsupported
versions a file timestamp will not help much. Though if you want to
guess, version 10 was released October 5, 2017. It is plausible you
built against a RC version in advance of the production release.

libpq is backwards compatible, so why not try building against a current
version of Postgres and see whats happens?

Thank you.

P.s. please forgive for any typos as it's been written from the Android
phone.

--
Adrian Klaver
adrian.klaver@aklaver.com

#3Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Igor Korot (#1)
Re: Find out the version of the server

Reply to list also

Ccing list

On 11/29/24 11:15 AM, Igor Korot wrote:

Hi, Adrian,

On Fri, Nov 29, 2024 at 10:12 AM Adrian Klaver
<adrian.klaver@aklaver.com> wrote:

Reuse it for what?

For building..
I got a linking errors of not finding sscanf() and sprntf()
when building my code.

Googling revealed that MSVC made those inline after
MSVC 2010.

Is it possible to find what version of the server was used for the build?

Im looking at the Windows Explorer timestamp, which gives me 4 September
2017.

At any point in time there are 5 supported versions of Postgres in play.
Given that you could have also built against one of the unsupported
versions a file timestamp will not help much. Though if you want to
guess, version 10 was released October 5, 2017. It is plausible you
built against a RC version in advance of the production release.

Understood.
I also tried to open the explorer and go to Properties of the DLL built

That dialog shows for src/interfaces/libpq/Release/ for the Detail tab

Type: Application Extension
File Version: 9.6.2.17037
Product name: PostgreSQL
Product version: 9.6.2

Can this info be trusted?

libpq is backwards compatible, so why not try building against a current
version of Postgres and see whats happens?

Are you saying that the current version can connect even to 9.6.1
server? (I have a really old Mac with the 9.6.1 version installed).

Yes.

The CLI client psql is based on libpq and from here:

https://www.postgresql.org/docs/current/app-psql.html

"If you want to use psql to connect to several servers of different
major versions, it is recommended that you use the newest version of
psql. Alternatively, you can keep around a copy of psql from each major
version and be sure to use the version that matches the respective
server. But in practice, this additional complication should not be
necessary."

If you have a new version of psql available connect to the 9.6.1
instance to verify.

Thank you.

Thank you.

P.s. please forgive for any typos as it's been written from the Android
phone.

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Adrian Klaver
adrian.klaver@aklaver.com

#4Igor Korot
ikorot01@gmail.com
In reply to: Adrian Klaver (#3)
Re: Find out the version of the server

Hi, Adrian,

On Fri, Nov 29, 2024, 1:24 PM Adrian Klaver <adrian.klaver@aklaver.com>
wrote:

Reply to list also

Ccing list

On 11/29/24 11:15 AM, Igor Korot wrote:

Hi, Adrian,

On Fri, Nov 29, 2024 at 10:12 AM Adrian Klaver
<adrian.klaver@aklaver.com> wrote:

Reuse it for what?

For building..
I got a linking errors of not finding sscanf() and sprntf()
when building my code.

Googling revealed that MSVC made those inline after
MSVC 2010.

Is it possible to find what version of the server was used for the

build?

Im looking at the Windows Explorer timestamp, which gives me 4

September

2017.

At any point in time there are 5 supported versions of Postgres in play.
Given that you could have also built against one of the unsupported
versions a file timestamp will not help much. Though if you want to
guess, version 10 was released October 5, 2017. It is plausible you
built against a RC version in advance of the production release.

Understood.
I also tried to open the explorer and go to Properties of the DLL built

That dialog shows for src/interfaces/libpq/Release/ for the Detail tab

Type: Application Extension
File Version: 9.6.2.17037
Product name: PostgreSQL
Product version: 9.6.2

Can this info be trusted?

libpq is backwards compatible, so why not try building against a current
version of Postgres and see whats happens?

Are you saying that the current version can connect even to 9.6.1
server? (I have a really old Mac with the 9.6.1 version installed).

Yes.

The CLI client psql is based on libpq and from here:

https://www.postgresql.org/docs/current/app-psql.html

"If you want to use psql to connect to several servers of different
major versions, it is recommended that you use the newest version of
psql. Alternatively, you can keep around a copy of psql from each major
version and be sure to use the version that matches the respective
server. But in practice, this additional complication should not be
necessary."

If you have a new version of psql available connect to the 9.6.1
instance to verify.

Thank you.

Ill try to get the new version and build it.

Show quoted text

Thank you.

Thank you.

P.s. please forgive for any typos as it's been written from the Android
phone.

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Adrian Klaver
adrian.klaver@aklaver.com

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Adrian Klaver (#3)
Re: Find out the version of the server

Adrian Klaver <adrian.klaver@aklaver.com> writes:

On 11/29/24 11:15 AM, Igor Korot wrote:

Are you saying that the current version can connect even to 9.6.1
server? (I have a really old Mac with the 9.6.1 version installed).

Yes.

Current libpq will probably work with servers back to around 7.0
(whenever we introduced the version-3 wire protocol). We don't
routinely test it against anything older than 9.2, but I tried
current psql against 8.2 (the oldest functional server I have
on this machine) and it basically worked.

regards, tom lane

#6Igor Korot
ikorot01@gmail.com
In reply to: Tom Lane (#5)
Re: Find out the version of the server

Thx.

On Fri, Nov 29, 2024, 2:03 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:

Show quoted text

Adrian Klaver <adrian.klaver@aklaver.com> writes:

On 11/29/24 11:15 AM, Igor Korot wrote:

Are you saying that the current version can connect even to 9.6.1
server? (I have a really old Mac with the 9.6.1 version installed).

Yes.

Current libpq will probably work with servers back to around 7.0
(whenever we introduced the version-3 wire protocol). We don't
routinely test it against anything older than 9.2, but I tried
current psql against 8.2 (the oldest functional server I have
on this machine) and it basically worked.

regards, tom lane