I'm writing the following stored procedure:
CREATE OR REPLACE FUNCTION getid() RETURNS table(id integer) AS $$
DECLARE
rec RECORD;
BEGIN
select id into rec from player where id = 3;
END $$
LANGUAGE plpgsql;
select * from getid();
And when I'm trying to execute that script I got the error:
column reference "id" is ambiguous
Why? I thought that id column of the returned table is not participate in the select operator...
The issue is that it worked on PostgreSQL 8.4 but doesn't work on PosgtreSQL 9.4. Couldn't you explain what actually has been added in the PostgreSQL 9.4 so it doesn't work?