Обсуждение: Different versions between psq/postgres and the actual database
Hi all,
I'm facing this issue and I wondering how to fix it.
Output of postgres --version
$ /usr/pgsql-9.2/bin/postgres --version
postgres (PostgreSQL) 9.2.14
Output of psql version
$ psql --version
psql (PostgreSQL) 9.2.14
Output of postgres DB running version.
-bash-4.1$ psql signserver
psql (9.2.14, server 9.2.4)
signserver=# select version();
version
--------------------------------------------------------------------------------------------------------------
PostgreSQL 9.2.4 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3), 64-bit
I'm not sure how did it got to this situation as this is the staging environment and it's monitored. Is it possible to "relink" the libraries? I prefer not to upgrade to 9.4
Thanks!
-- Regards,
Ang Wei Shan
Ang Wei Shan
Hi Wei Shan, I've been through this and this is simple. I've been using my PostgreSQL 9.4 database using psql 9.2 for months and all went fine. To workaround it, you can compile PostgreSQL client 9.2.4 in another directory, and run the binary that you compiled in that directory. For example if you make new PostgreSQL client compile with prefix=/opt/postgresql-9.2.4 You can run the psql like this: /opt/postgresql-9.2.4/bin/psql <your server, maybe signserver> To help yourself, search in the web for: - how to compile postgresql in a specific directory - how to edit the PATH environment in RedHat linux or Debian or centos or your choice Hope this helps. Regards On 18/11/2015, Wei Shan <weishan.ang@gmail.com> wrote: > Hi all, > > I'm facing this issue and I wondering how to fix it. > > *Output of postgres --version* > $ /usr/pgsql-9.2/bin/postgres --version > postgres (PostgreSQL) 9.2.14 > > *Output of psql version* > $ psql --version > psql (PostgreSQL) 9.2.14 > > *Output of postgres DB running version.* > -bash-4.1$ psql signserver > psql (9.2.14, server 9.2.4) > signserver=# select version(); > version > -------------------------------------------------------------------------------------------------------------- > PostgreSQL 9.2.4 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.7 > 20120313 (Red Hat 4.4.7-3), 64-bit > > > I'm not sure how did it got to this situation as this is the staging > environment and it's monitored. Is it possible to "relink" the libraries? I > prefer not to upgrade to 9.4 > > Thanks! > -- > Regards, > Ang Wei Shan >
Wei Shan wrote: > I'm facing this issue and I wondering how to fix it. > > Output of postgres --version > $ /usr/pgsql-9.2/bin/postgres --version > postgres (PostgreSQL) 9.2.14 > > Output of psql version > $ psql --version > psql (PostgreSQL) 9.2.14 > > Output of postgres DB running version. > -bash-4.1$ psql signserver > psql (9.2.14, server 9.2.4) > signserver=# select version(); > version > ------------------------------------------------------------------------------------------------------ > -------- > PostgreSQL 9.2.4 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3), > 64-bit > > > I'm not sure how did it got to this situation as this is the staging environment and it's monitored. > Is it possible to "relink" the libraries? I prefer not to upgrade to 9.4 There are several possibilities: - You upgraded, but forgot to restart the postmaster. Try "pg_ctl restart -m fast" and see if it fixes the problem. - You connect to a different PostgreSQL installation. What are the environment variables PGHOST and PGPORT set to? Yours, Laurenz Albe
Hi all,
Thanks for the help. Restarting the postgres instance fixes the issue :)
Cheers!
On 18 November 2015 at 17:36, Albe Laurenz <laurenz.albe@wien.gv.at> wrote:
Wei Shan wrote:
> I'm facing this issue and I wondering how to fix it.
>
> Output of postgres --version
> $ /usr/pgsql-9.2/bin/postgres --version
> postgres (PostgreSQL) 9.2.14
>
> Output of psql version
> $ psql --version
> psql (PostgreSQL) 9.2.14
>
> Output of postgres DB running version.
> -bash-4.1$ psql signserver
> psql (9.2.14, server 9.2.4)
> signserver=# select version();
> version
> ------------------------------------------------------------------------------------------------------
> --------
> PostgreSQL 9.2.4 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3),
> 64-bit
>
>
> I'm not sure how did it got to this situation as this is the staging environment and it's monitored.
> Is it possible to "relink" the libraries? I prefer not to upgrade to 9.4
There are several possibilities:
- You upgraded, but forgot to restart the postmaster.
Try "pg_ctl restart -m fast" and see if it fixes the problem.
- You connect to a different PostgreSQL installation.
What are the environment variables PGHOST and PGPORT set to?
Yours,
Laurenz Albe
Regards,
Ang Wei Shan
Ang Wei Shan