Re: Good Books

Поиск
Список
Период
Сортировка
От Sim Zacks
Тема Re: Good Books
Дата
Msg-id d25j8v$oo7$1@news.hub.org
обсуждение исходный текст
Ответ на Good Books  (postgresql@bryden.co.za)
Список 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@bryden.co.za> wrote in message
news:43109.127.0.0.1.1111671666.squirrel@127.0.0.1...
> 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@bryden.co.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
>



В списке pgsql-general по дате отправления:

Предыдущее
От: Dan Sugalski
Дата:
Сообщение: Re: Perl and AutoCommit
Следующее
От: Yanni Chiu
Дата:
Сообщение: Re: Perl and AutoCommit