Re: [GENERAL] returned value from SQL statement

2008-03-27 Thread Albe Laurenz
Alain Roger wrote: > i would like to know how can i control the returned value from a SQL > statement ? > for example, if i do an INSERT INTO... : > 1. how can i know if the INSERT worked ? > i mean i already trapped the unicity violation, but what if > there is another error ? where can i get a

Re: [GENERAL] returned value from SQL statement

2008-03-27 Thread Albe Laurenz
Alain Roger wrote: > the purpose here, it is to solve my problem with a transaction inside a > function. You cannot handle transactions inside a function (apart from using EXCEPTION blocks). A PostgreSQL function is always executed in a single transaction. All SQL statements you issue from with

Re: [GENERAL] returned value from SQL statement

2008-03-27 Thread Sam Mason
On Thu, Mar 27, 2008 at 11:25:18AM +0100, Alain Roger wrote: > not really.. but it is true that it can be confusing...sorry :-( > > the purpose here, it is to solve my problem with a transaction inside a > function. hum, I think PG works a little differently than you think. a function is run insi

Re: [GENERAL] returned value from SQL statement

2008-03-27 Thread Alain Roger
not really.. but it is true that it can be confusing...sorry :-( the purpose here, it is to solve my problem with a transaction inside a function. i need to know if there is a common return value for error in case of a SQL statement failed. it seems that not, so i would like to know if the rollbac

Re: [GENERAL] returned value from SQL statement

2008-03-27 Thread Craig Ringer
Alain Roger wrote: > sorry... under pl/pgsql as stored procedure Then this question was already asked and answered less than a week ago on this mailing list. By you, with almost exactly the same subject line. Forgive my confusion, but why are you asking the same question again? What's changed si

Re: [GENERAL] returned value from SQL statement

2008-03-27 Thread Alain Roger
thanks for the link regarding errors... i did not find it before. On Thu, Mar 27, 2008 at 10:47 AM, Richard Huxton <[EMAIL PROTECTED]> wrote: > Alain Roger wrote: > > hi, > > > > i would like to know how can i control the returned value from a SQL > > statement ? > > for example, if i do an INSER

Re: [GENERAL] returned value from SQL statement

2008-03-27 Thread Richard Huxton
Alain Roger wrote: hi, i would like to know how can i control the returned value from a SQL statement ? for example, if i do an INSERT INTO... : 1. how can i know if the INSERT worked ? i mean i already trapped the unicity violation, but what if there is another error ? where can i get a complet

Re: [GENERAL] returned value from SQL statement

2008-03-27 Thread Craig Ringer
Alain Roger wrote: hi, i would like to know how can i control the returned value from a SQL statement ? You've left out some pretty significant information, like what method you're using to access PostgreSQL. ODBC from C/C++/whatever? PHP? Perl DBD? Python DBI? The .net interfaces?

Re: [GENERAL] returned value from SQL statement

2008-03-27 Thread Alain Roger
sorry... under pl/pgsql as stored procedure On Thu, Mar 27, 2008 at 10:46 AM, Craig Ringer <[EMAIL PROTECTED]> wrote: > Alain Roger wrote: > > hi, > > > > i would like to know how can i control the returned value from a SQL > > statement ? > > > > You've left out some pretty significant informati

[GENERAL] returned value from SQL statement

2008-03-27 Thread Alain Roger
hi, i would like to know how can i control the returned value from a SQL statement ? for example, if i do an INSERT INTO... : 1. how can i know if the INSERT worked ? i mean i already trapped the unicity violation, but what if there is another error ? where can i get a complete list of exceptions