Re: LIBPQ Exception

From: Rodrigo De León <rdeleonp(at)gmail(dot)com>
To: "Abraham, Danny" <danny_abraham(at)bmc(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: LIBPQ Exception
Date: 2007-12-12 17:07:04
Message-ID: a55915760712120907h339e08c5xc3bb0b59c8fad90b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Dec 12, 2007 7:36 AM, Abraham, Danny <danny_abraham(at)bmc(dot)com> wrote:
> Any other alternative?

There are no anonymous blocks in PostgreSQL:

You could try creating a function:

create or replace function
shootmyselfinthefoot()
returns boolean as
$$
declare
(...);
begin
execute 'SOME DML HERE';
execute 'SOME MORE DML HERE';
execute 'ETC.';
(...)
exception when others then
-- whatever...
end;
$$ language plpgsql;

... and call that from your C program.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dave Page 2007-12-12 17:08:57 Re: General Q's
Previous Message Joshua D. Drake 2007-12-12 17:01:59 Re: General Q's