Re: Partitionning + Trigger and Execute not working as expected

Поиск
Список
Период
Сортировка
От Josh Kupershmidt
Тема Re: Partitionning + Trigger and Execute not working as expected
Дата
Msg-id CAK3UJREa0Dku2PnJACaLM6=_7OaQEqyPAs-_ZR=zwaDo2mwmAw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Partitionning + Trigger and Execute not working as expected  (Sylvain Mougenot <smougenot@sqli.com>)
Ответы Re: Partitionning + Trigger and Execute not working as expected  (Sylvain Mougenot <smougenot@sqli.com>)
Список pgsql-sql
On Wed, Nov 9, 2011 at 6:57 AM, Sylvain Mougenot <smougenot@sqli.com> wrote:

> Even if the query below is fine (the exact content I try to build as a
> String to use with EXECUTE)
> INSERT INTO job_2011_11 values (NEW.*)
> Is there a way to solve this?
> Isn't it a bug (in how EXECUTE works)?

I doubt this is a bug in EXECUTE; if you think it is, try to post a
self-contained test case. For example, this similar example works
fine:


CREATE TABLE foo (a int, b int);
CREATE TABLE job_2011_11 (c int, d int);

CREATE OR REPLACE FUNCTION job_insert_trigger()
RETURNS TRIGGER AS
$BODY$
DECLAREcurrentTableName character varying := 'job_' || '2011_11';
BEGINEXECUTE 'INSERT INTO '|| currentTableName || ' values ' || (NEW.*);RETURN NULL;
END;
$BODY$ LANGUAGE plpgsql VOLATILE COST 100;

CREATE TRIGGER job_insert_trg BEFORE INSERT ON foo FOR EACH ROW EXECUTE PROCEDURE job_insert_trigger();
INSERT INTO foo (a, b) VALUES (1, 2);


Josh


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

Предыдущее
От: Sylvain Mougenot
Дата:
Сообщение: Re: Partitionning + Trigger and Execute not working as expected
Следующее
От: Sylvain Mougenot
Дата:
Сообщение: Re: Partitionning + Trigger and Execute not working as expected