Re: [GENERAL] Error handling in C API function calls in a way that doesn't close client connection

2015-04-02 Thread Tom Lane
Igor Stassiy writes: > This question refers to version 9.4 of Postgres. I have have a function > Datum do_something(PG_FUNCTION_ARGS) > { > ... > if(error_occured) { > ereport(ERROR, (errmsg("some error occured"))); > } > ... > } > When I call do_something in a way to del

[GENERAL] Error handling in C API function calls in a way that doesn't close client connection

2015-04-02 Thread Igor Stassiy
Hello all, This question refers to version 9.4 of Postgres. I have have a function Datum do_something(PG_FUNCTION_ARGS) { ... if(error_occured) { ereport(ERROR, (errmsg("some error occured"))); } ... } When I call do_something in a way to deliberately cause the error cond

Re: [GENERAL] error handling

2012-06-23 Thread Jasen Betts
On 2012-06-20, Little, Douglas wrote: > --_000_8585BA53443004458E0BAA6134C5A7FBADD4CD8CEGEXCMB01owwroo_ > Content-Type: text/plain; charset="us-ascii" > Content-Transfer-Encoding: quoted-printable > > Hello, > > Greenplum 4.1.2.4 (PG 8.2.3) > We are revising how we implement functions in order to

[GENERAL] error handling

2012-06-20 Thread Little, Douglas
Hello, Greenplum 4.1.2.4 (PG 8.2.3) We are revising how we implement functions in order to better capture and handle fatal errors. What we want to have happen, 1. is to have the fatal error captured, 2. logged to our processing table, 3. then have the function & psql exit wi

Re: [GENERAL] Error handling in PL/PgSQL (without execution termination)

2010-12-08 Thread Allan Kamau
Thanks Pavel, this is exactly what I have been looking for. Allan On Thu, Dec 9, 2010 at 8:44 AM, Pavel Stehule wrote: > Hello > > http://www.postgresql.org/docs/9.0/interactive/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING > > Regards > > Pavel Stehule > > 2010/12/9 Allan Kamau : >> I

Re: [GENERAL] Error handling in PL/PgSQL (without execution termination)

2010-12-08 Thread Pavel Stehule
Hello http://www.postgresql.org/docs/9.0/interactive/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING Regards Pavel Stehule 2010/12/9 Allan Kamau : > I am searching for the resource that explains how to handle SQL > related exceptions in PL/PgSQL without letting the function's > execution

[GENERAL] Error handling in PL/PgSQL (without execution termination)

2010-12-08 Thread Allan Kamau
I am searching for the resource that explains how to handle SQL related exceptions in PL/PgSQL without letting the function's execution terminate. I would like to use his to address possible UNIQUE constraint violation (and resulting exception) attributed to multiple clients concurrently populating

Re: [GENERAL] Error handling inside PL/pgSQL functions

2006-10-12 Thread Jeff Davis
On Thu, 2006-10-12 at 16:12 -0400, Germán Hüttemann Arza wrote: > I am writing triggers procedures in PL/pgSQL and I need to handle some > errors inside the procedures. > Specifically, I am doing a CAST(char AS integer) and I want to know > when the char isn't a digit. How can I get do that? > >

Re: [GENERAL] Error handling inside PL/pgSQL functions

2006-10-12 Thread Jeff Davis
On Thu, 2006-10-12 at 15:22 -0500, Tony Caduto wrote: > Germán Hüttemann Arza wrote: > > I am writing triggers procedures in PL/pgSQL and I need to handle some > > errors inside the procedures. > > Specifically, I am doing a CAST(char AS integer) and I want to know > > when the char isn't a digit

Re: [GENERAL] Error handling inside PL/pgSQL functions

2006-10-12 Thread Tony Caduto
Germán Hüttemann Arza wrote: I am writing triggers procedures in PL/pgSQL and I need to handle some errors inside the procedures. Specifically, I am doing a CAST(char AS integer) and I want to know when the char isn't a digit. How can I get do that? Just off the top of my head I would say you

[GENERAL] Error handling inside PL/pgSQL functions

2006-10-12 Thread Germán Hüttemann Arza
I am writing triggers procedures in PL/pgSQL and I need to handle some errors inside the procedures. Specifically, I am doing a CAST(char AS integer) and I want to know when the char isn't a digit. How can I get do that? Regards,-- Germán Hüttemann

Re: [GENERAL] error handling in cast functions for user defined types

2006-05-16 Thread Don Y
Tom Lane wrote: Don Y <[EMAIL PROTECTED]> writes: I'm writing a set of casts to/from various user defined types. As is unexpected, there are cases where one data type doesn't neatly map to another (for certain values). In these cases I emit an INVALID_PARAMETER_VALUE or OUT_OF_RANGE error -- d

Re: [GENERAL] error handling in cast functions for user defined types

2006-05-15 Thread Tom Lane
Don Y <[EMAIL PROTECTED]> writes: > I'm writing a set of casts to/from various user defined > types. As is unexpected, there are cases where one > data type doesn't neatly map to another (for certain > values). In these cases I emit an INVALID_PARAMETER_VALUE > or OUT_OF_RANGE error -- depending

[GENERAL] error handling in cast functions for user defined types

2006-05-15 Thread Don Y
Hi, I'm writing a set of casts to/from various user defined types. As is unexpected, there are cases where one data type doesn't neatly map to another (for certain values). In these cases I emit an INVALID_PARAMETER_VALUE or OUT_OF_RANGE error -- depending on the situation. But, should I also

[GENERAL] error handling codes

2005-02-20 Thread Sim Zacks
PostGresQL 8 beta1. PGAdmin III beta 1.21 Is there a way to see what error code or error message occured when an error happens? I am trying to perform exception handling and a create view that included another view that did not exist occured in a plpgsql function. I finally figured out that the er

Re: [GENERAL] Error handling in stored functions/procedures

2004-05-31 Thread Karsten Hilbert
> You mean that the default generated error messages contain some more > information I presume, like the table name and the constraint name ? Even better, the information is *structured* afaik. > I think I noticed that already, and since I had time since yesterday > evening, I thought things over

Re: [GENERAL] Error handling in stored functions/procedures

2004-05-30 Thread Jurgen Defurne
On Sun, 30 May 2004 22:08:10 +0200 Karsten Hilbert <[EMAIL PROTECTED]> wrote: > > This then, removes the first part of my explanation, and dumps me > > completely in the second part, which is where the biggest problems > > reside. > AFAICT 7.4 does much better error handling (no, you can't > easil

Re: [GENERAL] Error handling in stored functions/procedures

2004-05-30 Thread Karsten Hilbert
> This then, removes the first part of my explanation, and dumps me > completely in the second part, which is where the biggest problems > reside. AFAICT 7.4 does much better error handling (no, you can't easily control error handling inside a transaction, though). It reports errors in a way that c

Re: [GENERAL] Error handling in stored functions/procedures

2004-05-30 Thread Jurgen Defurne
On Sun, 30 May 2004 20:04:50 +0200 Karsten Hilbert <[EMAIL PROTECTED]> wrote: > > a) The basic contents of the internal data dictionary can be used to > > check incoming fields from on their length and permitted contents. > > > > b) With a little extra work, I should be able to define a table > >

Re: [GENERAL] Error handling in stored functions/procedures

2004-05-30 Thread Karsten Hilbert
> a) The basic contents of the internal data dictionary can be used to > check incoming fields from on their length and permitted contents. > > b) With a little extra work, I should be able to define a table which > can be used to check field contents against field masks. You can use column check

[GENERAL] Error handling in stored functions/procedures

2004-05-30 Thread Jurgen Defurne
I am currently designing an application which should be accessible from different interfaces. For this I like to be using stored procedures to process the contents of form submissions and dialog screens. After studying the PG database, it seems to me that I can fulfill the following requirements.

Re: [GENERAL] error handling. How to?

2001-07-09 Thread Richard Huxton
From: "Janning Vygen" <[EMAIL PROTECTED]> > one of my problems: > if i have a value like bool or int2 and the frontend is html and just takes > the input from a textfield, the backend returns an error before executing the > trigger beacuse the values cant be parsed into the correct type. > > But

[GENERAL] error handling. How to?

2001-07-09 Thread Janning Vygen
Hi, i try do achieve that my database checks every entry on insert and update and returns german error messages, so my frontend knows what's wrong and can show some reasonable error messages to the user. i wrote a trigger who checks BEFORE every insert and updtae and returns error messages if