Re: plpgsql

From: Kovacs Zoltan Sandor <tip(at)pc10(dot)radnoti-szeged(dot)sulinet(dot)hu>
To: Jie Liang <jliang(at)ipinc(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: plpgsql
Date: 2000-12-12 06:42:49
Message-ID: Pine.LNX.4.05.10012120739470.220-100000@pc10.radnoti-szeged.sulinet.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> Hi, there,
>
> Is there any way to handle exception ( such as cannot insert duplicate key on
> a unique index) in
> plpgsql function?
>
> I don't want it abort whole transaction instead I want to do something else if
> it happened,
> but I don't want to use a select stmt first to waste the time.
Bad news: there is no such statement in PLPGSQL you like. My usual way to
do this is the same you wrote (SELECT first, if no rows FOUND, do the
INSERT).

Zoltan

In response to

  • plpgsql at 2000-12-08 20:51:30 from Jie Liang

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Junaid Kalim 2000-12-12 08:15:43 lo_import & lo_export
Previous Message Robert B. Easter 2000-12-12 05:22:20 Re: Where Can I find JDBC driver.