Re: plpgsql errorcodes

From: Andreas Kretschmer <andreas_kretschmer(at)despammed(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: plpgsql errorcodes
Date: 2004-12-17 16:52:00
Message-ID: gefb92-l16.ln1@kaufbach.delug.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

begin "Robert Wimmer" <seppwimmer(at)hotmail(dot)com> wrote:
> i want the DB functionality to be done by the server. this means i want to
> write functions like

> CREATE FUNCTION insert_any(....) RETURNS INT AS '
> BEGIN

> END; '
> LANGUAGE 'plpgsql'

> returning an errorcode so i can map this errorcode to a message for the user
> of the client. and i want to do this on the server without using any

You can use RAISE to generate a error.

end
Andreas
--
Diese Message wurde erstellt mit freundlicher Unterstützung eines freilau-
fenden Pinguins aus artgerechter Freilandhaltung. Er ist garantiert frei
von Micro$oft'schen Viren. (#97922 http://counter.li.org) GPG 7F4584DA
Was, Sie wissen nicht, wo Kaufbach ist? Hier: N 51.05082°, E 13.56889° ;-)

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Jens Lechtenboerger 2004-12-17 17:04:33 Re: Lost updates vs resumable connections/transactions
Previous Message Andreas Kretschmer 2004-12-17 16:39:58 Re: restore a plpgsql function with pg_restore