Thread: Return dynamic columns of a temporary table
Hi, i am new to postresql and have been trying to convert some of our mssql procedures into postresql functions. What i have been trying to do is to somehow return a temporary table with dynamic columns. Is it possible?
Hello 2012/10/4 clear chan <clear.cas.1140@gmail.com>: > Hi, i am new to postresql and have been trying to convert some of our mssql > procedures into postresql functions. What i have been trying to do is to > somehow return a temporary table with dynamic columns. Is it possible? > it is possible, but usually it is not, what you want CREATE OR REPLACE FUNCTION foo() RETURNS SETOF RECORD AS $$ SELECT * FROM temptab; $$ LANGUAGE sql; but you have to specify columns in query SELECT * FROM foo() (a int, b int, c int); A style of PostgreSQL stored procedures is significantly different than MSSQL - it is more close to Oracle. Regards Pavel Stehule >