Jasen Betts schrieb:
On 2010-05-11, Torsten Zühlsdorff wrote:
Hello,
i have a problem with a trigger written in pl/pgsql.
It looks like this:
CREATE OR REPLACE FUNCTION versionize()
RETURNS TRIGGER
AS $$
BEGIN
NEW.revision := addContentRevision (OLD.content_id, OLD.revision);
/* not
On 2010-05-11, Torsten Zühlsdorff wrote:
> Hello,
>
> i have a problem with a trigger written in pl/pgsql.
>
> It looks like this:
>
> CREATE OR REPLACE FUNCTION versionize()
> RETURNS TRIGGER
> AS $$
> BEGIN
>
>NEW.revision := addContentRevision (OLD.content_id, OLD.revision);
>
>/* not w
On 05/11/10 18:26, Torsten Zühlsdorff wrote:
Tom Lane schrieb:
=?ISO-8859-15?Q?Torsten_Z=FChlsdorff?= writes:
NEW.revision := addContentRevision (OLD.content_id, OLD.revision);
/* not working line, just a stub:
EXECUTE 'INSERT INTO ' || TG_TABLE_NAME || ' SELECT $1 ' USING NEW;
*/
RETU
Torsten,
Usually, the “insert ... (select ...)” has the select portion enclosed in
parenthesis. Don't know if solution is that simple but did not see it in your
examples. It may be worth a try.
Stuart
- Original message -
> Hello,
>
> i have a problem with a trigger written in pl/pgs
Hello,
i have a problem with a trigger written in pl/pgsql.
It looks like this:
CREATE OR REPLACE FUNCTION versionize()
RETURNS TRIGGER
AS $$
BEGIN
NEW.revision := addContentRevision (OLD.content_id, OLD.revision);
/* not working line, just a stub:
EXECUTE 'INSERT INTO ' || TG_TABLE_NAM
Tom Lane schrieb:
=?ISO-8859-15?Q?Torsten_Z=FChlsdorff?= writes:
NEW.revision := addContentRevision (OLD.content_id, OLD.revision);
/* not working line, just a stub:
EXECUTE 'INSERT INTO ' || TG_TABLE_NAME || ' SELECT $1 ' USING NEW;
*/
RETURN NULL;
This seems like the
=?ISO-8859-15?Q?Torsten_Z=FChlsdorff?= writes:
>NEW.revision := addContentRevision (OLD.content_id, OLD.revision);
>/* not working line, just a stub:
>EXECUTE 'INSERT INTO ' || TG_TABLE_NAME || ' SELECT $1 ' USING NEW;
>*/
>RETURN NULL;
This seems like the hard way. Why do
Hello,
i have a problem with a trigger written in pl/pgsql.
It looks like this:
CREATE OR REPLACE FUNCTION versionize()
RETURNS TRIGGER
AS $$
BEGIN
NEW.revision := addContentRevision (OLD.content_id, OLD.revision);
/* not working line, just a stub:
EXECUTE 'INSERT INTO ' || TG_TABLE_NAM
Hello,
i have a problem with a trigger written in pl/pgsql.
It looks like this:
CREATE OR REPLACE FUNCTION versionize()
RETURNS TRIGGER
AS $$
BEGIN
NEW.revision := addContentRevision (OLD.content_id, OLD.revision);
/* not working line, just a stub:
EXECUTE 'INSERT INTO ' || TG_TABLE_NAM