Re: triggers and execute...

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: triggers and execute...
Date: 2009-04-28 09:15:47
Message-ID: 20090428091547.GD12225@frubble.xen.chris-lamb.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Apr 27, 2009 at 03:37:22PM -0600, Scott Marlowe wrote:
> On Mon, Apr 27, 2009 at 3:24 PM, Richard Broersma wrote:
> > At this point I don't think that there is a way for this function to
> > know the correct table type of new.* since page_access_... is still
> > only a concatenated string.  There there a way to cast new.* to the
> > correct table type as part of this insert statement?
>
> I tried casting the new.*::page_access and that didn't work. For now
> I'll carry on with the complete listing of everything.

In SQL I can do:

PREPARE _p(parent) AS INSERT INTO subtable SELECT ($1).*;
EXECUTE _p(new);
DEALLOCATE _p;

however this seems to interact badly with the EXECUTE in plpgsql, not
sure how to work around that.

--
Sam http://samason.me.uk/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jasen Betts 2009-04-28 09:56:58 Re: deleting function
Previous Message itishree sukla 2009-04-28 09:14:30 Issue with POSTGIS