Re: More plpgsql fun! (deleting large object refs)

From: "Robert B(dot) Easter" <reaster(at)comptechnews(dot)com>
To: Adam Haberlach <adam(at)newsnipple(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: More plpgsql fun! (deleting large object refs)
Date: 2001-01-18 04:05:09
Message-ID: 0101172305090G.02219@comptechnews
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I did it using a rule before:

CREATE RULE image_delete_lo AS
ON DELETE TO images
DO SELECT lo_unlink(old.image);

In PL/pgSQL, you can try using PERFORM:

BEGIN
PERFORM lo_unlink(OLD.bootstrap_script);
PERFORM lo_unlink(OLD.update_archive);
END;

On Wednesday 17 January 2001 20:06, Adam Haberlach wrote:
> Now that I have some magic triggers deleting and updating
> rows based on the actions of referring rows, I have to take
> care of the deletion of large objects associated with some
> rows. Any idea how I should do this?
>
>
> I tried...
> BEGIN
> SELECT lo_unlink(OLD.bootstrap_script);
> SELECT lo_unlink(OLD.update_archive);
> END;
>
> ....this gave "Unexpected SELECT in..." errors.
>
> I tried...
> BEGIN
> lo_unlink(OLD.bootstrap_script);
> lo_unlink(OLD.update_archive);
> END;
>
> ....this gave parse errors...

--
-------- Robert B. Easter reaster(at)comptechnews(dot)com ---------
-- CompTechNews Message Board http://www.comptechnews.com/ --
-- CompTechServ Tech Services http://www.comptechserv.com/ --
---------- http://www.comptechnews.com/~reaster/ ------------

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Lamar Owen 2001-01-18 04:46:11 Re: Re: postgresql.conf ignored
Previous Message HC Mercy T. de Vera 2001-01-18 03:11:58 TRIGGER