| From: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
|---|---|
| To: | Mike Mascari <mascarm(at)mascari(dot)com> |
| Cc: | <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: Possible feature? |
| Date: | 2001-07-11 15:28:58 |
| Message-ID: | Pine.LNX.4.30.0107111724300.679-100000@peter.localdomain |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
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.
--
Peter Eisentraut peter_e(at)gmx(dot)net http://funkturm.homeip.net/~peter
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Dave Cramer | 2001-07-11 16:14:58 | RE: JDBC and stored procedures |
| Previous Message | Tom Lane | 2001-07-11 15:24:57 | Re: Re: SOMAXCONN (was Re: Solaris source code) |