From: Dimitrije R. <tem...@gm...> - 2012-06-19 07:41:22
|
Hi, I have encountered a problem when using view types within a function. I read the documentation on VIEW to check if this functionality is not yet implemented in Postgres-XC, but I couldn't find it, so I'm guessing this is supposed to be a bug report (though I am not sure, this may just be a missing feature). Here's my test case: 1) create a table CREATE TABLE test_table ( id SERIAL NOT NULL, other_id int4 NOT NULL, PRIMARY KEY("id") ) DISTRIBUTE BY REPLICATION; 2) create a view CREATE VIEW some_view AS SELECT test_table.* FROM test_table; 3) create a function using the view CREATE OR REPLACE FUNCTION some_function() RETURNS SETOF some_view AS $body$ BEGIN RETURN QUERY SELECT * FROM some_view; END; $body$ LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER COST 100; I get the following error: ERROR: type "some_view" does not exist This runs fine in postgres 9.1.4. Kind regards, Dimitrije |