Re: Text Description of Current Exception

From: Justin <justin(at)emproshunts(dot)com>
To: Ward Eaton <Ward(dot)Eaton(at)rad-con(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Text Description of Current Exception
Date: 2009-04-03 04:32:36
Message-ID: 49D59164.8080601@emproshunts.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Ward Eaton wrote:
<blockquote
cite="mid:04A6DB42D2BA534FAC77B90562A6A03DD629A9(at)server(dot)rad-con(dot)local"
type="cite">
<meta http-equiv="Content-Type" content="text/html; ">
<meta name="Generator" content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri="schemas-esna-com/ucm" name="phone" downloadurl="">
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style></o:SmartTagType>
<div class="Section1">
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">Hello,<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"><o:p>&nbsp;</o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">I would like to log any
exceptions which may be thrown in my
database functions.&nbsp; Oracle has a predefined variable,</span></font><font
color="blue" face="Arial"><span
style="font-family: Arial; color: blue;"> </span></font><font
face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">SQLERRM,
which will always have a text description of the current exception.&nbsp; Is
there
anything like this available in postgres?<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"><o:p>&nbsp;</o:p></span></font></p>
<p class="MsoNormal" style=""><font face="Tahoma" size="2"><span
style="font-size: 10pt; font-family: Tahoma;"><font color="blue"><span
style="color: blue;"><a moz-do-not-send="true"
href="mailto:Ward(dot)Eaton(at)RAD-CON(dot)com"
title="mailto:Michael(dot)Loufman(at)RAD-CON(dot)com"><span
title="mailto:Michael(dot)Loufman(at)RAD-CON(dot)com"></span></a></span></font></span></font><font
face="Tahoma" size="2"><span
style="font-size: 10pt; font-family: Tahoma;"><o:p></o:p></span></font></p>
</div>
</blockquote>
<br>
<div class="Section1">
<p class="MsoNormal"><font face="Times New Roman" size="3"><span
style="font-size: 12pt;"><o:p><br>
</o:p></span></font></p>
</div>
I'm not sure what you are after.&nbsp; Your requesting logging the error yet
referring to SqlErrm used in exception blocks<br>
<br>
postgresql has SQLSTATE used in&nbsp; exception catching of errors in a
pl/SQL function&nbsp; see<br>
<a class="moz-txt-link-freetext" href="http://www.postgresql.org/docs/8.3/interactive/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING">http://www.postgresql.org/docs/8.3/interactive/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING</a><br>
<br>
Postgresql logs errors in a log file unless it's been turned off.<br>
See configure logging <br>
<a class="moz-txt-link-freetext" href="http://www.postgresql.org/docs/8.3/interactive/runtime-config-logging.html">http://www.postgresql.org/docs/8.3/interactive/runtime-config-logging.html</a><br>
<br>
<br>
These instructions are for 8.3&nbsp; if you have different version go to
this section of the help files for your specific version.<br>
<br>
</body>
</html>

Attachment Content-Type Size
unknown_filename text/html 4.0 KB

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Nicolas Michel 2009-04-03 09:35:42 Memory Problem
Previous Message Tony Liao 2009-04-03 03:03:37 how to do prefix_range default value?