Re: Any postgres API available to get errorcode for PQerrorMessage

From: "Yogesh(dot) Sharma" <Yogesh1(dot)Sharma(at)nectechnologies(dot)in>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Any postgres API available to get errorcode for PQerrorMessage
Date: 2014-10-16 03:10:30
Message-ID: 8F86F8F397DDD345B25EA2EF3E216482169FA71B@EXCH-MB-U1.nectechnologies.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

Dear All,

I am facing some issue during postgresql service stop.
Issue:-
[root(at)localhost postgresql-9.0.18]# runuser -l postgres -c '/usr/pgsql/bin/pg_ctl stop -D '\''/var/lib/pgsql/data'\'' -s -m fast'
/usr/pgsql/bin/pg_ctl: error while loading shared libraries: libpq.so.5: cannot open shared object file: No such file or directory

How to resolve above issue.

I have performed some operations manually and this issue is resolved.
cp /usr/pgsql/lib/libpqwalreceiver.so pgsql/lib/libpq.so.5.3 /usr/lib64/
ln -s libpq.so.5.3 libpq.so
ln -s libpq.so.5.3 libpq.so.5

How to resolve by postgresql.spec file?

Regards,
Yogesh

From: pgsql-general-owner(at)postgresql(dot)org [mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Rob Sargent
Sent: Wednesday, October 15, 2014 10:08 PM
To: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Any postgres API available to get errorcode for PQerrorMessage

On 10/15/2014 02:17 AM, Roopeshakumar Narayansa Shalgar (rshalgar) wrote:
HI,

PQerrorMessage pirints the error message like (no space available,etc). Does postgres provide
any API which gives the error code listed in the below appendix;

http://www.postgresql.org/docs/9.1/static/errcodes-appendix.html

I need the exact error code so that I can shutdown my application whenever I face the "no space available" problem.

--
Thanks and Regards,
Rupesh
Isn't this best done by monitoring tools such as nagios and done much before you actually run out of space?

DISCLAIMER:
-----------------------------------------------------------------------------------------------------------------------
The contents of this e-mail and any attachment(s) are confidential and
intended
for the named recipient(s) only.
It shall not attach any liability on the originator or NEC or its
affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the
opinions of NEC or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification,
distribution and / or publication of
this message without the prior written consent of the author of this e-mail is
strictly prohibited. If you have
received this email in error please delete it and notify the sender
immediately. .
-----------------------------------------------------------------------------------------------------------------------

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2014-10-16 03:21:46 Re: library path problems? (was: Completely unrelated)
Previous Message Jonathan Rogers 2014-10-15 21:58:37 Re: PL/Python prepare example's use of setdefault

Browse pgsql-sql by date

  From Date Subject
Next Message John R Pierce 2014-10-16 03:21:46 Re: library path problems? (was: Completely unrelated)
Previous Message John R Pierce 2014-10-15 17:21:53 Re: Any postgres API available to get errorcode for PQerrorMessage