Re: Good Books

From: "Sim Zacks" <sim(at)compulab(dot)co(dot)il>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Good Books
Date: 2005-03-27 06:17:17
Message-ID: d25j8v$oo7$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

PostgreSQL 8.0.0beta5 Documentation
Chapter 35.9 bottom of the page.
"RAISE EXCEPTION presently always generates the same SQLSTATE code,
P0001, no matter what message it is invoked with. It is possible
to trap this exception with EXCEPTION ... WHEN RAISE_EXCEPTION THEN ...
but there is no way to tell one RAISE from another. "

It would seem a kludge would be to set a variable at each point of possible
failure, such as continuously incrementing a variable as it goes through the
code. You would then be able to use a standard case statement or call an
error message function to return a meaningful error message.

In any case, the documentation very clearly says you can't do it.

<postgresql(at)bryden(dot)co(dot)za> wrote in message
news:43109(dot)127(dot)0(dot)0(dot)1(dot)1111671666(dot)squirrel(at)127(dot)0(dot)0(dot)1(dot)(dot)(dot)
> Hi Bruno
>
> There are a lot of the topics that I feel could have better (or more
> comprehensive examples). In particular I am thinking of plpgsql. One
> example is information about working with Exceptions (postgresql specific)
> and another is the small amount of info about the RAISE Statement.
>
> Refering to my mention of exceptions above, the following is information
> that I could not find in the standard docs:
> How to use(Return using RAISE) the actual exception code and message once
> you have handled the error. This is especially usefull if you have used
> WHEN OTHERS to catch the error.
>
> Thanks
> Craig
>
> > On Thu, Mar 24, 2005 at 14:37:59 +0200,
> > postgresql(at)bryden(dot)co(dot)za wrote:
> >> Hi
> >>
> >> I am new to PostgreSQL and find that the standard documentation is very
> >> thin. I would like to buy a more comprehensive book. All the available
> >> books seem very out of date!!! Firstly, does it matter if I buy a book
> >> that was published in Feb 2003? Will such a book be hopelessly out of
> >> date?
> >
> > What parts of the documentation do you find thin? Without knowing what
> > you need extra info on, it will be hard to recommend other
documentation.
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 5: Have you checked our extensive FAQ?
> >
> > http://www.postgresql.org/docs/faq
> >
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Madison Kelly 2005-03-27 06:34:23 Re: Perl and AutoCommit
Previous Message Yanni Chiu 2005-03-27 06:08:35 Re: Perl and AutoCommit