Re: triggers and execute...

Поиск
Список
Период
Сортировка
От Sam Mason
Тема Re: triggers and execute...
Дата
Msg-id 20090428091547.GD12225@frubble.xen.chris-lamb.co.uk
обсуждение исходный текст
Ответ на Re: triggers and execute...  (Scott Marlowe <scott.marlowe@gmail.com>)
Список 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/

В списке pgsql-general по дате отправления:

Предыдущее
От: itishree sukla
Дата:
Сообщение: Issue with POSTGIS
Следующее
От: Jasen Betts
Дата:
Сообщение: Re: deleting function