agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
Any postgres API available to get errorcode for PQerrorMessage
8+ messages / 6 participants
[nested] [flat]

* Any postgres API available to get errorcode for PQerrorMessage
@ 2014-10-15 08:17 Roopeshakumar Narayansa Shalgar (rshalgar) <rshalgar@cisco.com>
  2014-10-15 16:36 ` Re: [GENERAL] Any postgres API available to get errorcode for PQerrorMessage Tom Lane <tgl@sss.pgh.pa.us>
  2014-10-15 16:37 ` Re: Any postgres API available to get errorcode for PQerrorMessage Rob Sargent <robjsargent@gmail.com>
  0 siblings, 2 replies; 8+ messages in thread

From: Roopeshakumar Narayansa Shalgar (rshalgar) @ 2014-10-15 08:17 UTC (permalink / raw)
  To: pgsql-sql; pgsql-general@postgresql.org <pgsql-general@postgresql.org>

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

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

* Re: [GENERAL] Any postgres API available to get errorcode for PQerrorMessage
  2014-10-15 08:17 Any postgres API available to get errorcode for PQerrorMessage Roopeshakumar Narayansa Shalgar (rshalgar) <rshalgar@cisco.com>
@ 2014-10-15 16:36 ` Tom Lane <tgl@sss.pgh.pa.us>
  2014-10-15 16:48   ` Re: [GENERAL] Any postgres API available to get errorcode for PQerrorMessage Roopeshakumar Narayansa Shalgar (rshalgar) <rshalgar@cisco.com>
  2014-10-16 07:09   ` Re: Any postgres API available to get errorcode for PQerrorMessage Roopeshakumar Narayansa Shalgar (rshalgar) <rshalgar@cisco.com>
  1 sibling, 2 replies; 8+ messages in thread

From: Tom Lane @ 2014-10-15 16:36 UTC (permalink / raw)
  To: Roopeshakumar Narayansa Shalgar (rshalgar) <rshalgar@cisco.com>; +Cc: pgsql-sql; pgsql-general@postgresql.org <pgsql-general@postgresql.org>

"Roopeshakumar Narayansa Shalgar (rshalgar)" <rshalgar@cisco.com> writes:
> 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

Use PQresultErrorField(..., PG_DIAG_SQLSTATE)

http://www.postgresql.org/docs/9.3/static/libpq-exec.html#LIBPQ-EXEC-MAIN

			regards, tom lane


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



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

* Re: [GENERAL] Any postgres API available to get errorcode for PQerrorMessage
  2014-10-15 08:17 Any postgres API available to get errorcode for PQerrorMessage Roopeshakumar Narayansa Shalgar (rshalgar) <rshalgar@cisco.com>
  2014-10-15 16:36 ` Re: [GENERAL] Any postgres API available to get errorcode for PQerrorMessage Tom Lane <tgl@sss.pgh.pa.us>
@ 2014-10-15 16:48   ` Roopeshakumar Narayansa Shalgar (rshalgar) <rshalgar@cisco.com>
  2014-10-15 17:21     ` Re: Any postgres API available to get errorcode for PQerrorMessage John R Pierce <pierce@hogranch.com>
  1 sibling, 1 reply; 8+ messages in thread

From: Roopeshakumar Narayansa Shalgar (rshalgar) @ 2014-10-15 16:48 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-sql; pgsql-general@postgresql.org <pgsql-general@postgresql.org>

Thanks Tom,

But that's not what I am looking for. 

I need the 'integer' errorcode equivalent of " errormsg   string" returned by PQerrorMessage.

/rK

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us] 
Sent: Wednesday, October 15, 2014 10:07 PM
To: Roopeshakumar Narayansa Shalgar (rshalgar)
Cc: pgsql-sql@postgresql.org; pgsql-general@postgresql.org
Subject: Re: [GENERAL] Any postgres API available to get errorcode for PQerrorMessage

"Roopeshakumar Narayansa Shalgar (rshalgar)" <rshalgar@cisco.com> writes:
> 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

Use PQresultErrorField(..., PG_DIAG_SQLSTATE)

http://www.postgresql.org/docs/9.3/static/libpq-exec.html#LIBPQ-EXEC-MAIN

			regards, tom lane


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



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

* Re: Any postgres API available to get errorcode for PQerrorMessage
  2014-10-15 08:17 Any postgres API available to get errorcode for PQerrorMessage Roopeshakumar Narayansa Shalgar (rshalgar) <rshalgar@cisco.com>
  2014-10-15 16:36 ` Re: [GENERAL] Any postgres API available to get errorcode for PQerrorMessage Tom Lane <tgl@sss.pgh.pa.us>
  2014-10-15 16:48   ` Re: [GENERAL] Any postgres API available to get errorcode for PQerrorMessage Roopeshakumar Narayansa Shalgar (rshalgar) <rshalgar@cisco.com>
@ 2014-10-15 17:21     ` John R Pierce <pierce@hogranch.com>
  0 siblings, 0 replies; 8+ messages in thread

From: John R Pierce @ 2014-10-15 17:21 UTC (permalink / raw)
  To: pgsql-general@postgresql.org

On 10/15/2014 9:48 AM, Roopeshakumar Narayansa Shalgar (rshalgar) wrote:
> I need the 'integer' errorcode

SQLSTATE Error codes are NOT integers, they are strings.  note there's 
stuff in there like 0100C, 01P01, etc.


-- 
john r pierce                                      37N 122W
somewhere on the middle of the left coast



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



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

* Re: Any postgres API available to get errorcode for PQerrorMessage
  2014-10-15 08:17 Any postgres API available to get errorcode for PQerrorMessage Roopeshakumar Narayansa Shalgar (rshalgar) <rshalgar@cisco.com>
  2014-10-15 16:36 ` Re: [GENERAL] Any postgres API available to get errorcode for PQerrorMessage Tom Lane <tgl@sss.pgh.pa.us>
@ 2014-10-16 07:09   ` Roopeshakumar Narayansa Shalgar (rshalgar) <rshalgar@cisco.com>
  2014-10-16 20:09     ` Re: Any postgres API available to get errorcode for PQerrorMessage Adrian Klaver <adrian.klaver@aklaver.com>
  1 sibling, 1 reply; 8+ messages in thread

From: Roopeshakumar Narayansa Shalgar (rshalgar) @ 2014-10-16 07:09 UTC (permalink / raw)
  To: pgsql-sql; pgsql-general@postgresql.org <pgsql-general@postgresql.org>

Appreciate any replies on this.

/rK

-----Original Message-----
From: Roopeshakumar Narayansa Shalgar (rshalgar) 
Sent: Wednesday, October 15, 2014 10:19 PM
To: 'Tom Lane'; pgsql-sql@postgresql.org; pgsql-general@postgresql.org
Subject: RE: [GENERAL] Any postgres API available to get errorcode for PQerrorMessage

Thanks Tom,

But that's not what I am looking for. 

I need the 'integer' errorcode equivalent of " errormsg   string" returned by PQerrorMessage.

/rK

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us] 
Sent: Wednesday, October 15, 2014 10:07 PM
To: Roopeshakumar Narayansa Shalgar (rshalgar)
Cc: pgsql-sql@postgresql.org; pgsql-general@postgresql.org
Subject: Re: [GENERAL] Any postgres API available to get errorcode for PQerrorMessage

"Roopeshakumar Narayansa Shalgar (rshalgar)" <rshalgar@cisco.com> writes:
> 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

Use PQresultErrorField(..., PG_DIAG_SQLSTATE)

http://www.postgresql.org/docs/9.3/static/libpq-exec.html#LIBPQ-EXEC-MAIN

			regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



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

* Re: Any postgres API available to get errorcode for PQerrorMessage
  2014-10-15 08:17 Any postgres API available to get errorcode for PQerrorMessage Roopeshakumar Narayansa Shalgar (rshalgar) <rshalgar@cisco.com>
  2014-10-15 16:36 ` Re: [GENERAL] Any postgres API available to get errorcode for PQerrorMessage Tom Lane <tgl@sss.pgh.pa.us>
  2014-10-16 07:09   ` Re: Any postgres API available to get errorcode for PQerrorMessage Roopeshakumar Narayansa Shalgar (rshalgar) <rshalgar@cisco.com>
@ 2014-10-16 20:09     ` Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 0 replies; 8+ messages in thread

From: Adrian Klaver @ 2014-10-16 20:09 UTC (permalink / raw)
  To: Roopeshakumar Narayansa Shalgar (rshalgar) <rshalgar@cisco.com>; pgsql-sql; pgsql-general@postgresql.org <pgsql-general@postgresql.org>

On 10/16/2014 12:09 AM, Roopeshakumar Narayansa Shalgar (rshalgar) wrote:
> Appreciate any replies on this.

It has been answered, see Tom Lanes link below. In particular you are 
looking for PG_DIAG_SQLSTATE.

>
> /rK
>
> -----Original Message-----
> From: Roopeshakumar Narayansa Shalgar (rshalgar)
> Sent: Wednesday, October 15, 2014 10:19 PM
> To: 'Tom Lane'; pgsql-sql@postgresql.org; pgsql-general@postgresql.org
> Subject: RE: [GENERAL] Any postgres API available to get errorcode for PQerrorMessage
>
> Thanks Tom,
>
> But that's not what I am looking for.
>
> I need the 'integer' errorcode equivalent of " errormsg   string" returned by PQerrorMessage.
>
> /rK
>
> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Sent: Wednesday, October 15, 2014 10:07 PM
> To: Roopeshakumar Narayansa Shalgar (rshalgar)
> Cc: pgsql-sql@postgresql.org; pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Any postgres API available to get errorcode for PQerrorMessage
>
> "Roopeshakumar Narayansa Shalgar (rshalgar)" <rshalgar@cisco.com> writes:
>> 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
>
> Use PQresultErrorField(..., PG_DIAG_SQLSTATE)
>
> http://www.postgresql.org/docs/9.3/static/libpq-exec.html#LIBPQ-EXEC-MAIN
>
> 			regards, tom lane
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



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

* Re: Any postgres API available to get errorcode for PQerrorMessage
  2014-10-15 08:17 Any postgres API available to get errorcode for PQerrorMessage Roopeshakumar Narayansa Shalgar (rshalgar) <rshalgar@cisco.com>
@ 2014-10-15 16:37 ` Rob Sargent <robjsargent@gmail.com>
  2014-10-16 03:10   ` Re: Any postgres API available to get errorcode for PQerrorMessage Yogesh. Sharma <Yogesh1.Sharma@nectechnologies.in>
  1 sibling, 1 reply; 8+ messages in thread

From: Rob Sargent @ 2014-10-15 16:37 UTC (permalink / raw)
  To: pgsql-general@postgresql.org

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?

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

* Re: Any postgres API available to get errorcode for PQerrorMessage
  2014-10-15 08:17 Any postgres API available to get errorcode for PQerrorMessage Roopeshakumar Narayansa Shalgar (rshalgar) <rshalgar@cisco.com>
  2014-10-15 16:37 ` Re: Any postgres API available to get errorcode for PQerrorMessage Rob Sargent <robjsargent@gmail.com>
@ 2014-10-16 03:10   ` Yogesh. Sharma <Yogesh1.Sharma@nectechnologies.in>
  0 siblings, 0 replies; 8+ messages in thread

From: Yogesh. Sharma @ 2014-10-16 03:10 UTC (permalink / raw)
  To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>

Dear All,

I am facing some issue during postgresql service stop.
Issue:-
[root@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@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Rob Sargent
Sent: Wednesday, October 15, 2014 10:08 PM
To: pgsql-general@postgresql.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. .
-----------------------------------------------------------------------------------------------------------------------

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


end of thread, other threads:[~2014-10-16 20:09 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-10-15 08:17 Any postgres API available to get errorcode for PQerrorMessage Roopeshakumar Narayansa Shalgar (rshalgar) <rshalgar@cisco.com>
2014-10-15 16:36 ` Tom Lane <tgl@sss.pgh.pa.us>
2014-10-15 16:48   ` Roopeshakumar Narayansa Shalgar (rshalgar) <rshalgar@cisco.com>
2014-10-15 17:21     ` John R Pierce <pierce@hogranch.com>
2014-10-16 07:09   ` Roopeshakumar Narayansa Shalgar (rshalgar) <rshalgar@cisco.com>
2014-10-16 20:09     ` Adrian Klaver <adrian.klaver@aklaver.com>
2014-10-15 16:37 ` Rob Sargent <robjsargent@gmail.com>
2014-10-16 03:10   ` Yogesh. Sharma <Yogesh1.Sharma@nectechnologies.in>

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