Search Postgresql Archives

Re: Using the NEW record in an EXECUTE command in a PL/pgSQL trigger function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello



2013/1/2 Ali Pouya <alipouya2@xxxxxxxxx>:
> Hi all,
>
> The SQL file joined here reproduces the simplified version of a problem that
> I encounter when trying to use the "NEW" record in an EXECUTE command within
> a PL/PgSql trigger function.
>
> In this script the commented INSERT command works fine but the EXECUTE
> commande returns the following error message :
>
> ERROR:  missing FROM-clause entry for table "new"

you forgot USING clause

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

Regards

Pavel Stehule

>
> I also tried other versions, some of them with the USING clause without
> success.
>
> My aim is to write a generic trigger function ignoring the column names and
> types of the triggering table for partitionning purposes.
>
> Can somebody help me ?
> Thanks a lot
> Best Regards
> Ali
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux