Re: Using the NEW record in an EXECUTE command in a PL/pgSQL trigger function - Mailing list pgsql-general

From Ali Pouya
Subject Re: Using the NEW record in an EXECUTE command in a PL/pgSQL trigger function
Date
Msg-id CAEEEPmxMSgijhG+CdY=hFUZQqZb21697kq9f5dKmAObOAmZLEQ@mail.gmail.com
Whole thread Raw
In response to Re: Using the NEW record in an EXECUTE command in a PL/pgSQL trigger function  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-general

2013/1/2 Pavel Stehule <pavel.stehule@gmail.com>
you forgot USING clause

BEGIN
        EXECUTE 'INSERT INTO measurement1 values(new.*)' USING new;
--        INSERT INTO measurement1 values(new.*);
        RETURN NULL;
END;

Regards

Pavel Stehule

 Hi Pavel,
Thanks for your answer, but it did not work for me (I test on versions 9.1.6 and 9.2.1).

Fortunately I found this solution in the archives :

EXECUTE 'INSERT INTO measurement1 select $1.* ' USING new;



pgsql-general by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Using the NEW record in an EXECUTE command in a PL/pgSQL trigger function
Next
From: Carlos Mennens
Date:
Subject: Dedicated PostgreSQL System