| From: | Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au> |
|---|---|
| To: | "Jim C(dot) Nasby" <decibel(at)decibel(dot)org> |
| Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org |
| Subject: | Re: Anybody have an Oracle PL/SQL reference at hand? |
| Date: | 2004-08-04 01:55:42 |
| Message-ID: | 4110421E.6090904@familyhealth.com.au |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
>>
>>
>>> BEGIN;
>>> SAVEPOINT start;
>>> INSERT INTO users VALUES(user || suffix);
>>> EXIT;
>>> EXCEPTION
>>> WHEN UNIQUE_VIOLATION THEN
>>> ROLLBACK TO start;
>>> suffix := suffix + 1;
>>> END;
> By the way, while I know Oracle won't abort the transaction, they might
> rollback whatever work the command that failed had done; I'm not really
> sure how that's handled.
How about a new EXCEPTION clause:
EXCEPTION NO ROLLBACK
WHEN UNIQUE...
Chirs
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Christopher Kings-Lynne | 2004-08-04 02:05:47 | Re: pgxs: build infrastructure for extensions v4 |
| Previous Message | Christopher Kings-Lynne | 2004-08-04 01:50:36 | Re: pg_dump bug fixing |