Re: On_error_stop

From: "Sibte Abbas" <sibtay(at)gmail(dot)com>
To: "Ashish Karalkar" <ashish(dot)karalkar(at)info-spectrum(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: On_error_stop
Date: 2007-07-05 21:48:43
Message-ID: bd6a35510707051448h685ce0ddx816baf58ffd7caed@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On 7/3/07, Ashish Karalkar <ashish(dot)karalkar(at)info-spectrum(dot)com> wrote:
>
>
> Hello All,
>
> I want to run few DDL's from scripts and want the script to halt if any
> error ocuurs, this can be done by on_error_stop
>
> But what I want to do is to display a message something like
>
> If on_error_stop =1
> {
> echo "DDL failed";
> exit();
> }
>
> else "DDL passed";
>
> end
>
> is there any way to do this?
>
> Thanks in advance
> Ashish...
>

AFAIK you cannot write conditional logic within psql.

Similar behavior however can be achieved if you run the sql script
from within a shell script (via psql) and then check the result status
of that command.

regards,
--
Sibte Abbas
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Raimon Fernandez 2007-07-06 06:11:27 Re: subquery with more than one column
Previous Message Jon Sime 2007-07-05 21:27:48 Re: subquery with more than one column