public inbox for [email protected]  
help / color / mirror / Atom feed
Get version info
11+ messages / 5 participants
[nested] [flat]

* Get version info
@ 2026-07-05 06:32  Igor Korot <[email protected]>
  0 siblings, 2 replies; 11+ messages in thread

From: Igor Korot @ 2026-07-05 06:32 UTC (permalink / raw)
  To: pgsql-generallists.postgresql.org <[email protected]>

Hi, ALL,
Google recommends using pg-config.

However, some distro prefer to use pkg-config and don't even include
local configuration file.

Is this file located everywhere and if not - how do I check it inside
configure.ac?

Thank you.






^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: Get version info
@ 2026-07-05 08:18  rob stone <[email protected]>
  parent: Igor Korot <[email protected]>
  1 sibling, 2 replies; 11+ messages in thread

From: rob stone @ 2026-07-05 08:18 UTC (permalink / raw)
  To: Igor Korot <[email protected]>; pgsql-generallists.postgresql.org <[email protected]>

On Sun, 2026-07-05 at 01:32 -0500, Igor Korot wrote:
> Hi, ALL,
> Google recommends using pg-config.
> 
> However, some distro prefer to use pkg-config and don't even include
> local configuration file.
> 
> Is this file located everywhere and if not - how do I check it inside
> configure.ac?
> 
> Thank you.
> 


See chapter 9.27.11, not Mr. Google.

select version();

PostgreSQL 18.4 (Debian 18.4-1+b1) on x86_64-pc-linux-gnu, compiled by
x86_64-linux-gnu-gcc (Debian 15.3.0-1) 15.3.0, 64-bit
(1 row)








^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: Get version info
@ 2026-07-05 14:53  Adrian Klaver <[email protected]>
  parent: rob stone <[email protected]>
  1 sibling, 1 reply; 11+ messages in thread

From: Adrian Klaver @ 2026-07-05 14:53 UTC (permalink / raw)
  To: rob stone <[email protected]>; Igor Korot <[email protected]>; pgsql-generallists.postgresql.org <[email protected]>

On 7/5/26 1:18 AM, rob stone wrote:
> On Sun, 2026-07-05 at 01:32 -0500, Igor Korot wrote:
>> Hi, ALL,
>> Google recommends using pg-config.
>>
>> However, some distro prefer to use pkg-config and don't even include
>> local configuration file.
>>
>> Is this file located everywhere and if not - how do I check it inside
>> configure.ac?
>>
>> Thank you.
>>
> 
> 
> See chapter 9.27.11, not Mr. Google.
> 
> select version();
> 
> PostgreSQL 18.4 (Debian 18.4-1+b1) on x86_64-pc-linux-gnu, compiled by
> x86_64-linux-gnu-gcc (Debian 15.3.0-1) 15.3.0, 64-bit
> (1 row)

In addition:

show server_version;
            server_version
------------------------------------
  17.10 (Ubuntu 17.10-1.pgdg24.04+1)


show server_version_num;
  server_version_num
--------------------
  170010

-- 
Adrian Klaver
[email protected]





^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: Get version info
@ 2026-07-05 14:56  Ron Johnson <[email protected]>
  parent: Igor Korot <[email protected]>
  1 sibling, 1 reply; 11+ messages in thread

From: Ron Johnson @ 2026-07-05 14:56 UTC (permalink / raw)
  To: pgsql-general

On Sun, Jul 5, 2026 at 2:32 AM Igor Korot <[email protected]> wrote:

> Hi, ALL,
> Google recommends using pg-config.
>
> However, some distro prefer to use pkg-config and don't even include
> local configuration file.
>

Did you *try* running pg_config?

-- 
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!


^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: Get version info
@ 2026-07-05 18:09  Igor Korot <[email protected]>
  parent: rob stone <[email protected]>
  1 sibling, 1 reply; 11+ messages in thread

From: Igor Korot @ 2026-07-05 18:09 UTC (permalink / raw)
  To: rob stone <[email protected]>; pgsql-generallists.postgresql.org <[email protected]>

Hi, Rob,

On Sun, Jul 5, 2026 at 3:18 AM rob stone <[email protected]> wrote:
>
> On Sun, 2026-07-05 at 01:32 -0500, Igor Korot wrote:
> > Hi, ALL,
> > Google recommends using pg-config.
> >
> > However, some distro prefer to use pkg-config and don't even include
> > local configuration file.
> >
> > Is this file located everywhere and if not - how do I check it inside
> > configure.ac?
> >
> > Thank you.
> >
>
>
> See chapter 9.27.11, not Mr. Google.
>
> select version();
>
> PostgreSQL 18.4 (Debian 18.4-1+b1) on x86_64-pc-linux-gnu, compiled by
> x86_64-linux-gnu-gcc (Debian 15.3.0-1) 15.3.0, 64-bit
> (1 row)
>
>
LL,
> > Google recommends using pg-config.
> >
> > However, some distro prefer to use pkg-config and don't even include
> > local configuration file.
> >
> > Is this file located everywhere and if not - how do I check it inside
> > configure.ac?
> >
> > Thank you.
> >
>
>
> See chapter 9.27.11, not Mr. Google.

igor@WaylandGnome ~/dbhandler/Debug/dbhandler $ select version()
bash: syntax error near unexpected token `('

I need to check it inside configure.ac, not inside psql or any other PG client.

Thank you.





^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: Get version info
@ 2026-07-05 18:14  Igor Korot <[email protected]>
  parent: Adrian Klaver <[email protected]>
  0 siblings, 1 reply; 11+ messages in thread

From: Igor Korot @ 2026-07-05 18:14 UTC (permalink / raw)
  To: Adrian Klaver <[email protected]>; pgsql-generallists.postgresql.org <[email protected]>

Hi, Adrian,

On Sun, Jul 5, 2026 at 9:53 AM Adrian Klaver <[email protected]> wrote:
>
> On 7/5/26 1:18 AM, rob stone wrote:
> > On Sun, 2026-07-05 at 01:32 -0500, Igor Korot wrote:
> >> Hi, ALL,
> >> Google recommends using pg-config.
> >>
> >> However, some distro prefer to use pkg-config and don't even include
> >> local configuration file.
> >>
> >> Is this file located everywhere and if not - how do I check it inside
> >> configure.ac?
> >>
> >> Thank you.
> >>
> >
> >
> > See chapter 9.27.11, not Mr. Google.
> >
> > select version();
> >
> > PostgreSQL 18.4 (Debian 18.4-1+b1) on x86_64-pc-linux-gnu, compiled by
> > x86_64-linux-gnu-gcc (Debian 15.3.0-1) 15.3.0, 64-bit
> > (1 row)
>
> In addition:
>
> show server_version;
>             server_version
> ------------------------------------
>   17.10 (Ubuntu 17.10-1.pgdg24.04+1)
>
>
> show server_version_num;
>   server_version_num
> --------------------
>   170010

Again this is inside psql not inside shell/configure.ac

Thank you.

>
> --
> Adrian Klaver
> [email protected]





^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: Get version info
@ 2026-07-05 18:21  Igor Korot <[email protected]>
  parent: Ron Johnson <[email protected]>
  0 siblings, 0 replies; 11+ messages in thread

From: Igor Korot @ 2026-07-05 18:21 UTC (permalink / raw)
  To: Ron Johnson <[email protected]>; pgsql-generallists.postgresql.org <[email protected]>

Hi, Ron,

On Sun, Jul 5, 2026 at 9:56 AM Ron Johnson <[email protected]> wrote:
>
> On Sun, Jul 5, 2026 at 2:32 AM Igor Korot <[email protected]> wrote:
>>
>> Hi, ALL,
>> Google recommends using pg-config.
>>
>> However, some distro prefer to use pkg-config and don't even include
>> local configuration file.
>
>
> Did you try running pg_config?

Yes, I did:

igor@WaylandGnome ~/dbhandler $ pg_config --version | sed -e 's#PostgreSQL ##'
16.2

Thank you.

>
> --
> Death to <Redacted>, and butter sauce.
> Don't boil me, I'm still alive.
> <Redacted> lobster!






^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: Get version info
@ 2026-07-05 20:20  Brent Wood <[email protected]>
  parent: Igor Korot <[email protected]>
  0 siblings, 1 reply; 11+ messages in thread

From: Brent Wood @ 2026-07-05 20:20 UTC (permalink / raw)
  To: Igor Korot <[email protected]>; Adrian Klaver <[email protected]>; pgsql-generallists.postgresql.org <[email protected]>

I might be missing something, but...

You are asking for a shell command - surely

psql -d  ... -c "select version();"

Is a shell command?

But for a non-psql option:

Note that version() is built into the postgres binary itself, if you put the postgres bin folder in your system or user path you can simply run:
postgres -V
postgres (PostgreSQL) 16.14 (Ubuntu 16.14-0ubuntu0.24.04.1)

If it is not in your path, you need to use the full path:
/usr/lib/postgresql/16/bin/postgres -V
postgres (PostgreSQL) 16.14 (Ubuntu 16.14-0ubuntu0.24.04.1)

Easy to wrap in a script (given you want a shell command I figure you want a Linux solution):

#! /bin/bash
# return Postgres version from the command line
CMD=`locate postgresql | grep bin | grep postgres$`
$CMD -V | cut -f 3 -d " "

Eg: with this text in a file called get_ver

bash get_ver
16.14

You can simplify it slightly, but make the script a bit more arcane:

#! /bin/bash
# return Postgres version from the command line

`locate postgresql | grep bin | grep postgres$` -V | cut -f 3 -d " "


Hope this helps...


Brent Wood
________________________________
From: Igor Korot <[email protected]>
Sent: Monday, 6 July 2026 6:14 am
To: Adrian Klaver <[email protected]>; pgsql-generallists.postgresql.org <[email protected]>
Subject: Re: Get version info

Hi, Adrian,

On Sun, Jul 5, 2026 at 9:53 AM Adrian Klaver <[email protected]> wrote:
>
> On 7/5/26 1:18 AM, rob stone wrote:
> > On Sun, 2026-07-05 at 01:32 -0500, Igor Korot wrote:
> >> Hi, ALL,
> >> Google recommends using pg-config.
> >>
> >> However, some distro prefer to use pkg-config and don't even include
> >> local configuration file.
> >>
> >> Is this file located everywhere and if not - how do I check it inside
> >> configure.ac?
> >>
> >> Thank you.
> >>
> >
> >
> > See chapter 9.27.11, not Mr. Google.
> >
> > select version();
> >
> > PostgreSQL 18.4 (Debian 18.4-1+b1) on x86_64-pc-linux-gnu, compiled by
> > x86_64-linux-gnu-gcc (Debian 15.3.0-1) 15.3.0, 64-bit
> > (1 row)
>
> In addition:
>
> show server_version;
>             server_version
> ------------------------------------
>   17.10 (Ubuntu 17.10-1.pgdg24.04+1)
>
>
> show server_version_num;
>   server_version_num
> --------------------
>   170010

Again this is inside psql not inside shell/configure.ac

Thank you.

>
> --
> Adrian Klaver
> [email protected]



Brent Wood
Principal Technician - GIS and Spatial Data Management
+64-4-386-0529
301 Evans Bay Parade, Greta Point, Hataitai, Wellington, New Zealand
Earth Sciences New Zealand
[Earth Sciences New Zealand]<https://earthsciences.nz;
The Institute of Geological and Nuclear Sciences Limited and the National Institute of Water and Atmospheric Research Limited joined to become the New Zealand Institute for Earth Science Limited. We are known as Earth Sciences New Zealand. For more information on the Earth Sciences transition click here<https://niwa.co.nz/about-niwa/science-sector-reforms;.

Notice: This email and any attachments may contain information which is confidential and/or subject to copyright or legal privilege, and may not be used, published or redistributed without the prior written consent of Earth Sciences New Zealand. If you are not the intended recipient, please immediately notify the sender and delete the email and any attachments. Any opinion or views expressed in this email are those of the individual sender and may not represent those of Earth Sciences New Zealand.

For information about how we process data and monitor communications please see our privacy policy<https://earthsciences.nz/privacy-policy;.


^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: Get version info
@ 2026-07-05 20:24  Adrian Klaver <[email protected]>
  parent: Igor Korot <[email protected]>
  0 siblings, 1 reply; 11+ messages in thread

From: Adrian Klaver @ 2026-07-05 20:24 UTC (permalink / raw)
  To: Igor Korot <[email protected]>; rob stone <[email protected]>; pgsql-generallists.postgresql.org <[email protected]>

On 7/5/26 11:09 AM, Igor Korot wrote:
> Hi, Rob,
> 

>> See chapter 9.27.11, not Mr. Google.
> 
> igor@WaylandGnome ~/dbhandler/Debug/dbhandler $ select version()
> bash: syntax error near unexpected token `('
> 
> I need to check it inside configure.ac, not inside psql or any other PG client.

 From configure.ac, for major version:

18
AC_INIT([PostgreSQL], [18.0], [[email protected]], [], 
[https://www.postgresql.org/])

19beta1
AC_INIT([PostgreSQL], [19beta1], [[email protected]], [], 
[https://www.postgresql.org/])

Do you need more detail than that?

If so what other Postgres files do you have access to?

> 
> Thank you.
> 
> 


-- 
Adrian Klaver
[email protected]






^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: Get version info
@ 2026-07-05 21:06  Igor Korot <[email protected]>
  parent: Brent Wood <[email protected]>
  0 siblings, 0 replies; 11+ messages in thread

From: Igor Korot @ 2026-07-05 21:06 UTC (permalink / raw)
  To: Brent Wood <[email protected]>; pgsql-generallists.postgresql.org <[email protected]>

Hi, Brent,

On Sun, Jul 5, 2026 at 3:20 PM Brent Wood
<[email protected]> wrote:

> I might be missing something, but...
>
> You are asking for a shell command - surely
>

Please read the subject line of this thread.

And so in order to test it I can run the command inside the
Terminal/shell...

Thank you.


>
> *psql -d  ... -c "select version();"*
>
> Is a shell command?
>
> But for a non-psql option:
>
> Note that version() is built into the postgres binary itself, if you put
> the postgres bin folder in your system or user path you can simply run:
> *postgres -V*
> *postgres (PostgreSQL) 16.14 (Ubuntu 16.14-0ubuntu0.24.04.1)*
>
> If it is not in your path, you need to use the full path:
> */usr/lib/postgresql/16/bin/postgres -V*
> *postgres (PostgreSQL) 16.14 (Ubuntu 16.14-0ubuntu0.24.04.1)*
>
> Easy to wrap in a script (given you want a shell command I figure you want
> a Linux solution):
>
> #! /bin/bash
> # return Postgres version from the command line
> *CMD=`locate postgresql | grep bin | grep postgres$`*
> *$CMD -V | cut -f 3 -d " "*
>
> Eg: with this text in a file called get_ver
>
> *bash get_ver *
> *16.14*
>
> You can simplify it slightly, but make the script a bit more arcane:
>
> *#! /bin/bash*
> *# return Postgres version from the command line*
>
> *`locate postgresql | grep bin | grep postgres$` -V | cut -f 3 -d " "*
>
>
> Hope this helps...
>
>
> Brent Wood
> ------------------------------
> *From:* Igor Korot <[email protected]>
> *Sent:* Monday, 6 July 2026 6:14 am
> *To:* Adrian Klaver <[email protected]>;
> pgsql-generallists.postgresql.org <[email protected]>
> *Subject:* Re: Get version info
>
> Hi, Adrian,
>
> On Sun, Jul 5, 2026 at 9:53 AM Adrian Klaver <[email protected]>
> wrote:
> >
> > On 7/5/26 1:18 AM, rob stone wrote:
> > > On Sun, 2026-07-05 at 01:32 -0500, Igor Korot wrote:
> > >> Hi, ALL,
> > >> Google recommends using pg-config.
> > >>
> > >> However, some distro prefer to use pkg-config and don't even include
> > >> local configuration file.
> > >>
> > >> Is this file located everywhere and if not - how do I check it inside
> > >> configure.ac?
> > >>
> > >> Thank you.
> > >>
> > >
> > >
> > > See chapter 9.27.11, not Mr. Google.
> > >
> > > select version();
> > >
> > > PostgreSQL 18.4 (Debian 18.4-1+b1) on x86_64-pc-linux-gnu, compiled by
> > > x86_64-linux-gnu-gcc (Debian 15.3.0-1) 15.3.0, 64-bit
> > > (1 row)
> >
> > In addition:
> >
> > show server_version;
> >             server_version
> > ------------------------------------
> >   17.10 (Ubuntu 17.10-1.pgdg24.04+1)
> >
> >
> > show server_version_num;
> >   server_version_num
> > --------------------
> >   170010
>
> Again this is inside psql not inside shell/configure.ac
>
> Thank you.
>
> >
> > --
> > Adrian Klaver
> > [email protected]
>
>
>
> *Brent Wood *
> Principal Technician - GIS and Spatial Data Management
> +64-4-386-0529
> 301 Evans Bay Parade, Greta Point, Hataitai, Wellington, New Zealand
> Earth Sciences New Zealand
> [image: Earth Sciences New Zealand] <https://earthsciences.nz;
> The Institute of Geological and Nuclear Sciences Limited and the National
> Institute of Water and Atmospheric Research Limited joined to become the
> New Zealand Institute for Earth Science Limited. We are known as Earth
> Sciences New Zealand. For more information on the Earth Sciences transition click
> here <https://niwa.co.nz/about-niwa/science-sector-reforms;.
>
> *Notice:* This email and any attachments may contain information which is
> confidential and/or subject to copyright or legal privilege, and may not be
> used, published or redistributed without the prior written consent of Earth
> Sciences New Zealand. If you are not the intended recipient, please
> immediately notify the sender and delete the email and any attachments. Any
> opinion or views expressed in this email are those of the individual sender
> and may not represent those of Earth Sciences New Zealand.
>
> For information about how we process data and monitor communications
> please see our privacy policy <https://earthsciences.nz/privacy-policy;.
>


^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: Get version info
@ 2026-07-05 21:17  Igor Korot <[email protected]>
  parent: Adrian Klaver <[email protected]>
  0 siblings, 0 replies; 11+ messages in thread

From: Igor Korot @ 2026-07-05 21:17 UTC (permalink / raw)
  To: Adrian Klaver <[email protected]>; pgsql-generallists.postgresql.org <[email protected]>

Hi, Adrian,

On Sun, Jul 5, 2026 at 3:24 PM Adrian Klaver <[email protected]> wrote:
>
> On 7/5/26 11:09 AM, Igor Korot wrote:
> > Hi, Rob,
> >
>
> >> See chapter 9.27.11, not Mr. Google.
> >
> > igor@WaylandGnome ~/dbhandler/Debug/dbhandler $ select version()
> > bash: syntax error near unexpected token `('
> >
> > I need to check it inside configure.ac, not inside psql or any other PG client.
>
>  From configure.ac, for major version:
>
> 18
> AC_INIT([PostgreSQL], [18.0], [[email protected]], [],
> [https://www.postgresql.org/])
>
> 19beta1
> AC_INIT([PostgreSQL], [19beta1], [[email protected]], [],
> [https://www.postgresql.org/])
>
> Do you need more detail than that?

Yes.
How do I find out if its 18 or 19 or 17 or?

Thank you.

>
> If so what other Postgres files do you have access to?
>
> >
> > Thank you.
> >
> >
>
>
> --
> Adrian Klaver
> [email protected]






^ permalink  raw  reply  [nested|flat] 11+ messages in thread


end of thread, other threads:[~2026-07-05 21:17 UTC | newest]

Thread overview: 11+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-07-05 06:32 Get version info Igor Korot <[email protected]>
2026-07-05 08:18 ` rob stone <[email protected]>
2026-07-05 14:53   ` Adrian Klaver <[email protected]>
2026-07-05 18:14     ` Igor Korot <[email protected]>
2026-07-05 20:20       ` Brent Wood <[email protected]>
2026-07-05 21:06         ` Igor Korot <[email protected]>
2026-07-05 18:09   ` Igor Korot <[email protected]>
2026-07-05 20:24     ` Adrian Klaver <[email protected]>
2026-07-05 21:17       ` Igor Korot <[email protected]>
2026-07-05 14:56 ` Ron Johnson <[email protected]>
2026-07-05 18:21   ` Igor Korot <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox