Re: Possible feature?

From: Klaus Reger <K(dot)Reger(at)wwwdb(dot)de>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Possible feature?
Date: 2001-07-12 05:05:56
Message-ID: 200107120506.f6C566O26515@pc01.reger-clan.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wednesday, 11. July 2001 17:28, you wrote:
> Mike Mascari writes:
> > MESSAGE ON INDEX i_employees IS
> > 'An employee with a matching Social Security number already exists';
> >
> > Then, when the UNIQUE constraint of the index is violated, instead of
> > the message:
> >
> > 'Cannot insert a duplicate key into a unique index i_test1'
> >
> > the client application would receive:
> >
> > 'An employee with a matching Social Security number already exists'
>
> I think what you're after is
>
> TRY
> BEGIN
> INSERT ...
> END
> CATCH SQLCODE 12345 -- made up
> BEGIN
> RAISE 'your message here'
> END
>
> I'm positive people would kill for that kind of feature.

Then we should use this syntax (like Oracle does):

BEGIN
INSERT ....

EXCEPTION WHEN .... THEN
RAISE 'your message here'
END

Regards,
Klaus

--
Visit WWWdb at
http://wwwdb.org

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Samuel 2001-07-12 06:20:35 Re: Re: Encrypting pg_shadow passwords
Previous Message Klaus Reger 2001-07-12 05:05:23 Re: Repost: Get table/field-identifiers in uppercase