473,399 Members | 3,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

how to catch the error in procedure ?

I need catch the error when my insert clause violate the
primary key .How to write in the server function ?
Thanks for any advice .
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 22 '05 #1
2 2416
On Friday 16 January 2004 04:50, LitelWang wrote:
I need catch the error when my insert clause violate the
primary key .How to write in the server function ?
Thanks for any advice .


You can't (at the moment). An error terminates a transaction immediately in
PG's current model.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 22 '05 #2
On Fri, 2004-01-16 at 04:41, Richard Huxton wrote:
On Friday 16 January 2004 04:50, LitelWang wrote:
I need catch the error when my insert clause violate the
primary key .How to write in the server function ?
Thanks for any advice .


You can't (at the moment). An error terminates a transaction immediately in
PG's current model.


Didn't someone say this could be implemented in some of the other
pl's... plpython maybe? Or maybe they were using dblink to make a
separate connection/query... ?

Robert Treat
--
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Evgeny Gopengauz | last post by:
Is there something like exception handling in T-SQL? For example, how to catch an error of convertion at this sample: CREATE PROCEDURE SP @param VARCHAR(50) AS BEGIN DELCARE @var INT -- try...
7
by: Dan Bass | last post by:
In a somewhat complex application, I've developed plug-in architecture and am having a problem as to when to catch general exceptions for logging purposes. In each plug-in class library, for...
4
by: Jeff User | last post by:
Hi all I am using an OleDbDataReader. I need to establish and then keep the connection that I use, but I do not need to keep the data reader, after this operation is over. Therefore, regardless...
6
by: Enzo Marinelli | last post by:
Hello everyone, I have a HUGE database, with very complex stored procedures that handle every possible error and the passed it to an ASP site with RAISERROR. Now I need to use that same...
4
by: jy836 | last post by:
When using the Try...Catch...Finally statements, what happens if an error occurs in a procedure called by the main procedure? For instance... Private Sub DoSomething() Try Call...
5
by: Jeff User | last post by:
Hi I wanted to write a general procedure to handle all my errors. My idea was to place various stuff in the error handler then call it, from all my "Catch" blicks, ending it the Exception. ...
32
by: cj | last post by:
Another wish of mine. I wish there was a way in the Try Catch structure to say if there wasn't an error to do something. Like an else statement. Try Catch Else Finally. Also because I...
0
by: appletastic | last post by:
Hi all, I had a question regarding error handling in DB2 SQL I seem to be having some issues. So far I have a procedure, but I need to add a try and catch block in there and withing the catch...
9
by: GiJeet | last post by:
Hello, I come from the VB6 world where we'd put a single ON ERROR GOTO ErrHandler at the top of a method. Now whenever an error happened it would drop into the ErrHandler code. In .Net it seems...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.