From: Emmanuel Engelhart <"Emmanuel Engelhart"@postgresql.org>
To: pgsql-sql@postgresql.org
Cc: emmanuel.engelhart@epita.fr
Subject: CREATE VIEW (dynamically)
Date: Sat, 9 Nov 2002 14:52:11 +0000
Message-ID: <20021109145211.260cb84f.Emmanuel Engelhart@rack> (raw)
code
<<
CREATE FUNCTION "requests_insert_after" () RETURNS opaque AS '
DECLARE
view_name text;
BEGIN
view_name := ''request_'' || NEW.id;
CREATE VIEW view_name AS select * from groups;
return NEW;
END' LANGUAGE 'plpgsql';
CREATE TRIGGER "requests_insert_after" AFTER INSERT ON "requests" FOR EACH ROW
EXECUTE PROCEDURE "requests_insert_after" ();>>
This code after an insertion on table "requests" give me this message :
<<
PostgreSQL said: ERROR: parser: parse error at or near "$1"
>>
Why ?
Thx for any help.
Emmanuel Engelhart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: "Emmanuel Engelhart"@postgresql.org, emmanuel.engelhart@epita.fr
Subject: Re: CREATE VIEW (dynamically)
In-Reply-To: <20021109145211.260cb84f.Emmanuel Engelhart@rack>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox