I have a function that proccess some data:
CREATE OR REPLACE FUNCTION A(x integer, y timestamp with time zone, z integer[])
RETURNS SETOF typea AS
$BODY$
SELECT *
FROM func1($1,$2,$3) as a
WHERE ...
$BODY$
LANGUAGE sql VOLATILE
How can I convert the query:
SELECT *
FROM func1($1,$2,$3) as a
WHERE ...
into a VIEW ?
The thing is that func1 needs the function A parameters...
What I have now is this:
CREATE OR REPLACE FUNCTION A(x integer, y timestamp with time zone, z integer[])
RETURNS SETOF typea AS
$BODY$
CREATE OR REPLACE VIEW myView as (select * from func1($1,$2,$3));
select * from myView ;
$BODY$
LANGUAGE sql VOLATILE
and i get
ERROR: relation "myView " does not exist
in the select * from myView ;