Re: [HACKERS] Anybody have an Oracle PL/SQL reference at hand?

2004-08-05 Thread Andre Maasikas
Title: RE: [HACKERS] Anybody have an Oracle PL/SQL reference at hand? > Tom Lane wrote: > > Hmm.  Not only is that a pretty short list, but many of them don't > correspond very closely to the errors that Postgres would raise. I think these where like predefined 'shor

Re: [HACKERS] Anybody have an Oracle PL/SQL reference at hand?

2004-08-04 Thread Jim C. Nasby
On Wed, Aug 04, 2004 at 09:46:22AM +0800, Christopher Kings-Lynne wrote: > >Depending on how tense you want to be about Oracle compatibility, we > >could make people actually write their blocks as above --- that is, > >the SAVEPOINT and ROLLBACK commands would be a required part of the > >exception

Re: [HACKERS] Anybody have an Oracle PL/SQL reference at hand?

2004-08-03 Thread Gavin Sherry
On Tue, 3 Aug 2004, Tom Lane wrote: > "Jim C. Nasby" <[EMAIL PROTECTED]> writes: > > On Tue, Aug 03, 2004 at 10:17:14AM -0400, Tom Lane wrote: > >> Right. Essentially, our implementation is supplying the SAVEPOINT and > >> ROLLBACK TO commands implicitly as part of any block with an EXCEPTION > >

Re: [HACKERS] Anybody have an Oracle PL/SQL reference at hand?

2004-08-03 Thread Christopher Kings-Lynne
BEGIN; SAVEPOINT start; INSERT INTO users VALUES(user || suffix); EXIT; EXCEPTION WHEN UNIQUE_VIOLATION THEN ROLLBACK TO start;

Re: [HACKERS] Anybody have an Oracle PL/SQL reference at hand?

2004-08-03 Thread Christopher Kings-Lynne
Depending on how tense you want to be about Oracle compatibility, we could make people actually write their blocks as above --- that is, the SAVEPOINT and ROLLBACK commands would be a required part of the exception-block syntax. They wouldn't actually *do* anything, but they would make the code lo

Re: [HACKERS] Anybody have an Oracle PL/SQL reference at hand?

2004-08-03 Thread Tom Lane
"Jim C. Nasby" <[EMAIL PROTECTED]> writes: > On Tue, Aug 03, 2004 at 10:17:14AM -0400, Tom Lane wrote: >> Right. Essentially, our implementation is supplying the SAVEPOINT and >> ROLLBACK TO commands implicitly as part of any block with an EXCEPTION >> clause. When we get around to updating the "

Re: [HACKERS] Anybody have an Oracle PL/SQL reference at hand?

2004-08-03 Thread Jim C. Nasby
On Tue, Aug 03, 2004 at 10:17:14AM -0400, Tom Lane wrote: > Gavin Sherry <[EMAIL PROTECTED]> writes: > > > BEGIN; > > SAVEPOINT start; > > INSERT INTO users VALUES(user || suffix); > > EXIT; > > EXCEPTION > >

Re: [HACKERS] Anybody have an Oracle PL/SQL reference at hand?

2004-08-03 Thread Jim C. Nasby
The upsides, as I see them: They use one system for handling all exceptions, user generated or not. They didn't come up with their own arbitrary names for all the error codes they have. Naming an exception follows all the namespace rules; for example, the exception code example I gave was in the

Re: [HACKERS] Anybody have an Oracle PL/SQL reference at hand?

2004-08-03 Thread Tom Lane
Gavin Sherry <[EMAIL PROTECTED]> writes: > BEGIN; > SAVEPOINT start; > INSERT INTO users VALUES(user || suffix); > EXIT; > EXCEPTION > WHEN UNIQUE_VIOLATION THEN >

Re: [HACKERS] Anybody have an Oracle PL/SQL reference at hand?

2004-08-03 Thread Tom Lane
Gavin Sherry <[EMAIL PROTECTED]> writes: > I agree with you that forcing users to declare names for SQLCODEs is not > such a great idea. What I do like, however, is the ability to declare your > own exceptions. For example: Agreed, that would be a good thing to have, but I think it's something we'

Re: [HACKERS] Anybody have an Oracle PL/SQL reference at hand?

2004-08-03 Thread Gavin Sherry
One other difference when compared with Oracle is that Oracle does not abort the transaction which raised the exception. Although I generally do not think this is a great idea, it does allow for things like retry loops. Assuming we have savepoints, consider the following function which creates a us

Re: [HACKERS] Anybody have an Oracle PL/SQL reference at hand?

2004-08-03 Thread Gavin Sherry
On Mon, 2 Aug 2004, Tom Lane wrote: > "Jim C. Nasby" <[EMAIL PROTECTED]> writes: > > Oracle defines very few named exceptions. Instead, the intention is that > > you define a name for a numeric exception and use it yourself. > > Yeah, I noticed that. It seems a spectacularly bad idea :-(. What >

Re: [HACKERS] Anybody have an Oracle PL/SQL reference at hand?

2004-08-02 Thread Tom Lane
"Jim C. Nasby" <[EMAIL PROTECTED]> writes: > Oracle defines very few named exceptions. Instead, the intention is that > you define a name for a numeric exception and use it yourself. Yeah, I noticed that. It seems a spectacularly bad idea :-(. What redeeming social value has it got? AFAICS ther

Re: [HACKERS] Anybody have an Oracle PL/SQL reference at hand?

2004-08-02 Thread Jim C. Nasby
On Sat, Jul 31, 2004 at 01:43:25PM -0400, Tom Lane wrote: > Andrew Dunstan <[EMAIL PROTECTED]> writes: > > Tom Lane wrote: > >> Can anyone check how well the syntax of plpgsql EXCEPTION, as described > >> at > >> http://developer.postgresql.org/docs/postgres/plpgsql-control-structures.html#PLPGSQL-

Re: [HACKERS] Anybody have an Oracle PL/SQL reference at hand?

2004-07-31 Thread Christopher Kings-Lynne
Hi Tom, I have sent you and the list the HTML page from the oracle tech network describing all of this. However, it seems to have disappeared in to the void since you don't seem to have received it and it hasn't hit the list yet. You can get a free login to access all the oracle docs and manua

Re: [HACKERS] Anybody have an Oracle PL/SQL reference at hand?

2004-07-31 Thread Tom Lane
Andrew Dunstan <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Can anyone check how well the syntax of plpgsql EXCEPTION, as described >> at >> http://developer.postgresql.org/docs/postgres/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING >> agrees with what Oracle does? > It appears you ca

Re: [HACKERS] Anybody have an Oracle PL/SQL reference at hand?

2004-07-31 Thread Joshua D. Drake
Hello, From I can tell from Oracle pl/SQL programming page 130 ;) it is identical. However Oracle does have thinkgs like EXCEPTION_INIT. Here are the name of the Oracle predefined exceptions: CURSOR_ALREADY_OPEN DUP_VAL_ON_INDEX INVALID_CURSOR INVALID_NUMBER LOGIN_DENIED NO_DATA_FOUND NOT_LOGGED_

Re: [HACKERS] Anybody have an Oracle PL/SQL reference at hand?

2004-07-31 Thread Andrew Dunstan
Tom Lane wrote: Can anyone check how well the syntax of plpgsql EXCEPTION, as described at http://developer.postgresql.org/docs/postgres/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING agrees with what Oracle does? I did some googling but couldn't find anything that seemed authoritative.

[HACKERS] Anybody have an Oracle PL/SQL reference at hand?

2004-07-31 Thread Tom Lane
Can anyone check how well the syntax of plpgsql EXCEPTION, as described at http://developer.postgresql.org/docs/postgres/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING agrees with what Oracle does? I did some googling but couldn't find anything that seemed authoritative. I'm wondering in